public static void setmGetKeyFlage(bool flage) { #if UNITY_EDITOR #else CurrentActivity.Call("setmGetKeyFlage", flage); #endif }
public static string GetAotuPackage() { #if UNITY_ANDROID && !UNITY_EDITOR return(CurrentActivity.Call <string>("GetAotuPackage")); #endif return(""); }
public static void DisConnect() { #if UNITY_EDITOR #else CurrentActivity.Call("sendHandle", 1); #endif }
public static void StopSearch() { #if UNITY_EDITOR #else CurrentActivity.Call("sendHandle", 3); #endif }
public static void AddListener(string setCallBackFunctionName, AndroidJavaProxy callBack) { if (Application.platform == RuntimePlatform.Android) { CurrentActivity.Call(setCallBackFunctionName, callBack); androidListernerList.Add(callBack); } }
public static int GetKeyEvent() { #if UNITY_EDITOR return(-1); #else return(CurrentActivity.Call <int>("GetKeyEvent")); #endif }
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"); }
public static void CurrentActivityFunctionCall(string callName, params object[] args) { if (CurrentActivity != null) { try { CurrentActivity.Call(callName, args); } catch (Exception e) { Debug.LogError(e); } } }
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)); }
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 }
// 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); }
public static void ShutDown() { #if UNITY_ANDROID && !UNITY_EDITOR CurrentActivity.Call("ShutDown"); #endif }
public static void Reboot() { #if UNITY_ANDROID && !UNITY_EDITOR CurrentActivity.Call("Reboot"); #endif }
public static void ResetAotuRun() { #if UNITY_ANDROID && !UNITY_EDITOR CurrentActivity.Call("ResetAotuRun"); #endif }
public static void StartHome() { #if UNITY_ANDROID && !UNITY_EDITOR CurrentActivity.Call("StartHome"); #endif }
private void RunOnUIThread(AndroidJavaRunnable runnable) { CurrentActivity.Call("runOnUiThread", new AndroidJavaRunnable(runnable)); }
public static void ReturnToDefaultHome() { #if UNITY_ANDROID && !UNITY_EDITOR CurrentActivity.Call("ReturnToDefaultHome"); #endif }
public static void RunWelCome() { #if UNITY_ANDROID && !UNITY_EDITOR CurrentActivity.Call("RunWelCome"); #endif }
public static void SetAotuRunApp(string package, string classname) { #if UNITY_ANDROID && !UNITY_EDITOR CurrentActivity.Call("SetAotuRunApp", package, classname); #endif }
public static void CleanCache() { #if UNITY_ANDROID && !UNITY_EDITOR CurrentActivity.Call("CleanCache"); #endif }
public static void StartFileManager() { #if UNITY_ANDROID && !UNITY_EDITOR CurrentActivity.Call("StartFileManager"); #endif }