public static int TryOSVersionToApiLevel(string frameworkVersion) { // Use MonoDroidSdk.GetApiLevelForFrameworkVersion because that will translate XA versions >= 5.xx to the correct api level var apiLevelText = MonoDroidSdk.GetApiLevelForFrameworkVersion(frameworkVersion); int apiLevel; int.TryParse(apiLevelText, out apiLevel); return(apiLevel); }
public static string TryApiLevelToOSVersion(int apiLevel) { var osVersion = MonoDroidSdk.GetFrameworkVersionForApiLevel(apiLevel.ToString()); if (!string.IsNullOrEmpty(osVersion)) { return(osVersion.TrimStart('v')); } return(null); }