This class can be used to implement any java interface. Any java vm method invocation matching the interface on the proxy object will automatically be passed to the c# implementation.

Ejemplo n.º 1
0
        public static IntPtr CreateJavaProxy(AndroidJavaProxy proxy)
        {
            IntPtr ptr;

            INTERNAL_CALL_CreateJavaProxy(proxy, out ptr);
            return(ptr);
        }
Ejemplo n.º 2
0
        public static IntPtr CreateJavaProxy(AndroidJavaProxy proxy)
        {
            IntPtr result;

            AndroidJNIHelper.INTERNAL_CALL_CreateJavaProxy(proxy, out result);
            return(result);
        }
        public static IntPtr InvokeJavaProxyMethod(AndroidJavaProxy proxy, IntPtr jmethodName, IntPtr jargs)
        {
            int num = 0;

            if (jargs != IntPtr.Zero)
            {
                num = AndroidJNISafe.GetArrayLength(jargs);
            }
            AndroidJavaObject[] array = new AndroidJavaObject[num];
            for (int i = 0; i < num; i++)
            {
                IntPtr objectArrayElement = AndroidJNISafe.GetObjectArrayElement(jargs, i);
                array[i] = ((!(objectArrayElement != IntPtr.Zero)) ? null : new AndroidJavaObject(objectArrayElement));
            }
            IntPtr result;

            using (AndroidJavaObject androidJavaObject = proxy.Invoke(AndroidJNI.GetStringUTFChars(jmethodName), array))
            {
                if (androidJavaObject == null)
                {
                    result = IntPtr.Zero;
                }
                else
                {
                    result = AndroidJNI.NewLocalRef(androidJavaObject.GetRawObject());
                }
            }
            return(result);
        }
Ejemplo n.º 4
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);
        }
    }
Ejemplo n.º 5
0
        // Creates a UnityJavaProxy object (implements jinterface).
        public static IntPtr CreateJavaProxy(AndroidJavaProxy proxy)
        {
            var handle = GCHandle.Alloc(proxy);

            try
            {
                return(_AndroidJNIHelper.CreateJavaProxy(GCHandle.ToIntPtr(handle), proxy));
            }
            catch
            {
                handle.Free();
                throw;
            }
        }
        public static IntPtr CreateJavaProxy(AndroidJavaProxy proxy)
        {
            GCHandle value = GCHandle.Alloc(proxy);
            IntPtr   result;

            try
            {
                result = _AndroidJNIHelper.CreateJavaProxy(GCHandle.ToIntPtr(value), proxy);
            }
            catch
            {
                value.Free();
                throw;
            }
            return(result);
        }
Ejemplo n.º 7
0
        public static IntPtr InvokeJavaProxyMethod(AndroidJavaProxy proxy, IntPtr jmethodName, IntPtr jargs)
        {
            int arrayLength = 0;

            if (jargs != IntPtr.Zero)
            {
                arrayLength = AndroidJNISafe.GetArrayLength(jargs);
            }
            AndroidJavaObject[] javaArgs = new AndroidJavaObject[arrayLength];
            for (int i = 0; i < arrayLength; i++)
            {
                IntPtr objectArrayElement = AndroidJNISafe.GetObjectArrayElement(jargs, i);
                javaArgs[i] = !(objectArrayElement != IntPtr.Zero) ? null : new AndroidJavaObject(objectArrayElement);
            }
            using (AndroidJavaObject obj2 = proxy.Invoke(AndroidJNI.GetStringUTFChars(jmethodName), javaArgs))
            {
                if (obj2 == null)
                {
                    return(IntPtr.Zero);
                }
                return(AndroidJNI.NewLocalRef(obj2.GetRawObject()));
            }
        }
Ejemplo n.º 8
0
        public static IntPtr InvokeJavaProxyMethod(AndroidJavaProxy proxy, IntPtr jmethodName, IntPtr jargs)
        {
            int length = 0;

            if (jargs != IntPtr.Zero)
            {
                length = AndroidJNISafe.GetArrayLength(jargs);
            }
            AndroidJavaObject[] javaArgs = new AndroidJavaObject[length];
            for (int index = 0; index < length; ++index)
            {
                IntPtr objectArrayElement = AndroidJNISafe.GetObjectArrayElement(jargs, index);
                javaArgs[index] = !(objectArrayElement != IntPtr.Zero) ? (AndroidJavaObject)null : new AndroidJavaObject(objectArrayElement);
            }
            using (AndroidJavaObject androidJavaObject = proxy.Invoke(AndroidJNI.GetStringUTFChars(jmethodName), javaArgs))
            {
                if (androidJavaObject == null)
                {
                    return(IntPtr.Zero);
                }
                return(AndroidJNI.NewLocalRef(androidJavaObject.GetRawObject()));
            }
        }
Ejemplo n.º 9
0
 private static extern void INTERNAL_CALL_CreateJavaProxy(AndroidJavaProxy proxy, out IntPtr value);
Ejemplo n.º 10
0
 public static extern IntPtr CreateJavaProxy(AndroidJavaProxy proxy);
Ejemplo n.º 11
0
 [RequiredByNativeCode]                                                                                           // 0x00000001800D4E50-0x00000001800D4E60
 public static IntPtr InvokeJavaProxyMethod(AndroidJavaProxy proxy, IntPtr jmethodName, IntPtr jargs) => default; // 0x0000000180ABB210-0x0000000180ABB4C0
Ejemplo n.º 12
0
        }                                     // Dummy constructor

        // Methods
        public static IntPtr CreateJavaProxy(IntPtr delegateHandle, AndroidJavaProxy proxy) => default;                  // 0x0000000180AB9C50-0x0000000180AB9DB0
Ejemplo n.º 13
0
 public static IntPtr CreateJavaProxy(int delegateHandle, AndroidJavaProxy proxy)
 {
     return(AndroidReflection.NewProxyInstance(delegateHandle, proxy.javaInterface.GetRawClass()));
 }
Ejemplo n.º 14
0
 public static IntPtr CreateJavaProxy(AndroidJavaProxy proxy)
 {
     return(IntPtr.Zero);
 }
Ejemplo n.º 15
0
 public static IntPtr CreateJavaProxy(AndroidJavaProxy proxy)
 {
     INTERNAL_CALL_CreateJavaProxy(proxy, out IntPtr value);
     return(value);
 }
Ejemplo n.º 16
0
 public static IntPtr CreateJavaRunnable(AndroidJavaRunnable jrunnable) => default;                                                                                                                                                       // 0x0000000180AB04C0-0x0000000180AB05F0
 public static IntPtr CreateJavaProxy(AndroidJavaProxy proxy) => default;                                                                                                                                                                 // 0x0000000180AB02F0-0x0000000180AB04C0