Sunday, January 20, 2013

Backward compatibility super quick

Setting up a project with ActionBar, NavigationTabs and swipe navigation in less than 2 minutes!

I have always appreciated how Action bar Sherlock provides the latest navigation features for the devices with lower versions of android , but only today did I realize that it is also super easy to configure. Make sure you have the latest versions of ADT and actiobarsherlock configured with your eclipse and follow the steps below to get you project running in less than 2 minutes.

Step 1.

In eclipse navigate to File->New->Other->Android Application Project. Enter the project details and set the Mininum Required SDK,Target SDK and Compile With with the highest available values(must be >11).
Click Next and setup the other values also in the following 2 screens.

Step 2.

Under the Create Activity screen,choose BlankActivity  and in the following screen select either of the options depending on how you want the navigation in your project.

Step 3

Delete the libs\android-support-v4.jar from the project and add the one present in the ActionBar Sherlock project.This is because the project might not compile if the versions of the jars mismatch.

Step 4
Navigate to project Properties->Android->Add Library and add the Action bar project.

Step 5 

Open the Activity's java file and replace the following:
FragmentActivity  ---> SherlockFragmentActivity
getActionBar ---> getSupportActionBar()
gettMenuInflater() --> getSupportMenuInflater()

Step 6 

Remove all imports from the java file and press ctrl+shift+o . Select the packages from the Sherlock Action Bar project for import when prompted.

Step 7

Open the AndroidManifest.xml file and change the minimun sdk version to 8 and the theme to Theme.Sherlock.Light.

This is all and your project would run like a charm on all versions of Android.



Friday, January 18, 2013

Android 4.2 Yet another power user tip!

Should I call it an Easter egg or a power user feature?
  1.  Navigate to the Contacts/People application on your Android 4.2 device and search "debug debug!" 
  2. Click Export database files
  3. click Send

As per the message, you can email yourself the backup of all the contacts, email and call logs.

  

Wednesday, January 2, 2013

Development options Android 4.2

In a move to make the platform more user friendly, Google has hidden the otherwise visible "Developer options" menu for the versions 4.2(and above??). So if you are a developer and wandering where to enable USB debugging for your shining new Nexus,  just navigate to Settings > About tablet and tap on the Build Number a few times and the menu will appear at its usual place.
Don't forget to tap on the Android Version a few times too and shoot some jelly beans ;) 

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.