5

Why should we choose using the Sherlock Action Bar in Android rather than the Support Libraries ? Is there a solid reason for using one above the other ?

user1730789
  • 5,157
  • 8
  • 36
  • 57
  • possible duplicate of [How do I use the ActionBar on older versions of Android?](http://stackoverflow.com/questions/10867617/how-do-i-use-the-actionbar-on-older-versions-of-android) – flup Jul 17 '13 at 08:26

3 Answers3

3

Sherlock Action Bar purpose is to add the ActionBar visual concept implementation for API level below 11 (since ActionBar was added in API level 11). Taken from ActionBar javadoc: "A window feature at the top of the activity that may display the activity title, navigation modes, and other interactive items."

Support library (as the name describes) is a jar that provides APIs added in newer versions of Android to older ones. The best example I can think of is the Fragment implementation: Added in API level 11 made it so easy to integrate different parts of UI accross the application. But that was only for API level 11 above. So when the support library was released it provided this feature for API levels below 11.

So these 2 are separate concepts (one is for UI only, while the other is for supporting newer APIs in older Android versions). To add more, Sherlock AB uses support library.

gunar
  • 14,660
  • 7
  • 56
  • 87
  • Any update now that Android support library has ActionBar? http://developer.android.com/reference/android/support/v7/app/ActionBar.html – Jorge Cevallos Jul 29 '13 at 08:18
  • 1
    At the time when the question was asked, support libraries were not supporting action bar. Now, I remember reading somewhere that Jake Wharthorn was going to stop supporting Sherlock once support libraries will have action bars. So it might be that Sherlock will be deprecated soon. However, considering your question the answer stands. – gunar Jul 29 '13 at 09:51
2

If I'm not mistaken, the ActionBar is only available in API 11+ and the support library do not include the an ActionBar Library for API < 11. ActionBarSherlock is a library that let's you support an ActionBar in API 7+.

PS: I believe google is gonna include a ActionBar API in the support library soon. So they said in Google I/O this year.

Update: Google added ActionBar (for API 7+) in the support library.

chr.solr
  • 576
  • 1
  • 7
  • 19
  • 2
    The action bar is now supported in the support library. See my answer below. – StuStirling Aug 01 '13 at 09:57
  • Quite the contrary. "Added ActionBar to allow implementation of the action bar user interface design pattern back to Android 2.1 (API level 7) and higher. Use of this class requires that you implement your activity by extending the new ActionBarActivity class." - http://developer.android.com/tools/support-library/index.html .It's already being supported – Georgi Angelov Aug 10 '13 at 16:33
2

The Support Libraries did not have compatibility for the Action Bar pre Support Library revision 18 and therefore the natural choice was the ActionBarSherlock library.

However as of revision 18 release in July sometime it is now supported, how good it is I am unsure as I have not used it but in future projects I will be leaning towards the Support Library as its supported by Google.

The link to the Support Library revision notes is here.

StuStirling
  • 15,601
  • 23
  • 93
  • 150
  • can you share your experience of using support ActionBar on pre-ICS devices? – mente Aug 08 '13 at 07:48
  • I haven't yet used the support library Action Bar as the projects I work on already implemented Action Bar Sherlock. I will be inclined to use the support library one however – StuStirling Aug 08 '13 at 08:51