views:

648

answers:

5

I want to release an app on the market. It uses nothing new from the 2.0 release like bluetooth for instance and it works well in every emulator using version 1.6 to 2.1.

My question is upon version of the sdk should I distribute my application to make it compatible with all devices running 1.6, 2.0 or 2.1?

I only have a physical device running 1.6 to test it, but as I say, it uses nothing fancy and works well on emulators using API levels 4, 5, 6 or 7.

Thanks

+2  A: 
Christopher
Please consider the use of android:maxSdkVersion carefully, you probably shouldn't use it. If you're set on it, make sure you've read the warning in the doc: http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#max
James
Really, just don't use it. It was a bad idea. Support for it is being removed, so it will be ignored.
hackbod
Ah, fair enough. Though the docs say "by design, new versions of the platform are fully backward-compatible" -- it's probably worth adding a note about deprecated APIs. For example, after how many releases are deprecated classes removed from the framework? Is there a policy?
Christopher
+1  A: 

I believe that anything written in previous versions of the SDK are fully compatible with the latest version.

I'm sure i read this in the SDK documentation when i was setting up my IDE.

If i'm correct then there is really no need to update your application to make use of the added features, although the option will always be there if you decide to expand upon it.

Jamie Keeling
+3  A: 

I'd test with 1.5 and put android:minSdkVersion="3" Based on this there are still lot's of devices 1.5 http://developer.android.com/resources/dashboard/platform-versions.html

Alex Volovoy
+7  A: 

The answers here are good, but here are some more suggestions:

  • don't set android:maxSdkVersion unless you are absolutely sure you need it.
  • set android:minSdkVersion to 3 so Cupcake devices can run it.
  • set android:targetSdkVersion to 4 to indicate the app has been tested on Donut.

Your app should then work well on all >= Cupcake devices. If you have plans to provide high-density resources for high-density screens (Droid, Nexus One), there's a little more work you have to do. It'd be better to start another thread for this, but long story short, you'd put the high-density resources in a folder called drawable-hdpi-v4.

Be sure to check out the uses-sdk doc.

James
A: 

In my opinion the best practice is to compile with the Android 1.6 sdk and set the minSdkVersion to 3 in the manifest.

I say this based off of the recommendation of Dianne Hackborn (the user named hackbod that commented on the accepted answer) in this thread, she is a Google employee that works on the Android source itself.

Basically there are quite a few Android 1.5 SDK devices out there so compiling with the Android 1.5 SDK would provide support for more devices with the 1.5 SDK, 1.6 SDK, 2.0 SDK, or the 2.1 SDK but there are devices that require the 1.6 SDK such as the HTC Tattoo so compiling you app with the 1.6 sdk but setting the minSdkVersion to 3 allows for the majority of devices to be able to use your app.

If you do as the accepted answer says and compile with the latest 2.1 SDK then you are missing out on a large amount of users. Applications compiled with the 2.1 SDK can only be used by devices that have the 2.1 SDK or higher so basically you are limiting your users to those that own a Google Nexus One at the moment.

snctln
At the time of the question it sounded judicious to set maxSdkVersion but after all the warnings, yeah it seemed better just to use min and target while still compiling on 1.6.
attwad