I want to use an ActionBar for Android 4.0+ (API 14 and above).
Do you recommend still use ActionBarSherlock, the support library or the native library?
What's the difference between ActionBarSherlock and native ActionBar in Android 4.0+?
Thanks
If you're not supporting older devices, there's no reason to use a compatibility surrogate.
I'd go for the native library.
So, not to add extra weight to my app and take advantage of what I already have.
In the other hand, if and external library would offer so many extra features, I could consider it.
Better if it's open source, so that I can cut off all the features I'm not interested in.
Related
I want to implement the android navigation drawer for my app that is supporting jellybean and higher. All tutorials I seen so far use the support version.
I am wondering, are they doing that to support people who want to support old android versions?
If possible I want to use the non-support version. Does anyone know where I can find a good tutorial for that?
Or is using the support version the only way to get it?
http://www.androidhive.info/2013/11/android-sliding-menu-using-navigation-drawer/
Thanks
The docs for the Support Library states:
The Android Support Library package is a set of code libraries that
provide backward-compatible versions of Android framework APIs as well
as features that are only available through the library APIs.
This means that this library contains components, which are not included in the Android SDK. F.e. the ViewPager and related classes like the family of PagerAdapters or even the DrawerLayout.
I understand that for Android below 3.0 i need to use ActionBar from v7 support lib
My question is how v7 ActionBar behaves on phones above Android 3.0. Does is use native ActionBar or v7 ActionBar?
I am asking if v7 ActionBar on phones with Android 3.0 and above will be of less quality
(may be less features) than regular ActionBar
Thanks
If you decide to use ActionBarCompat - all your devices will get action bar from compat library. Of course you can have some really tricky API version checks and choose one over another in runtime, but efforts and code complexity just don't worth it. I wouldn't say it is going to be "less quality" since Google guys are really trying hard to make it look the same. Also Im pretty sure list of interfaces is exactly the same as native implementation.
From another hand, there is obviously a risk to hit some nasty bug which is not present (or already fixed) in native implementation, so it is all up to you to take this risk to the benefit of supporting older platforms.
I'm planning an Android app that should make use of lots of UI features that later SDK versions bring with them incl. ActionBar, ActionBar.Tabs, Swipe navigation and use of Fragments (with replace, add, FragmentTransaction etc). The app should support SDK 8 (2.2) and later.
I'm a 'bit' at a loss here on how to set this up: will I be able to use all these features with the official Android compatibility library? Or will I have to use ActionBarSherlock? Will ABS give me advantages/ be easier to implement compared to the official comp. library?
Can I use the Eclipse/ ADT navigation templates with those two librarys? Can I use them alongside each other or do I have to comit to one of them?
Lot's of questions, I know :)
will I be able to use all these features with the official Android compatibility library?
No.
Or will I have to use ActionBarSherlock?
Yes.
Will ABS give me advantages/ be easier to implement compared to the official comp. library?
It will give you a backwards-compatible action bar. The Android Support Library does not.
Can I use the Eclipse/ ADT navigation templates with those two librarys?
You can do whatever you want. You will need to replace some stuff generated by those templates.
I think using using ActionBarSherlock is the best.
Have a look at this link
Google has a great resource for Android 4.0+ Design Guidelines. But there is still a large percentage of Android users running 2.3.x.
What is the easiest way to use the latest design guidelines while still maintaining backwards compatibility with older OS versions? There are a lot of special menus and navigation tools in the guidelines that are probably Android 4.0+ only. Do they gracefully fall back to basic elements for older versions of the OS? Do you have to create a whole separate view/template for each major Android version?
What is the best approach to adopting the newest guidelines with leaving a large percentage of users out in the cold?
Use ActionBarSherlock and the HoloEverywhere libraries, as well as the Android Support libraries.
There is a support library from google (link) that ports back many of the Android 4 UI Features. You may look at the feature list on their homepage for details.
Furthermore, there is Actionbar Sherlock by Jake Wharton. This a is an extension to the Compatibility Actionbar that offers more features than the original from google. (link)
"Do you have to create a whole separate view/template for each major Android version?"
The answer for this is No, All you need is a single apk for all the Android versions,
But the UI would be changed depending on the OS version and screen size.
Android provides a number of support libraries for doing this.
The latest design guidelines are compatible only for Android 3.X (Honeycomb) and higher.
For the earlier versions, the UI would behave accordingly.
Please go through Android documentation about support libraries, and there you can find some samples too.
But if you want the same look for all the versions of Android, then you have to go for third party libraries like Actionbar Sherlock.
Considering Android Design Guidelines announcement what is the best way to make apps which are compliant with them on Android 2.x phones? E.g. what is the best way to implement the ActionBar pattern?
ActionbarSherlock is a starting point. It includes the compatibility libraries from Google and comes provided as a project rather than JAR offering greater flexibility, should you need to alter anything. Version 4 is on the way which will also include ICS stuff.
As far as I am aware I believe ABS is backward compatible to 1.6, and makes use of the minSdkVersion and targetSdkVersion. It uses an extended version of the holo theme to create a light and dark version that includes the extra ActionBar goodness, which in turn you can extend to style your app.
I recorded a tutorial on YouTube to get people started.
I think it's better to use the compatibilty libraries directly, instead of another library based on those. Additionally, refer to the Google I/O App as stated at the bottom of the first link I gave. You can find the best practices about implementing a UI for several devices with compatibility libraries.
I found ActionBarSherlock to be pretty good. It will emulate ActionBar on older devices and use the native one on modern ones. It's an extension to Android compatibility library - so you will also get fragments and other ICS stuff.