47

I currently have a application targeted at android 2.3 (api level 10), but went thinking that probably people using android 2.1/2.2 or older won't even be able to see the application in the market.

So I thought that using api level 3 would be the best to use, but I don't know if this will maybe make certain elements in my app work less good, and probably buggier, since it actually uses old android code. Is there a good way to find out which API level I should use, and also, how do I convert my application to that level?

6 Answers 6

44

You can find a breakdown of the different versions of Android in use here. Currently, if you target 2.1 (API 7) you'll only miss out on about 3% of the market. Targeting 2.2 will miss just under 20%, or a fifth of the market.

As for converting your app, you can check what API level things are available for in the Android Reference. You'll note a checkbox and dropdown menu on the top right of the browsing area that allows you to filter by API level - that's one way to help converting. The other is to set the target and minimum SDK versions which will help Eclipse know what to complain about in your code. The easiest way to see if something needs conversion, however, is to emulate and test.

EDIT: The API level dropdown moved from the top right to the top left, over the list of APIs.

1
  • starting November 2, 2020, updates to apps and games on Google Play will be required to target Android 10 (API level 29) or higher. After this date, the Play Console will prevent you from submitting new app bundles and APKs with a targetSdkVersion less than 29. Please note that Wear OS apps are not subject to the API level 29 requirement. This will not impact your existing listing on the Play Store. Oct 7, 2020 at 5:52
15

This graph may help you make up your mind.

2
  • 2
    I would recommend support version 2.1 and above now. (android:minSdkVersion="7")
    – pqn
    Aug 5, 2011 at 18:57
  • Why doesn't this graph show Honeycomb? There is nothing between 2.3.7 and 4.0.3. Jul 21, 2014 at 3:29
8

It is good to look at backward compatibility and in general, you should compile your application against the lowest possible version of the platform that your application can support.

You can determine the lowest possible platform version by compiling the application against successively lower build targets. After you determine the lowest version, you should create an AVD using the corresponding platform version (and API Level) and fully test your application. Make sure to declare a android:minSdkVersion attribute in the application's manifest and set its value to the API Level of the platform version. Good luck!

2

If you have

<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="10"/>

then it will appear right down to 1.6, but make sure you don't use antyhing that they don't have in their API

edit: Don't bother with 3! :)

2

I started out developing for 1.5, but soon realized that only a small percentage of people still run 1.5. I generally develop at the 2.1 level, and leave it at that (unless you need features at a higher level). To change it, open your project properties, and while I don't have my environment open, there is an Android option where you will select what API level you want to target.

0

The Best API Level is contains follows 1) The best API covers 100% market but all are not prefect so our app should be covered at least 90% with all devices .

2)We have to care about backward compatibility issues and our code would adapt itself for upcoming versions.

3) Using the new Android SDK is a requirement to use any of the new APIs added in that level. It should be emphasized ... It is ultimately a business decision on whether supporting an additional 3% of devices is worth the development and testing . 4) check out this link https://developer.android.com/guide/practices/compatibility.html#defined

5) Finally choose the best API you will find best API

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.