public static extern int CallStaticIntMethod(IntPtr cls, IntPtr methodID, jvalue[] args);
public static extern double CallStaticDoubleMethod(IntPtr cls, IntPtr methodID, jvalue[] args);
public static extern float CallStaticFloatMethod(IntPtr cls, IntPtr methodID, jvalue[] args);
public static extern IntPtr NewObject(IntPtr clazz, IntPtr methodID, jvalue[] args);
public static extern char CallStaticCharMethod(IntPtr cls, IntPtr methodID, jvalue[] args);
public static extern short CallStaticShortMethod(IntPtr cls, IntPtr methodID, jvalue[] args);
public static extern void CallStaticVoidMethod(IntPtr cls, IntPtr methodID, jvalue[] args);
public static extern int CallIntMethod(IntPtr obj, IntPtr methodID, jvalue[] args);
public static extern long CallLongMethod(IntPtr obj, IntPtr methodID, jvalue[] args);
public static extern double CallDoubleMethod(IntPtr obj, IntPtr methodID, jvalue[] args);
public static extern float CallFloatMethod(IntPtr obj, IntPtr methodID, jvalue[] args);
public static extern char CallCharMethod(IntPtr obj, IntPtr methodID, jvalue[] args);
public static extern byte CallByteMethod(IntPtr obj, IntPtr methodID, jvalue[] args);
public static extern bool CallBooleanMethod(IntPtr obj, IntPtr methodID, jvalue[] args);
public static extern long CallStaticLongMethod(IntPtr cls, IntPtr methodID, jvalue[] args);
public static extern IntPtr CallObjectMethod(IntPtr obj, IntPtr methodID, jvalue[] args);
public static extern IntPtr CallStaticObjectMethod(IntPtr cls, IntPtr methodID, jvalue[] args);
public static extern bool CallStaticBooleanMethod(IntPtr cls, IntPtr methodID, jvalue[] args);
public static extern string CallStaticStringMethod(IntPtr cls, IntPtr methodID, jvalue[] args);
public static extern byte CallStaticByteMethod(IntPtr cls, IntPtr methodID, jvalue[] args);
public static jvalue[] CreateJNIArgArray(object[] args) { jvalue[] array = new jvalue[args.GetLength(0)]; int num = 0; for (int i = 0; i < args.Length; i++) { object obj = args[i]; if (obj == null) { array[num].l = IntPtr.Zero; } else { if (obj.GetType().IsPrimitive) { if (obj is int) { array[num].i = (int)obj; } else { if (obj is bool) { array[num].z = (bool)obj; } else { if (obj is byte) { array[num].b = (byte)obj; } else { if (obj is short) { array[num].s = (short)obj; } else { if (obj is long) { array[num].j = (long)obj; } else { if (obj is float) { array[num].f = (float)obj; } else { if (obj is double) { array[num].d = (double)obj; } else { if (obj is char) { array[num].c = (char)obj; } } } } } } } } } else { if (obj is string) { array[num].l = AndroidJNI.NewStringUTF((string)obj); } else { if (obj is AndroidJavaObject) { array[num].l = ((AndroidJavaObject)obj).GetRawObject(); } else { if (obj is Array) { array[num].l = _AndroidJNIHelper.ConvertToJNIArray((Array)obj); } else { // if (obj is AndroidJavaRunnable) // { // array[num].l = AndroidJNIHelper.CreateJavaRunnable((AndroidJavaRunnable)obj); // } // else { Debug.Warning("JNI: Unknown argument type '" + obj.GetType() + "'"); } } } } } } num++; } return(array); }
public static extern void CallVoidMethod(IntPtr obj, IntPtr methodID, jvalue[] args);