MattKnowles
MattKnowles

Reputation: 27

When making a new project, how do I ensure my Android App will run on 3 different versions of Android?

I am building an application in Android and the final application needs to be capable of running on three different AVDs.

What would I set as the minimum and target SDK and what which I compile with?

I am using Eclipse Juno with the Android plugin. JRE7

For example if I wanted 3 AVDs running:

Upvotes: 1

Views: 83

Answers (3)

Joe Malin
Joe Malin

Reputation: 8641

This is tricky. What you would do to test on three AVDs is different from what you would do to support multiple versions.

To handle different AVDs during testing, create the AVDs and then use a run configuration that allows you to choose the "device" at runtime:

  1. From the menu, Run > Run Configurations
  2. Right-click Android Applications, then select New
  3. Click the Target tab, then at the top click Always prompt to pick device

Fill out the rest of the dialog and save your new configuration. Every time you run your app using this configuration name, you'll be prompted to choose an AVD.

To write an app that works on multiple devices, see the Android training class Supporting Different Devices.

If the range of platforms you want to support is in the range 10 through 16, set minSdkVersion=10 and targetSdkVersion=16 in your manifest.

Upvotes: 0

user1762507
user1762507

Reputation: 782

You should set the Minimum SDK as API Level 10 and the target SDK as 16 because that is just saying the device/AVD must be at least API Level 10 so it would work on all three AVD because they are all ≥ API Level 10. Now for the target SDK you should probably set it as the highest SDK you will test it with as "that setting indicates the highest version of Android with which you have tested with your application" For more information go here.

Upvotes: 0

stinepike
stinepike

Reputation: 54702

   <uses-sdk
        android:minSdkVersion="10"
        android:targetSdkVersion="16" />

actually you can set minsdk any value less than 10 (if your api supports) and targetsdk to maximum

Upvotes: 1

Related Questions