Comments required on API Compatibility

PhilipBrown

Active Member
Licensed User
Longtime User
I'd be grateful for any comments on the following part of the forthcoming book on Basic4Android. I'm pretty sure parts of it are wrong. Thank you.

Evolving Environment
One of the main problems about creating Android apps is that the environment is rapidly changing. New versions of the Android API appear on a regular basis, introducing new features, while there are still many devices which have old versions. You must decide whether you want to use the new features or design your app for one of the old versions. Android 2.x is a fairly safe basis on which to start if you want your app to be compatible with a wide range of devices.

Backward Compatible
Note that Android is backward compatible. You can use the latest API and it will still work on devices with an earlier version. But your app will have problems if your users try to use new features not available in the old API.

Play Store Compatibility Check
To ensure compatibility, Play Store checks the version of the user’s device and will not allow downloads of apps built with incompatible APIs.
Note that Play Store uses the “minSDKversion” value in your project’s manifest to determine its SDK version. An example from a manifest showing default values:
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="14"/>
You can change these values using the Manifest Editor.
Click here for a list of API levels.

Discovering the API of the current device
How to cope with this situation? You could use the most up-to-date SDK and then use the Phone library SdkVersion to discover the API level of the user’s device. You could then use features appropriate to that type of device. But be aware of the comment above regarding Play Store’s compatibility check.
Click here for a list of API levels.

Playing Safe
If you want to be safe, you might decide to use an old API. This prevents compilation if you try to add new features. You tell Basic4Android which version of the API you wish to use by specifying it in android.jar entry of the Paths Configuration dialog.
 

thedesolatesoul

Expert
Licensed User
Longtime User
Backward Compatible
Note that Android is backward compatible. You can use the latest API and it will still work on devices with an earlier version. But your app will have problems if your users try to use new features not available in the old API.
I find this part a little confusing. The new APIs are not backward compatible on previous versions of Android. I think what you mean is that the Android SDK platform is backwards compatible?
 
Top