public void SetSound([NotNull] string soundFilePath, AudioAttributes audioAttributes)
        {
            if (soundFilePath == null)
            {
                throw new ArgumentNullException("soundFilePath");
            }

            if (ApiCheck)
            {
                return;
            }

            AJO.Call("setSound", AndroidUri.FromFile(soundFilePath),
                     audioAttributes == null ? null : audioAttributes.AJO);
        }
示例#2
0
        /// <summary>
        /// Installs the apk file from SD card. The file MUST exist. Always check if file exists before invoking the method.
        /// </summary>
        /// <param name="apkPathOnDisc">APK path on disc.</param>
        public static void InstallApkFileFromSDCard(string apkPathOnDisc)
        {
            if (AGUtils.IsNotAndroidCheck())
            {
                return;
            }

            try
            {
                var intent = new AndroidIntent(AndroidIntent.ACTION_VIEW);
                intent.SetDataAndType(AndroidUri.FromFile(apkPathOnDisc), "application/vnd.android.package-archive");
                AGUtils.StartActivity(intent.AJO);
            }
            catch
            {
                if (Debug.isDebugBuild)
                {
                    Debug.Log("Could not find apk file:" + apkPathOnDisc);
                }
            }
        }