Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android : The use of the ActionBarSherlock library

I want to create an application that will target old Android platforms (>= 2.x).

I found the ActionBarSherlock that allows building action bars in an ICS style.

But, when I read its FAQ, I found that I have to compile my project with the API level 14 (4.0 : ICS) and target the API level 11 in my manifest (3.0 : Honeycomb).

So, my question is : how can I target the 2.x versions with ActionBarSherlock?

like image 490
Zakaria Avatar asked Mar 12 '12 10:03

Zakaria


1 Answers

This is a very common question and the answer is relatively simple. Just because you target 4.0 does not mean it will not run on earlier versions. In your manifest you need to add the following:

<uses-sdk
    android:minSdkVersion="7"
    android:targetSdkVersion="14" />

As you can see this effectively says you are targeting API level 14 however the minimum API level supported is 2.1 (update 1).

This is all clearly explained in the documentation on the ABS site. If you wish to know more about the <uses-sdk> tag then visit http://developer.android.com/guide/topics/manifest/uses-sdk-element.html

like image 64
Graham Smith Avatar answered Nov 05 '22 21:11

Graham Smith