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);
 }
        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);
 }
 protected void SetOnAndroidStatus(AndroidJavaProxy listener)
 {
     PluginInstance.Call("setOnStatusListener", listener);
 }
 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
         });
     }
 }