I’m surprised that I cannot find much information on the internet about this. I would have thought that it would be a hot topic, especially with the release of ICS.
Anyway, I was wondering if anyone had any information on the best practice for implementing an action bar in android (given an app with backwards compatibility to 2.1 or less).
I am aware that in android 3.0 and above the action bar is a native element. However, I’m also aware that a lot of application are already implementing the action bar in their apps which are (in many cases) backwards compatible to 2.1 and less.
Currently I am using a library called greendroid to implement the action bars in my apps. This works fairly well, however I’m conscious that it is a work around, and that possibly the native action bar in android 3.0 and above is not used.
So I was wondering if anyone had any information on how to implement an action bar properly in an android app, so that it is embracing the new technologies of the latest android versions, but also so that it is backwards compatible and looks and functions the same in previous versions of android.
Twitter, Android Market, Facebook etc all have this functionality. Are they all “custom” action bars? Or do they provide the native functionality for Android 3.0+?
Thanks for your insights.
I think the only way to do it right is by extending the compatibility library. I’ve seen one good example of this being done (correctly, IMO) for the Action Bar by ActionBarSherlock. If you don’t want to use their library, you can certainly download it and learn from it.
While Twitter, Android Market and Facebook probably don’t use this exact library, they almost certainly implement the same sort of things.