Mobile Application Developer

Home » » Hidden features of Android development

Hidden features of Android development

Written By Mitul Nakum on Wednesday, May 5, 2010 | 5:47 PM

Hopefully there aren't too many hidden, hidden features - but here's some of the less well known and non-intuitive features available for Android that will definitely make your life easier and your apps better.

  • All the source code for the platform and all the non-Google native apps is available for you to browse, download, borrow, or steal from the Android Open Source project.
  • Using the resources framework, creating localized versions of your app is as simple as adding a new annotated subfolder (Eg. values-fr) that contains an XML file with strings in a different language (Eg. French). Android will choose the right folder at runtime for you.
    • The same resources framework lets you use alternate layouts for different hardware configurations, screen pixel densities, and input devices just by dropping them in named folder.
  • Since Android 1.6, your app can produce results that will appear in the results from a homescreenQuick Search Box search.
  • Using Intents and Intent Filters your apps can make and service anonymous requests for an action to be completed (Eg. Where requesting a table booking from Open Table).
    • They can request an unknown application to complete an action without needing to know which application(s) can fulfill that request
    • Your app can fulfill requests from unknown apps to complete actions without needing to know which apps will make the requests. Play this right and you can create the 'default' Twitter app, or booking app, etc.
  • Using Alarms you can set your app to complete tasks at predetermined times, even if your app isn't running.
    • You can save a lot of battery life using the setInexactRepeating method to schedule regular events (like server polling or updates). It will synchronize alarms from multiple apps to occur at the same time rather than adhoc.
  • Using the Preferences framework you can create settings screens for your apps in the same style as the system settings. You can even incorporate system settings screens (Eg. Security and Location) into your application's settings hierarchy.
  • Using the AudioTrack and AudioRecord APIs, you can stream audio data directly from and to the PCM audio buffers.

Also with regard to best practices, you may want to check out Android coding style:

http://source.android.com/submit-patches/code-style-guide

as well as the eclipse code and imports formatters (android-formatting.xml, android.importorder) which are found in the platform source code under development/ide/eclipse

About Mitul Nakum

15+ years of experience in mobile application development which includes Symbian, J2ME, Android and iOS development

0 comments :

Post a Comment