示例#1
0
        public static void Refresh(string androidSdkPath = null, string androidNdkPath = null, string javaSdkPath = null)
        {
            if (OS.IsWindows)
            {
                sdk = new AndroidSdkWindows();
            }
            else
            {
                sdk = new AndroidSdkUnix();
            }

            try {
                sdk.Initialize(androidSdkPath ?? sdk.PreferedAndroidSdkPath, androidNdkPath ?? sdk.PreferedAndroidNdkPath,
                               javaSdkPath ?? sdk.PreferedJavaSdkPath);
                if (IsInstalled)
                {
                    AndroidLogger.LogInfo(null, "Found Android SDK.");
                }
                else
                {
                    AndroidLogger.LogInfo(null, "Did not find Android SDK");
                }
            } catch (Exception ex) {
                AndroidLogger.LogError("Error finding Android/Java SDKs", ex);
            }
        }
示例#2
0
        public static void Refresh(string androidSdkPath = null, string androidNdkPath = null, string javaSdkPath = null)
        {
            if (OS.IsWindows)
            {
                sdk = new AndroidSdkWindows();
            }
            else
            {
                sdk = new AndroidSdkUnix();
            }

            try {
                sdk.Initialize(androidSdkPath ?? sdk.PreferedAndroidSdkPath, androidNdkPath ?? sdk.PreferedAndroidNdkPath,
                               javaSdkPath ?? sdk.PreferedJavaSdkPath);
                if (IsInstalled)
                {
                    var    levels = GetInstalledPlatformVersions().Select(l => l.ApiLevel.ToString()).ToArray();
                    string levelList;
                    if (levels == null || levels.Length == 0)
                    {
                        levelList = "(none)";
                    }
                    else
                    {
                        levelList = string.Join(", ", levels);
                    }
                    AndroidLogger.LogInfo(null, "Found Android SDK. API levels: {0}", levelList);
                }
                else
                {
                    AndroidLogger.LogInfo(null, "Did not find Android SDK");
                }
            } catch (Exception ex) {
                AndroidLogger.LogError("Error finding Android/Java SDKs", ex);
            }
        }