Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I compile my Android apps against the latest SDK?

Tags:

android

My app requires that devices are running at least Android 2.0 OS. Would it make more sense for me to compile my project with the 2.0 SDK or does it make more sense to always compile my project using the latest SDK, even if it's well beyond 2.0...?

The problem with compiling against 2.1 for example would be that I don't know if an Android 2.0 device would even run an app compiled with 2.1...?

like image 693
Brad Hein Avatar asked Jul 25 '10 16:07

Brad Hein


1 Answers

You can target a later SDK version using android:targetSdkVersion while still permitting your app to be run on earlier versions (since apps are filtered out based on the android:minSdkVersion). If you use API's that aren't supported, your app will force close. So, you'll have to pay attention to the API level annotations in the documentation for all functions, and test your app on an emulator set to use the minimum SDK version.

However, the Android Developer's Blog has some good advice on how to write applications that support earlier SDK versions - at a cost of some added work, of course. Whether it's worth it depends on whom you want to reach, obviously.

like image 151
Pontus Gagge Avatar answered Oct 04 '22 05:10

Pontus Gagge