Designing For Compatibility
Future-Proofing Your Applications
Although it is impossible to know what changes in upcoming releases of the SDK will break your application, there are ways to reduce this risk by following good coding practices. In this blog posting, Dan Morrill discusses five techniques for avoiding problems in your application as new versions of the Android SDK are released.
Coding for Backward Compatibility
There are two techniques that can be used to ensure your application will run on both older and newer devices. Andy McFadden discusses how using reflection to find a library, and using a wrapper class can solve this problem.
Using the minSdkVersion Attribute
Android 1.5 began checking the "API Level", an identifier allowing the system to correctly determine whether an application is compatible with the system prior to installing the application. Starting with Cupcake, applications must now identify the minimum API level with the <uses-sdk> tag in their manifest files. For more background on this, read the Overview section in the Android 1.5 Version Notes.