views:

77

answers:

3

I have written an Android application that I am about to release, but I would like to have a 2.1 version with multitouch and a lower API version without. However, if I simply just use the minSDK setting, the 1.6+ version would show up in the market with the 2.1 version on 2.1 phones.

Is there any way to release for a specific range of OS versions?

Thanks.

+1  A: 

You can set both the minimum and the maximum API level in the manifest file with the uses-sdk tag:

<uses-sdk android:minSdkVersion="integer" 
          android:targetSdkVersion="integer"
          android:maxSdkVersion="integer" />
dbyrne
This was what I was looking for, though the other answers are probably what I should do instead.
GuyNoir
+2  A: 

I would suggest having the application test to see if the multitouch API calls are available and use them if they are. If they aren't simply degrade gracefully.

Here is a good Google IO video on this you may not have seen: http://www.youtube.com/watch?v=zNmohaZYvPw

Guzba
+1  A: 

I second Guzba's post. I would highly recommend having one app that uses certain APIs depending on what OS version you have. There's also a good Android blog post about that: http://android-developers.blogspot.com/2009/04/backward-compatibility-for-android.html

You basically check for the existence of certain classes or methods through reflection and use them if available.

EboMike
Good post! Helped a lot!
GuyNoir
Glad to hear it did! My app does that A LOT - it even has two completely separate ways of handling contacts (because that changed entirely with Android 2.0). The only thing to keep in mind is that if you do use API function calls, make sure that they are only done in classes that are only ever referenced if your OS is of that kind.For example:if (someCondition) { EclairExtension.doSomething();}Now as soon as someCondition is true, the class loader will load the entire EclairExtension class, so if there are ANY references to a new API, your app will crash if you're running an old OS.
EboMike