Add Action bar in Any Android Application

      Action bar is introduce in android V 3.0 Honeycomb . but if you want Actionbar in  your application and that also run on Android V 2.1 Foryo then you have to add Library which allow you to develop application with Actionbar. There are many 3rd party API (Library) available which you can use in your application for Actionbar. Google developer have developed Actionbar Compat library to work with action bar on the Android API level 8.

Action bar Compat is still in development state (Google developer are working on it) . so i am gone tech you how you can use Action Bar Sherlock in your application. Action Bar Sherlock is 3rd party API  that inherit all methods from activity class of android framework.
You can download Action bar Sherlock API from here.

Follow the Instruction to Add ActionBar Sherlock.

  1.  Extract Folder At any place.
  2.  Open Eclipse and Import Existing Project in your workspace.

3. After Import Right Click on Project and Goto Properties And Mark it as library.

4.  Now Goto Your Project Or Add new Project And Right Click on it and goto Properties and      then add that actionbarSherlock project as Library.

That's it . now some modification you are require to do in your project is as follows.

  1.  In Your Project you have to extends SherlockActivity in place of Activity .
  2. in manifest file you have to apply theme on each and every activity. like this  android:theme="@style/Theme.Sherlock.Light".

As you can see i am running application on Gingerbread emulator and still it display action bar. so now there are no limits for actionbar in your app. I hope you get the Point and can easily explore Action Bar Sherlock. if you have any query or problem then let me know. 

Keep Coding and cheers...


Post a Comment