So I have a few questions about implementing the Android action bar. Up to this point I haven’t really made any apps that were (in my opinion) good enough to put on the market. This really seems to be my inability to understand how the layouts and action bar will work in different versions of Android.
Of course Google seems to be the best bet for this, but I come across a few grey areas that maybe someone can clear up. I can see that the Action bar was implemented in API level 11, but then what happens when I try to run it on a device lower than 3.0? Also, this seems to be the most helpful when understanding on how and where to use the Action bar, but does this mean the action bar is done all programatically and not in the layout? I guess it’s safe to say that I’m a bit “intimidated” by using the action bar because of the different layouts I’ll get in different devices… so is there a way to make it “look” like I have an action bar even though it’s done purely through layouts? Or is that a bad habit to get into?
I have heard that maybe the compatibility library might work well, but I don’t really know what it does and I’m not yet savy enough to understand the android documentation on what it “really” does. If it really is “that” helpful at supporting older devices, why isn’t it built/come standard in the SDK?
I know this is a very broad question, but when it boils down to it, I just want to know if there really is a way to make all of my layouts look and work the same, or if it’s even worth my time and just have the action bar auto downgrade for old devices.
Just an additional question, I have a Galaxy Nexus and all of the core Google Apps look awesome with the action bar, but is there a way to see these updated apps running on API 11 or lower?
Lastly, if anyone has stumbled upon a great tutorial on any of this please list it. I’m really trying to become knowledgeable on how Android layouts work in all API levels.
By default, the user will get options menus, as before. Or, use ActionBarSherlock to have an action bar working back to Android 2.1, as Mr. Weening noted.
It is the same as options menus, using mostly menu resources and Java code.
You are welcome to create a time machine and go back in time to add that code to Android devices dating back to 2009. You might be able to find a lightly-used flux capacitor on eBay, though tracking down a Mr. Fusion unit may be somewhat more troublesome. Or, if you’re in the UK, see if you can find a used TARDIS dealer.
The rest of us, in the meantime, will use the Android Support package in part for its backports of fragments,
GridLayout, etc., so we can use new capabilities that are not native to older devices, while maintaining API fidelity with the native implementations on newer devices.