Android - Build application for SDK 5?
I'm trying use an object which wasn't available until SDK level 5. It seems the only options are API 1.6 w开发者_StackOverflowhich uses SDK 4 and the next available option is using 2.1 which uses SDK 7.
If I try setting the target to 1.6 and setting minSdkVersion to 5 it obviously errors.
Is the only way around this to jump straight to 2.1?
Set your targetSdkVersion
to 7 (Android 2.1) and your minSdkVersion
to 4 (Android 1.6).
Remember that using targeting SDK methods on Android devices that has a lower Android version than your target SDK will result in a crash. It's important to remember because you might wanna check which version the user's phone has at runtime and select a different route if the target API isn't supported.
You should probably use SDK 7, as SDK 5 is obsolete.
However, let's say that you were editing the Android Manifest, and needed a tag or attribute only available at a higher SDK, like android:installLocation
. In this case, you would change the Eclipse build settings to the higher number and leave minSdkVersion
the way it is. All phones below the build version number would ignore the tag.
精彩评论