tags:

views:

76

answers:

1

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...?

+2  A: 

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.

Pontus Gagge
Cool. I'll set my targetSdkVersion equal to the SDK I'm compiling with. And I'll keep minSdk set to 5. As for the compiler warning, I will ignore it. Thanks.
Brad Hein
Just add some testing (preferably automated unit testing) with an older emulator, and you should be fine!
Pontus Gagge