8

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.

Ruel
  • 15,438
  • 7
  • 38
  • 49

2 Answers2

7

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.

Paresh Mayani
  • 127,700
  • 71
  • 241
  • 295
  • So if I download API 13, I can make it work from Android 1.5 - 3.2? – Ruel Oct 10 '11 at 05:49
  • @Ruel 2nd para on above compatibility article "There is exactly one Android API for each API level, and it’s the same API no matter what kind of device it’s installed on. No parts of the API are optional, and you never have to worry about parts of the API missing on some devices. Every compatible Android device your app will land on will include every class and every API for that API level." – Paresh Mayani Oct 10 '11 at 05:51
  • 6
    That is true, indeed newer APIs include everything from older ones, but while developing, as a beginner, I prefer using the API for the minSdkVersion I need to support, as I find it easier to be warned by Eclipse if I try to use any newer function, unsupported for that version. – Adinia Oct 10 '11 at 06:50
  • @Paresh: The statement *is* a bit confusing actually. It starts with "There is exactly **one** Android API for each API level", and then states that "compatible device will include **every API** for that API level". – vgru Oct 29 '11 at 16:48
3

In short

For 2.1 you have to download API level 7

For 2.2 you have to download API level 8

For 2.3 you have following choices to download API levels

2.3 - 2.3.2 -- API level 9

2.3.3 - 2.3.7 -- API level 10

For seeing API levels and Android OS versions you must see :API Levels

I recommend you to go through Platform Versions atleast once before you start building any android application.

Kartik Domadiya
  • 29,868
  • 19
  • 93
  • 104