Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        public static string TryApiLevelToOSVersion(int apiLevel)
        {
            var osVersion = MonoDroidSdk.GetFrameworkVersionForApiLevel(apiLevel.ToString());

            if (!string.IsNullOrEmpty(osVersion))
            {
                return(osVersion.TrimStart('v'));
            }
            return(null);
        }