Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is using ActionBarSherlock still necessary?

Up until earlier today, I was under the impression that if I wanted to use ActionBar on devices lower than SDK version 11, I would need to use ABS. But, after looking at some questions on SO here, I came upon this: http://developer.android.com/resources/samples/ActionBarCompat/index.html

This system looks like it provides a fully functioning actionbar system on preHoneycomb devices. Specifically, though I don't see anything in those classes concerning actionbar tabs. Has anyone managed to use this actionbarhelper class with actionbartabs?

Does anyone have any experience using both of these systems? I'm having a heck of a time trying to import my android project to work with ABS, whether it was getting my R file to link, bringing the manifest into the folder, getting the correct package names so my activities would launch, and beyond all that, the highly cluttered src folder. So if it's possible to use this Google-provided code instead, I think it might be desirable - if it is possble to use tabs?

like image 298
Davek804 Avatar asked Mar 31 '12 19:03

Davek804


1 Answers

This system looks like it provides a fully functioning actionbar system on preHoneycomb devices.

ActionBarCompat is not "fully functioning", as compared to the native action bar or ActionBarSherlock.

Has anyone managed to use this actionbarhelper class with actionbartabs?

It does not support tabs.

I'm having a heck of a time trying to import my android project to work with ABS, whether it was getting my R file to link, bringing the manifest into the folder, getting the correct package names so my activities would launch, and beyond all that, the highly cluttered src folder.

Step #1: Download the ABS ZIP file.

Step #2: Import the project (in library/) into Eclipse, marking it to compile with Android 4.0 or higher.

Step #3: Add it as a library project to your existing project.

Step #4: Inherit from SherlockActivity or related classes (e.g., SherlockListActivity), and update other references (e.g., MenuInflater) to Sherlock equivalents as needed.

Step #5: Add Theme.Sherlock to your <application> or <activity> elements.

And that's pretty much it, beyond what you would ordinarily do to use the native action bar.

So if it's possible to use this Google-provided code instead, I think it might be desirable

Code in the "samples" area of the Android Developers site is just that: sample code. The code is unsupported, un-maintained (some don't even work anymore), etc. If you would prefer to use such code over a component that has many more engineers using it, has its own support group, etc., you are welcome to do so.

This is my first application on Android and it's been a beast just getting to the point where I can say I have a fully functioning ViewPager, TabAdapter, system of fragment tabs, and some basic login/register features from an SQL server.

Then perhaps you should start with a simpler app. What you are describing is not what I would recommend somebody start with, unless they are getting specific guidance (e.g., a set of tutorials).

like image 73
CommonsWare Avatar answered Sep 28 '22 11:09

CommonsWare