# Is the 3.x version of the Android SDK compatible with a version 2.1 phone?

i am just starting android app development. I was downloading SDK via the Android Manager. I had to select the SDK versions. I have a phone of android 2.1 So i selected only SDK 2.1 and its samples as to download all it takes too much time. If i download the latest SDK 3.X will it be compatible with my mobile?

By default, if you use the 3.x SDK, earlier phone won't be compatible. But if you need special features from a SDK level (for example Open GL ES 2.0 is only available since 2.2), you can force compatibility in your manifest :

<uses-sdk android:minSdkVersion="7" />


You should then detect in your code which version of the OS is used at runtime and change your implementation accordingly :

switch (android.os.Build.VERSION.SDK_INT){
case android.os.Build.VERSION_CODES.ECLAIR :
// do something
break;
case android.os.Build.VERSION_CODES.FROYO:
// do something else
break;
case android.os.Build.VERSION_CODES.HONEYCOMB:
// do something else
break;
}


Finnaly, i'd suggest you take a look at the Target Devices page to choose which version to target (unless again you need a specific feature from the 3.x SDK).