示例#1
0
 public static extern int CallStaticIntMethod(IntPtr cls, IntPtr methodID, jvalue[] args);
示例#2
0
 public static extern double CallStaticDoubleMethod(IntPtr cls, IntPtr methodID, jvalue[] args);
示例#3
0
 public static extern float CallStaticFloatMethod(IntPtr cls, IntPtr methodID, jvalue[] args);
示例#4
0
 public static extern IntPtr NewObject(IntPtr clazz, IntPtr methodID, jvalue[] args);
示例#5
0
 public static extern char CallStaticCharMethod(IntPtr cls, IntPtr methodID, jvalue[] args);
示例#6
0
 public static extern short CallStaticShortMethod(IntPtr cls, IntPtr methodID, jvalue[] args);
示例#7
0
 public static extern void CallStaticVoidMethod(IntPtr cls, IntPtr methodID, jvalue[] args);
示例#8
0
 public static extern int CallIntMethod(IntPtr obj, IntPtr methodID, jvalue[] args);
示例#9
0
 public static extern long CallLongMethod(IntPtr obj, IntPtr methodID, jvalue[] args);
示例#10
0
 public static extern double CallDoubleMethod(IntPtr obj, IntPtr methodID, jvalue[] args);
示例#11
0
 public static extern float CallFloatMethod(IntPtr obj, IntPtr methodID, jvalue[] args);
示例#12
0
 public static extern char CallCharMethod(IntPtr obj, IntPtr methodID, jvalue[] args);
示例#13
0
 public static extern byte CallByteMethod(IntPtr obj, IntPtr methodID, jvalue[] args);
示例#14
0
 public static extern bool CallBooleanMethod(IntPtr obj, IntPtr methodID, jvalue[] args);
示例#15
0
 public static extern long CallStaticLongMethod(IntPtr cls, IntPtr methodID, jvalue[] args);
示例#16
0
 public static extern IntPtr CallObjectMethod(IntPtr obj, IntPtr methodID, jvalue[] args);
示例#17
0
 public static extern IntPtr CallStaticObjectMethod(IntPtr cls, IntPtr methodID, jvalue[] args);
示例#18
0
 public static extern bool CallStaticBooleanMethod(IntPtr cls, IntPtr methodID, jvalue[] args);
示例#19
0
 public static extern string CallStaticStringMethod(IntPtr cls, IntPtr methodID, jvalue[] args);
示例#20
0
 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);
        }
示例#22
0
 public static extern void CallVoidMethod(IntPtr obj, IntPtr methodID, jvalue[] args);