Understanding Android API Levels
Overview
ThisguidedescribeshowAndroidusesAPIlevelstomanageappcompatibilityacrossdifferent
versionsofAndroid,anditexplainshowtoconfigureXamarin.Androidprojectsettingstodeploy
theseAPIlevelsinyourapp.Inaddition,thisguideexplainshowtowriteruntimecodethatdeals
withdifferentAPIlevels,anditprovidesatablethatrelatesAPIlevelstoAndroidversion
numbers(suchasAndroid4.1),Androidversionnames(suchasJellyBean),andbuildversion
codes.
Quick Start
Xamarin.AndroidexposesthreeAndroidAPIlevelprojectsettings:
TargetFramework–Specifieswhichframeworktouseinbuildingyourapplication.This
APIlevelisusedatcompiletimebyXamarin.Android.
MinimumAndroidVersion–SpecifiestheoldestAndroidversionthatyouwantyourappto
support.ThisAPIlevelisusedatruntimebyAndroid.
TargetAndroidVersion–SpecifiestheversionofAndroidthatyourappisintendedtorun
on.ThisAPIlevelisusedatruntimebyAndroid.
Beforeyouconfigurethesesettings,besuretoinstallthenecessaryAndroidSDKpackagesthat
youwillneedforyourproject.SeeAndroidSDKPlatformSettingsforinformationaboutusingthe
AndroidSDKManagertoinstallSDKpackages.
Normally,allthreeXamarin.AndroidAPIlevelsaresettothesamevalue.SetCompile using
Android version(thetargetframeworksetting)totheAndroidversionthathasallofthefeatures
youneed,thensettheminimumandtargetAndroidversionstoUse Compile using SDK
version(whichtracksthetargetframeworksetting)asshownhere:
评论0
最新资源