Example #1
0
    public static void setmGetKeyFlage(bool flage)
    {
#if UNITY_EDITOR
#else
        CurrentActivity.Call("setmGetKeyFlage", flage);
#endif
    }
Example #2
0
    public static string GetAotuPackage()
    {
#if UNITY_ANDROID && !UNITY_EDITOR
        return(CurrentActivity.Call <string>("GetAotuPackage"));
#endif
        return("");
    }
Example #3
0
    public static void DisConnect()
    {
#if UNITY_EDITOR
#else
        CurrentActivity.Call("sendHandle", 1);
#endif
    }
Example #4
0
    public static void StopSearch()
    {
#if UNITY_EDITOR
#else
        CurrentActivity.Call("sendHandle", 3);
#endif
    }
Example #5
0
 public static void AddListener(string setCallBackFunctionName, AndroidJavaProxy callBack)
 {
     if (Application.platform == RuntimePlatform.Android)
     {
         CurrentActivity.Call(setCallBackFunctionName, callBack);
         androidListernerList.Add(callBack);
     }
 }
Example #6
0
    public static int GetKeyEvent()
    {
#if UNITY_EDITOR
        return(-1);
#else
        return(CurrentActivity.Call <int>("GetKeyEvent"));
#endif
    }
Example #7
0
    static MainCommon()
    {
#if UNITY_ANDROID && !UNITY_EDITOR
        mMainCommon = new AndroidJavaObject("skyworth.com.commonlib.MainCommon");
        CurrentActivity.Call("SetNewIntentInferface", new NewIntentInferface());
#endif
        APPLIST.Add("com.htc.viveport.store");
        APPLIST.Add("com.ssnwt.svrwelcom");
    }
Example #8
0
 public static void CurrentActivityFunctionCall(string callName, params object[] args)
 {
     if (CurrentActivity != null)
     {
         try {
             CurrentActivity.Call(callName, args);
         } catch (Exception e) {
             Debug.LogError(e);
         }
     }
 }
Example #9
0
 public static T CurrentActivityFunctionCall <T>(string callName, params object[] args)
 {
     if (CurrentActivity != null)
     {
         try {
             return(CurrentActivity.Call <T>(callName, args));
         } catch (Exception e) {
             Debug.LogError(e);
         }
     }
     return(default(T));
 }
Example #10
0
        public static string GetDeviceId() // IMEI: International Mobile Equipment Identity
        {
#if UNITY_EDITOR
            return("123456789012345");
#else
            string            KEY = ContextClass.GetStatic <string>("TELEPHONY_SERVICE");
            AndroidJavaObject telephonyService = CurrentActivity.Call <AndroidJavaObject>("getSystemService", KEY);
            try
            {
                return(telephonyService.Call <string>("getDeviceId"));
            }
            catch (Exception e)
            {
                Debug.LogError("GetDeviceId failed! " + e.Message);
                return(GetAndoidId());
            }
#endif
        }
Example #11
0
//		try {
//			InputStream is = assetManager.open("psdk.json");
//			PublishingSDKFileUtils utils = new PublishingSDKFileUtils();
//			configJson = utils.convertStreamToString(is);
//		} catch (IOException e) {
//			Log.e(TAG, "start: failed to get InputStrem for psdk.json (is the file missing from assets?), exception: " + e.getMessage());
//			return null;
//		}
//
        public static string ReadAndroidAssetsFile(string fileRelativePath)
        {
                        #if UNITY_ANDROID && !UNITY_EDITOR
            try {
                using (AndroidJavaObject androidAssetManager = CurrentActivity.Call <AndroidJavaObject>("getAssets")) {
                    if (androidAssetManager != null)
                    {
                        using (AndroidJavaObject androidInputStream = androidAssetManager.Call <AndroidJavaObject>("open", fileRelativePath)) {
                            if (androidInputStream != null)
                            {
                                using (AndroidJavaObject psfu = new AndroidJavaObject("com.tabtale.publishingsdk.core.utils.PublishingSDKFileUtils")) {
                                    return(psfu.Call <string> ("convertStreamToString", androidInputStream));
                                }
                            }
                        }
                    }
                }
            }
            catch (System.Exception e) {
                Debug.LogException(e);
            }
                                #endif
            return(null);
        }
Example #12
0
    public static void ShutDown()
    {
#if UNITY_ANDROID && !UNITY_EDITOR
        CurrentActivity.Call("ShutDown");
#endif
    }
Example #13
0
    public static void Reboot()
    {
#if UNITY_ANDROID && !UNITY_EDITOR
        CurrentActivity.Call("Reboot");
#endif
    }
Example #14
0
    public static void ResetAotuRun()
    {
#if UNITY_ANDROID && !UNITY_EDITOR
        CurrentActivity.Call("ResetAotuRun");
#endif
    }
Example #15
0
    public static void StartHome()
    {
#if UNITY_ANDROID && !UNITY_EDITOR
        CurrentActivity.Call("StartHome");
#endif
    }
Example #16
0
 private void RunOnUIThread(AndroidJavaRunnable runnable)
 {
     CurrentActivity.Call("runOnUiThread", new AndroidJavaRunnable(runnable));
 }
Example #17
0
    public static void ReturnToDefaultHome()
    {
#if UNITY_ANDROID && !UNITY_EDITOR
        CurrentActivity.Call("ReturnToDefaultHome");
#endif
    }
Example #18
0
    public static void RunWelCome()
    {
#if UNITY_ANDROID && !UNITY_EDITOR
        CurrentActivity.Call("RunWelCome");
#endif
    }
Example #19
0
    public static void SetAotuRunApp(string package, string classname)
    {
#if UNITY_ANDROID && !UNITY_EDITOR
        CurrentActivity.Call("SetAotuRunApp", package, classname);
#endif
    }
Example #20
0
    public static void CleanCache()
    {
#if UNITY_ANDROID && !UNITY_EDITOR
        CurrentActivity.Call("CleanCache");
#endif
    }
Example #21
0
    public static void StartFileManager()
    {
#if UNITY_ANDROID && !UNITY_EDITOR
        CurrentActivity.Call("StartFileManager");
#endif
    }