Question

I have been developing an application to target Android API level 10. When i started my theory was to target a low API so it would be useable on most devices. I feel like this is what most new developers do. As i dive deeper into android i started getting familiar with the compatibility libraries to add features to the application from the higher API levels.

Does anyone have some definitive advice on the best way to develop for all or most devices. I see 2 clear approaches.

I have read this article many times but i noticed that it is from 2010 and in android years that is very outdated.

Is it better to

-Develop against lower API and use Compatibility library to add better compatibility with new devices

Or

-Develop against most recent API and work in compatibility to support older devices?

Lastly i would assume that the availability of testing devices might come into play here. I have both 2.3.4 and 4.0 devices so i am really deciding which device i want to do most of my testing on while developing.

I hope this does not get deleted for being subjective. It is a very important question that plagues many new android developers and one of the reasons why developing Good Professional android application is not a trivial task.

Was it helpful?

Solution

I am going to guess that what you think is called the "Compatibility library" is the Android Support package. That used to be called the Android Compatibility Library, over a year ago.

The Android Support package contains "backports" of capabilities introduced in newer versions of Android. There are other backports as well, such as ActionBarSherlock, which offers a backport of the action bar.

If you elect to use one or more backports, you are coding to the backports APIs. You are not coding to "lower API" or "most recent API", for the services provided by the backports.

My general recommendation to developers using a recent copy of the Android developer tools is to:

  • Set the android:minSdkVersion to the oldest version of Android you are willing to support

  • Set the build target and the android:targetSdkVersion to a relatively recent version of Android, one that contains features that you may wish to conditionally use on newer devices

  • Use the Android Support package, ActionBarSherlock, and other backports for features that they support that you want to use consistently on older and newer devices

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top