Android Action compatibility from 2.2 to 4.2

actionbarsherlock, android, android-actionbar

Solution

Unless you are using any API's not available for lower versions, you will not require any additional libraries like ActionBarSherlock.

However, if you are using any specific API's and want to make them backward compatible, for example `Fragments`, `ActionBar`, etc then you can make use of the Support Library which supports a minimum API level of 4.

Quote from the Support Library Page:

Minimum API level supported: 4

The Support Package includes static "support libraries" that you can add to your Android application in order to use APIs that are either not available for older platform versions or that offer "utility" APIs that aren't a part of the framework APIs. The goal is to simplify your development by offering more APIs that you can bundle with your application so you can worry less about platform versions.

ABS is an extension of the Support Library. This is from the ABS page Link: ActionBarSherlock:

The library will automatically use the native action bar when appropriate or will automatically wrap a custom implementation around your layouts. This allows you to easily develop an application with an action bar for every version of Android from 2.x and up.

To summarize, if you are making use of API's not available in older SDK's, then you can use either of the two listed above. If you are not using API's specific to newer SDK's, you will not need ABS or the Support Library.

Problem

I am trying to create an Application on Android and want to target apps all the way down to Android 2.2. I am a bit confused on how to configure the application Min SDK: 2.2 Target SDK: 4.1 Compile SDK against: 4.2 This is the default config i got when i created a new Android Project. Should i still need to use ActionBar Sherlock to support the older versions ?

Original source