Which Android API to use?

Ruel picture Ruel · Oct 10, 2011 · Viewed 13k times · Source

I'm planning on developing Android Apps. I downloaded the SDK and AVD manager, and about to download the SDK platforms.

My question is, I want to develop apps for 2.x platform. Do I need to download API 7-10? Which one to target?

Also, if you have tips regarding this, please mention them. Thank you.

Answer

Paresh Mayani picture Paresh Mayani · Oct 10, 2011

It is not necessary to download all the platforms, just download the latest SDK and make your application compatible with other SDK.

For that you just need to define android:minSDKVersion and android:maxSDKVersion, android:targetSDKVersion.

   <uses-sdk android:maxSdkVersion="12"
              android:minSdkVersion="8">
    </uses-sdk>

Here is a detailed article on "Compatibility" in "Best Practices" section at Android Developer site.