예제 #1
0
 public void CallGmsApiWithResult(string className, string fieldName,
                                  string methodName, AndroidJavaProxy callbackProxy, params object[] args)
 {
     using (AndroidJavaObject pendingResult = CallGmsApi <AndroidJavaObject>(className,
                                                                             fieldName, methodName, args)) {
         pendingResult.Call("setResultCallback", callbackProxy);
     }
 }
예제 #2
0
 public static void AddListener(string setCallBackFunctionName, AndroidJavaProxy callBack)
 {
     if (Application.platform == RuntimePlatform.Android)
     {
         CurrentActivity.Call(setCallBackFunctionName, callBack);
         androidListernerList.Add(callBack);
     }
 }
 public static AndroidJavaObject GetListener(string buildName, AndroidJavaProxy proxy)
 {
     if (buildName == "")
     {
         return(null);
     }
     return(getBuilder(buildName).CallStatic <AndroidJavaObject>(buildName, proxy));
 }
예제 #4
0
 public static void CallOnMainThread(this AndroidJavaProxy proxy, Action action)
 {
     if (!HMSDispatcher.InstanceExists)
     {
         HMSDispatcher.CreateDispatcher();
     }
     HMSDispatcher.InvokeAsync(action);
 }
예제 #5
0
        private static void CallAppState(AndroidJavaObject apiClient, string methodName,
                                         AndroidJavaProxy callbackProxy, params object[] args)
        {
            var pendingResult = AppStateManager.CallStatic <AndroidJavaObject>(
                methodName, PrependApiClient(apiClient, args));

            using (pendingResult) {
                pendingResult.Call("setResultCallback", callbackProxy);
            }
        }
 public void setSensorListener(AndroidJavaProxy callback)
 {
                      #if UNITY_ANDROID
     using (AndroidJavaClass jc = new AndroidJavaClass("com.unity3d.player.UnityPlayer"))
     {
         using (AndroidJavaObject jo = jc.GetStatic <AndroidJavaObject>("currentActivity"))
         {
             jo.Call("setSensorListener", callback);
         }
     }
                     #endif
 }
 public void addListener <T>(string listenerName, AndroidJavaProxy listener)  where T : AndroidJavaProxy
 {
                 #if UNITY_ANDROID && !UNITY_EDITOR
     mAndroidActivity.Call(listenerName, (T)listener);
                 #endif
 }
예제 #8
0
        private static void CallAppState(AndroidJavaObject apiClient, string methodName, AndroidJavaProxy callbackProxy, params object[] args)
        {
            AndroidJavaObject androidJavaObject = (AndroidJavaObject)((AndroidJavaObject)AndroidAppStateClient.AppStateManager).CallStatic <AndroidJavaObject>(methodName, AndroidAppStateClient.PrependApiClient(apiClient, args));

            using (androidJavaObject)
                androidJavaObject.Call("setResultCallback", new object[1]
                {
                    (object)callbackProxy
                });
        }
예제 #9
0
 public static void ObjectAddListener(AndroidJavaObject androidObject, string setCallBackFunctionName, AndroidJavaProxy callBack)
 {
     if (Application.platform == RuntimePlatform.Android)
     {
         if (androidObject != null)
         {
             androidObject.Call(setCallBackFunctionName, callBack);
             androidListernerList.Add(callBack);
         }
     }
 }
예제 #10
0
 private void AddOnFailureListener(AndroidJavaProxy listenerProxy)
 {
     _javaTask.Call <AndroidJavaObject>("addOnFailureListener", listenerProxy).Dispose();
 }
예제 #11
0
 /// <summary>
 /// Registers a listener that will be called when a pack download changes state.
 /// Listeners should be subsequently cleared using <see cref="ClearListeners"/>
 /// </summary>
 /// <param name="listener">
 /// An AndroidJavaProxy representing a java object of class:
 /// com.google.android.play.core.assetpacks.AssetPackStateUpdateListener
 /// </param>
 public void RegisterListener(AndroidJavaProxy listener)
 {
     _javaAssetPackManager.Call("registerListener", listener);
 }
예제 #12
0
 /// <summary>
 /// Wrapper around Play Core Java's unregisterListener() method that removes the specified listener previously
 /// added using <see cref="RegisterListener"/>.
 /// </summary>
 /// <param name="listener">An AndroidJavaProxy representing a java object of class:
 /// com.google.android.play.core.appupdate.InstallStateUpdatedListener
 /// </param>
 public void UnregisterListener(AndroidJavaProxy listener)
 {
     _appUpdateManagerPlayCore.UnregisterListener(listener);
 }
예제 #13
0
 protected void SetOnAndroidStatus(AndroidJavaProxy listener)
 {
     PluginInstance.Call("setOnStatusListener", listener);
 }
예제 #14
0
 protected void SetOnAndroidMessage(AndroidJavaProxy listener)
 {
     PluginInstance.Call("setOnMessageListener", listener);
 }
예제 #15
0
 /// <summary>
 /// Removes the specified listener previously added using <see cref="RegisterListener"/>.
 /// </summary>
 public void UnregisterListener(AndroidJavaProxy listener)
 {
     _javaAppUpdateManager.Call("unregisterListener", listener);
 }
예제 #16
0
 public void CallGmsApiWithResult(string className, string fieldName, string methodName, AndroidJavaProxy callbackProxy, params object[] args)
 {
     using (AndroidJavaObject androidJavaObject = this.CallGmsApi <AndroidJavaObject>(className, fieldName, methodName, args))
     {
         androidJavaObject.Call("setResultCallback", new object[]
         {
             callbackProxy
         });
     }
 }