Wednesday, December 12, 2012

5 Great custom controls for Android

As an Android developer, one needs to make sure that the applications look good on all the devices irrespective of their sizes, manufacturer and OS versions. Here is a list of some great libraries that would make your applications look great.



ActionBar Sherlock

The library will automatically use the native action bar when appropriate or will automatically wrap a custom implementation around your layouts. This allows you to easily develop an application with an action bar for every version of Android from 2.x and up.


ViewPager Indicator

A great library to get view page indicators in multiple styles. A must have in you app if you a are planning to get rid of traditional tab-widgets.





Lock Pattern

Android has an useful tool in security settings, it is Lock Pattern. Users can define their own lock pattern ‒ which is a combination of 4+ dots and use it as the password to their device. This library extends the same functionality and enables you to make your app secure with a pattern lock. 

 Pull to Refresh

Twitter has it, Facebook has it and now your Android app can also have this cool feature! Just pull the listview to refresh the contents. Very simple to integrate and fun to use feature.











 CoverFlow

This is a simple implementation of android's cover flow    widget and is a cool feature for media and image heavy applications.

Friday, December 7, 2012

Tips and tricks for smarter development

Here is a compilation of the handy tips and tricks that i come across while developing for Android.The list is expected to grow with time and you can always post a comment to get something added to it :)

1. Go wireless

Install ADBwireless from playstore on your device and press the "Big Button" to enable wireless degubbing. Change to the platform-tools folder of the android-sdk and type the following command:
./adb connect 192.168.xxx.xxx:XXXX
Check for the device in the eclipse DDMS perspective and use it just like a normal connected device. Unfortunately it works on for rooted devices.

2. Have a memory management activity

The "Clear Data" button present by default in the "Manage Applications" clears the database and shared preferences for the application.If you do not want the users to clear all the data then this option can be overridden by adding a custom space-management activity in the application. Add the following line to Application tag:

 android:manageSpaceActivity="your.package.name.activityname"


3. Let the user choose install location

In the Android manifest file add the following line to the manifest tag and set the location of app installation. I always choose preferExternal so that apps can be moved to sd card, but that might not be a wise choice for game developers.

    android:installLocation="preferExternal"

4.  Not Enough space to install the application!

Do you really need to remove applications to install new ones? No you don't! Connect the device to adb and run the following command and install as many apps you want on the sdcard.

 ./adb shell pm setInstallLocation 2

5. Save time writing parsers , use Gson

 If you need to parse JSON responses from web services, you can save a lot of time by using Gson API. It is an android compatible JSON parser which parses the response and populates the beans with just tow lines of code!

6. Surprise!

Go to phone Settings > About phone  and tap multiple times on the Firmware version option.