5

I want my Xamarin Android app to support API levels 16 and higher. But I am confused by the fact that there are three different version settings in the properties pane of visual studio.

The names of the properties are

Compile using Android version
Minimum Android to target
Target Android version

Minimum I get. It should be 16. But what about the other two?

enter image description here

William Jockusch
  • 26,513
  • 49
  • 182
  • 323

1 Answers1

8

The simple answer

Let all three settings have the same value:

Set Compile using Android version to the version that has all the features you need.

Set Mininum Android to target to Use Compile using SDK version.

Set Target Android version to Use Compile using SDK version.

The less simple answer

If you want to use newer features but still be backwards compatible:

Set Compile using Android version to the version that has all the features you need.

Set Mininum Android to target to the lowest version you want to support.

Set Target Android version to Use Compile using SDK version.

In your code you have to make sure the app works with the minium version as well:

if (Android.OS.Build.VERSION.SdkInt >= Android.OS.BuildVersionCodes.Honeycomb)
{
    // Do modern stuff.
}
else
{
    // Do it the old-fashioned way.
}

Read more details here: http://redth.codes/such-android-api-levels-much-confuse-wow/

Arne Evertsson
  • 19,693
  • 20
  • 69
  • 84