Jni數據類型
Java類型 | jni類型 | 描述 |
---|---|---|
boolean | jboolean | C/C++8位整型 |
byte | jbyte | C/C++帶符號的8位整型 |
char | jchar | C/C++無符號的16位整型 |
short | jshort | C/C++帶符號的16位整型 |
int | jint | C/C++帶符號的32位整型 |
long | jlong | C/C++帶符號的64位整型e |
float | jfloat | C/C++32位浮點型 |
double | jdouble | C/C++64位浮點型 |
Object | jobject | 任何Java對象,或者沒有對應java類型的對象 |
Class | jclass | Class對象 |
String | jstring | 字符串對象 |
Object[] | jobjectArray | 任何對象的數組 |
boolean[] | jbooleanArray | 布爾型數組 |
byte[] | jbyteArray | 比特型數組 |
char[] | jcharArray | 字符型數組 |
short[] | jshortArray | 短整型數組 |
int[] | jintArray | 整型數組 |
long[] | jlongArray | 長整型數組 |
float[] | jfloatArray | 浮點型數組 |
double[] | jdoubleArray | 雙浮點型數組 |
Jni方法
來自 http://blog.chinaunix.net/uid-22028680-id-3429721.html
AndroidJNI.AllocObject 分配對象
static function AllocObject (clazz : IntPtr) : IntPtr
Description描述
Allocates a new Java object without invoking any of the constructors for the object.
分配新 Java 對象而不調用該對象的任何構造函數。返回該對象的引用。
clazz 參數務必不要引用數組類。AndroidJNI.AttachCurrentThread 附加當前線程
static function AttachCurrentThread () : int
Description描述
Attaches the current thread to a Java (Dalvik) VM.
附加當前線程到一個Java(Dalvik)虛擬機。
A thread must be attached to the VM before any other JNI calls can be made.
一個線程必須附加到虛擬機,在任何其他JNI可調用之前。
Returns 0 on success; returns a negative number on failure.
成功返回0,失敗返回一個負數。AndroidJNI.CallBooleanMethod 調用布爾方法
static function CallBooleanMethod (obj : IntPtr, methodID : IntPtr, args : jvalue[]) : bool
Description描述
Calls an instance (nonstatic) Java method defined by methodID, optionally passing an array of arguments (args) to the method.
調用一個由methodID定義的實例的Java方法,可選擇傳遞參數(args)的數組到這個方法。AndroidJNI.CallByteMethod 調用字節方法
static function CallByteMethod (obj : IntPtr, methodID : IntPtr, args : jvalue[]) : Byte
Description描述
Calls an instance (nonstatic) Java method defined by methodID, optionally passing an array of arguments (args) to the method.
調用一個由methodID定義的實例的Java方法,可選擇傳遞參數(args)的數組到這個方法。AndroidJNI.CallCharMethod 調用字符方法
static function CallCharMethod (obj : IntPtr, methodID : IntPtr, args : jvalue[]) : Char
Description描述
Calls an instance (nonstatic) Java method defined by methodID, optionally passing an array of arguments (args) to the method.
調用一個由methodID定義的實例的Java方法,可選擇傳遞參數(args)的數組到這個方法。AndroidJNI.CallDoubleMethod 調用雙精度浮點數方法
static function CallDoubleMethod (obj : IntPtr, methodID : IntPtr, args : jvalue[]) : double
Description描述
Calls an instance (nonstatic) Java method defined by methodID, optionally passing an array of arguments (args) to the method.
調用一個由methodID定義的實例的Java方法,可選擇傳遞參數(args)的數組到這個方法。AndroidJNI.CallFloatMethod 調用浮點數方法
static function CallFloatMethod (obj : IntPtr, methodID : IntPtr, args : jvalue[]) : float
Description描述
Calls an instance (nonstatic) Java method defined by methodID, optionally passing an array of arguments (args) to the method.
調用一個由methodID定義的實例的Java方法,可選擇傳遞參數(args)的數組到這個方法。AndroidJNI.CallIntMethod 調用整數方法
static function CallObjectMethod (obj : IntPtr, methodID : IntPtr, args : jvalue[]) : IntPtr
Description描述
Calls an instance (nonstatic) Java method defined by methodID, optionally passing an array of arguments (args) to the method.
調用一個由methodID定義的實例的Java方法,可選擇傳遞參數(args)的數組到這個方法。AndroidJNI.CallLongMethod 調用長整數方法
static function CallLongMethod (obj : IntPtr, methodID : IntPtr, args : jvalue[]) : Int64
Description描述
Calls an instance (nonstatic) Java method defined by methodID, optionally passing an array of arguments (args) to the method.
調用一個由methodID定義的實例的Java方法,可選擇傳遞參數(args)的數組到這個方法。AndroidJNI.CallObjectMethod 調用對象方法
static function CallObjectMethod (obj : IntPtr, methodID : IntPtr, args : jvalue[]) : IntPtr
Description描述
Calls an instance (nonstatic) Java method defined by methodID, optionally passing an array of arguments (args) to the method.
調用一個由methodID定義的實例的Java方法,可選擇傳遞參數(args)的數組到這個方法。
This method returns a reference to a java.lang.Object, or a subclass thereof.
這個方法返回一個引用到java.lang.Object,或者其子類。AndroidJNI.CallShortMethod 調用短整數方法
static function CallShortMethod (obj : IntPtr, methodID : IntPtr, args : jvalue[]) : Int16
Description描述
Calls an instance (nonstatic) Java method defined by methodID, optionally passing an array of arguments (args) to the method.
調用一個由methodID定義的實例的Java方法,可選擇傳遞參數(args)的數組到這個方法。AndroidJNI.CallStaticBooleanMethod 調用靜態布爾方法
static function CallStaticBooleanMethod (clazz : IntPtr, methodID : IntPtr, args : jvalue[]) : bool
Description描述
Invokes a static method on a Java object, according to the specified methodID, optionally passing an array of arguments (args) to the method.
在一個Java對象調用一個靜態方法,根據指定的methodID,可選傳遞參數(args)的數組到該方法。AndroidJNI.CallStaticByteMethod 調用靜態字節方法
static function CallStaticByteMethod (clazz : IntPtr, methodID : IntPtr, args : jvalue[]) : Byte
Description描述
Invokes a static method on a Java object, according to the specified methodID, optionally passing an array of arguments (args) to the method.
在一個Java對象調用一個靜態方法,根據指定的methodID,可選傳遞參數(args)的數組到該方法。AndroidJNI.CallStaticCharMethod 調用靜態字符方法
static function CallStaticCharMethod (clazz : IntPtr, methodID : IntPtr, args : jvalue[]) : Char
Description描述
Invokes a static method on a Java object, according to the specified methodID, optionally passing an array of arguments (args) to the method.
在一個Java對象調用一個靜態方法,根據指定的methodID,可選傳遞參數(args)的數組到該方法。AndroidJNI.CallStaticDoubleMethod 調用靜態雙精度浮點數方法
static function CallStaticDoubleMethod (clazz : IntPtr, methodID : IntPtr, args : jvalue[]) : double
Description描述
Invokes a static method on a Java object, according to the specified methodID, optionally passing an array of arguments (args) to the method.
在一個Java對象調用一個靜態方法,根據指定的methodID,可選傳遞參數(args)的數組到該方法。AndroidJNI.CallStaticFloatMethod 調用靜態浮點數方法
static function CallStaticFloatMethod (clazz : IntPtr, methodID : IntPtr, args : jvalue[]) : float
Description描述
Invokes a static method on a Java object, according to the specified methodID, optionally passing an array of arguments (args) to the method.
在一個Java對象調用一個靜態方法,根據指定的methodID,可選傳遞參數(args)的數組到該方法。AndroidJNI.CallStaticIntMethod 調用靜態整數方法
static function CallStaticIntMethod (clazz : IntPtr, methodID : IntPtr, args : jvalue[]) : Int32
Description描述
Invokes a static method on a Java object, according to the specified methodID, optionally passing an array of arguments (args) to the method.
在一個Java對象調用一個靜態方法,根據指定的methodID,可選傳遞參數(args)的數組到該方法。AndroidJNI.CallStaticLongMethod 調用靜態長整數方法
static function CallStaticLongMethod (clazz : IntPtr, methodID : IntPtr, args : jvalue[]) : Int64
Description描述
Invokes a static method on a Java object, according to the specified methodID, optionally passing an array of arguments (args) to the method.
在一個Java對象調用一個靜態方法,根據指定的methodID,可選傳遞參數(args)的數組到該方法。AndroidJNI.CallStaticObjectMethod 調用靜態對象方法
static function CallStaticObjectMethod (clazz : IntPtr, methodID : IntPtr, args : jvalue[]) : IntPtr
Description描述
Invokes a static method on a Java object, according to the specified methodID, optionally passing an array of arguments (args) to the method.
在一個Java對象調用一個靜態方法,根據指定的methodID,可選傳遞參數(args)的數組到該方法。
This method returns a reference to a java.lang.Object, or a subclass thereof.
這個方法返回一個java.lang.Object的引用,或者其子類。AndroidJNI.CallStaticShortMethod 調用靜態短整數方法
static function CallStaticShortMethod (clazz : IntPtr, methodID : IntPtr, args : jvalue[]) : Int16
Description描述
Invokes a static method on a Java object, according to the specified methodID, optionally passing an array of arguments (args) to the method.
在一個Java對象調用一個靜態方法,根據指定的methodID,可選傳遞參數(args)的數組到該方法。AndroidJNI.CallStaticStringMethod 調用靜態字符串方法
static function CallStaticStringMethod (clazz : IntPtr, methodID : IntPtr, args : jvalue[]) : string
Description描述
Invokes a static method on a Java object, according to the specified methodID, optionally passing an array of arguments (args) to the method.
在一個Java對象調用一個靜態方法,根據指定的methodID,可選傳遞參數(args)的數組到該方法。
This is a convenience function that calls CallStaticObjectMethod() with the same parameters, but creates a managed string from the result.
這是一個方便的函數,調用帶有相同參數的CallStaticObjectMethod(),但從該結果創建一個托管字符串。AndroidJNI.CallStaticVoidMethod 調用靜態無類型方法
static function CallStaticVoidMethod (clazz : IntPtr, methodID : IntPtr, args : jvalue[]) : void
Description描述
Invokes a static method on a Java object, according to the specified methodID, optionally passing an array of arguments (args) to the method.
在一個Java對象調用一個靜態方法,根據指定的methodID,可選傳遞參數(args)的數組到該方法。AndroidJNI.CallStringMethod 調用字符串方法
static function CallStringMethod (obj : IntPtr, methodID : IntPtr, args : jvalue[]) : string
Description描述
Calls an instance (nonstatic) Java method defined by methodID, optionally passing an array of arguments (args) to the method.
調用一個由methodID定義的實例的Java方法,可選擇傳遞參數(args)的數組到這個方法。
This is a convenience function that calls CallObjectMethod() with the same parameters, but creates a managed string from the result.
這是一個方便的函數,調用帶有相同參數的CallObjectMethod(),但從整個結果創建一個托管字符串。AndroidJNI.CallVoidMethod 調用無類型方法
static function CallVoidMethod (obj : IntPtr, methodID : IntPtr, args : jvalue[]) : void
Description描述
Calls an instance (nonstatic) Java method defined by methodID, optionally passing an array of arguments (args) to the method.
調用一個由methodID定義的實例的Java方法,可選擇傳遞參數(args)的數組到這個方法。AndroidJNI.DeleteGlobalRef 刪除全局引用
static function DeleteGlobalRef (obj : IntPtr) : void
Description描述
Deletes the global reference pointed to by obj.
刪除 obj 所指向的全局引用。AndroidJNI.DeleteLocalRef 刪除局部引用
static function DeleteLocalRef (obj : IntPtr) : void
Description描述
Deletes the local reference pointed to by obj.
刪除 obj 所指向的局部引用。AndroidJNI.DetachCurrentThread 分離當前線程
static function DetachCurrentThread () : int
Description描述
Detaches the current thread from a Java (Dalvik) VM.
從一個Java(Dalvik)虛擬機,分類當前線程。
A thread must be detached from the VM before exiting.
從退出虛擬機之前,一個線程必須被分類。AndroidJNI.EnsureLocalCapacity 確保局部性能
static function EnsureLocalCapacity (capacity : int) : int
Description描述
Ensures that at least a given number of local references can be created in the current thread.
在當前線程確保至少一個可以被創建的給定局部引用數。AndroidJNI.ExceptionClear 清除異常
static function ExceptionClear () : void
Description描述
Clears any exception that is currently being thrown.
清除當前拋出的任何異常。如果當前無異常,則此例程不產生任何效果。AndroidJNI.ExceptionDescribe 描述異常
static function ExceptionDescribe () : void
Description描述
Prints an exception and a backtrace of the stack to the logcat
將異常及堆棧的回溯輸出到系統錯誤報告信道。該例程可便利調試操作。AndroidJNI.ExceptionOccurred 發生異常
static function ExceptionOccurred () : IntPtr
Description描述
Determines if an exception is being thrown
確定是否某個異常正被拋出。AndroidJNI.FatalError 致命錯誤
static function FatalError (message : string) : void
Description描述
Raises a fatal error and does not expect the VM to recover. This function does not return.
拋出致命錯誤并且不希望虛擬機進行修復。該函數無返回值。AndroidJNI.FindClass 查找類
static function FindClass (name : string) : IntPtr
Description描述
This function loads a locally-defined class.
這個函數加載一個本地定義的類。AndroidJNI.FromBooleanArray 從布爾數組
static function FromBooleanArray (array : IntPtr) : Boolean[]
Description描述
Convert a Java array of boolean to a managed array of System.Boolean.
轉換一個Java布爾數組到一個托管System.Boolean數組。AndroidJNI.FromByteArray 從字節數組
static function FromByteArray (array : IntPtr) : Byte[]
Description描述
Convert a Java array of byte to a managed array of System.Byte.
轉換一個Java字節數組到一個托管的System.Byte數組。AndroidJNI.FromCharArray 從字符數組
static function FromCharArray (array : IntPtr) : Char[]
Description描述
Convert a Java array of char to a managed array of System.Char.
轉換一個Java字符數組到一個托管的System.Char數組。AndroidJNI.FromDoubleArray 從雙精度浮點數數組
static function FromDoubleArray (array : IntPtr) : double[]
Description描述
Convert a Java array of double to a managed array of System.Double.
轉換一個Java雙精度浮點數數組到一個托管的System.Double數組。AndroidJNI.FromFloatArray 從浮點數數組
static function FromFloatArray (array : IntPtr) : float[]
Description描述
Convert a Java array of float to a managed array of System.Single.
轉換一個Java浮點數數組到一個托管的System.Single數組。AndroidJNI.FromIntArray 從整數數組
static function FromIntArray (array : IntPtr) : Int32[]
Description描述
Convert a Java array of int to a managed array of System.Int32.
轉換一個Java整數數組到一個托管的System.Int32數組。AndroidJNI.FromLongArray 從整長數數組
static function FromLongArray (array : IntPtr) : Int64[]
Description描述
Convert a Java array of long to a managed array of System.Int64.
轉換一個Java長整數數組到一個托管的System.Int64數組。AndroidJNI.FromObjectArray 從對象數組
static function FromObjectArray (array : IntPtr) : IntPtr[]
Description描述
Convert a Java array of java.lang.Object to a managed array of System.IntPtr, representing Java objects
轉換一個Java的java.lang.Object數組到一個托管的System.IntPtr數組,表示Java對象。AndroidJNI.FromReflectedField 來自反射的域
static function FromReflectedField (refField : IntPtr) : IntPtr
Description描述
Converts a java.lang.reflect.Field to a field ID.
轉換一個java.lang.reflect.Field到一個域ID。AndroidJNI.FromReflectedMethod 來自反射的方法
static function FromReflectedMethod (refMethod : IntPtr) : IntPtr
Description描述
Converts a java.lang.reflect.Method or java.lang.reflect.Constructor object to a method ID.
轉換一個java.lang.reflect.Method或java.lang.reflect.Constructor對象到一個方法ID。AndroidJNI.FromShortArray 從短整數數組
static function FromShortArray (array : IntPtr) : Int16[]
Description描述
Convert a Java array of short to a managed array of System.Int16.
轉換一個Java短整數數組到一個托管的System.Int16數組。AndroidJNI.GetArrayLength 獲取數組長度
static function GetArrayLength (array : IntPtr) : int
Description描述
Returns the number of elements in the array.
返回數組的元素數。AndroidJNI.GetBooleanArrayElement 獲取布爾數組元素
static function GetBooleanArrayElement (array : IntPtr, index : int) : bool
Description描述
Returns the value of one element of a primitive array.
返回一個基本數組一個元素的值。
This function is a special case of GetBooleanArrayRegion(), called with region size set to 1.
這個函數是一個特殊情況的GetBooleanArrayRegion(),就是region大小設置為1時。AndroidJNI.GetBooleanField 獲取布爾域
static function GetBooleanField (obj : IntPtr, fieldID : IntPtr) : bool
Description描述
This function returns the value of an instance (nonstatic) field of an object.
這個函數返回一個對象實例(非靜態)域的值。AndroidJNI.GetByteArrayElement 獲取字節數組元素
static function GetByteArrayElement (array : IntPtr, index : int) : Byte
Description描述
Returns the value of one element of a primitive array.
返回一個基本數組一個元素的值。
This function is a special case of GetByteArrayRegion(), called with region size set to 1.
這個函數是一個特殊情況的GetByteArrayRegion(),就是region大小設置為1時。AndroidJNI.GetByteField 獲取字節域
static function GetByteField (obj : IntPtr, fieldID : IntPtr) : Byte
Description描述
This function returns the value of an instance (nonstatic) field of an object.
這個函數返回一個對象實例(非靜態)域的值。AndroidJNI.GetCharArrayElement 獲取字符數組元素
static function GetCharArrayElement (array : IntPtr, index : int) : Char
Description描述
Returns the value of one element of a primitive array.
返回一個基本數組一個元素的值。
This function is a special case of GetCharArrayRegion(), called with region size set to 1.
這個函數是一個特殊情況的GetCharArrayRegion(),就是region大小設置為1時。AndroidJNI.GetCharField 獲取字符域
static function GetCharField (obj : IntPtr, fieldID : IntPtr) : Char
Description描述
This function returns the value of an instance (nonstatic) field of an object.
這個函數返回一個對象實例(非靜態)域的值。AndroidJNI.GetDoubleArrayElement 獲取雙精度浮點數數組元素
static function GetDoubleArrayElement (array : IntPtr, index : int) : double
Description描述
Returns the value of one element of a primitive array.
返回一個基本數組一個元素的值。
This function is a special case of GetDoubleArrayRegion(), called with region size set to 1.
這個函數是一個特殊情況的GetDoubleArrayRegion(),就是region大小設置為1時。AndroidJNI.GetDoubleField 獲取雙精度浮點數域
static function GetDoubleField (obj : IntPtr, fieldID : IntPtr) : double
Description描述
This function returns the value of an instance (nonstatic) field of an object.
這個函數返回一個對象實例(非靜態)域的值。AndroidJNI.GetFieldID 獲取域ID
static function GetFieldID (clazz : IntPtr, name : string, sig : string) : IntPtr
Description描述
Returns the field ID for an instance (nonstatic) field of a class.
返回類的實例(非靜態)域的域 ID。該域由其名稱及簽名指定。
GetFieldID() 將未初始化的類初始化。AndroidJNI.GetFloatArrayElement 獲取浮點數數組元素
static function GetFloatArrayElement (array : IntPtr, index : int) : float
Description描述
Returns the value of one element of a primitive array.
返回一個基本數組一個元素的值。
This function is a special case of GetFloatArrayRegion(), called with region size set to 1.
這個函數是一個特殊情況的GetFloatArrayRegion(),就是region大小設置為1時。AndroidJNI.GetFloatField 獲取浮點數域
static function GetFloatField (obj : IntPtr, fieldID : IntPtr) : float
Description描述
This function returns the value of an instance (nonstatic) field of an object.
這個函數返回一個對象實例(非靜態)域的值。AndroidJNI.GetIntArrayElement 獲取整數數組元素
static function GetIntArrayElement (array : IntPtr, index : int) : Int32
Description描述
Returns the value of one element of a primitive array.
返回一個基本數組一個元素的值。
This function is a special case of GetIntArrayRegion(), called with region size set to 1.
這個函數是一個特殊情況的GetIntArrayRegion(),就是region大小設置為1時。AndroidJNI.GetIntField 獲取整數域
static function GetIntField (obj : IntPtr, fieldID : IntPtr) : Int32
Description描述
This function returns the value of an instance (nonstatic) field of an object.
這個函數返回一個對象實例(非靜態)域的值。AndroidJNI.GetLongArrayElement 獲取長整數數組元素
static function GetLongArrayElement (array : IntPtr, index : int) : Int64
Description描述
Returns the value of one element of a primitive array.
返回一個基本數組一個元素的值。
This function is a special case of GetLongArrayRegion(), called with region size set to 1.
這個函數是一個特殊情況的GetLongArrayRegion(),就是region大小設置為1時。AndroidJNI.GetLongField 獲取長整數域
static function GetLongField (obj : IntPtr, fieldID : IntPtr) : Int64
Description描述
This function returns the value of an instance (nonstatic) field of an object.
這個函數返回一個對象實例(非靜態)域的值。AndroidJNI.GetMethodID 獲取方法ID
static function GetMethodID (clazz : IntPtr, name : string, sig : string) : IntPtr
Description描述
Returns the method ID for an instance (nonstatic) method of a class or interface.
返回類或接口實例(非靜態)方法的方法 ID。方法可在某個 clazz 的超類中定義,也可從 clazz 繼承。該方法由其名稱和簽名決定。
GetMethodID() 可使未初始化的類初始化。AndroidJNI.GetObjectArrayElement 獲取對象數組元素
static function GetObjectArrayElement (array : IntPtr, index : int) : IntPtr
Description描述
Returns an element of an Object array.
返回一個對象數組的一個元素。AndroidJNI.GetObjectClass 獲取對象類
static function GetObjectClass (obj : IntPtr) : IntPtr
Description描述
Returns the class of an object.
返回一個對象的類。AndroidJNI.GetObjectField 獲取對象域
static function GetObjectField (obj : IntPtr, fieldID : IntPtr) : IntPtr
Description描述
This function returns the value of an instance (nonstatic) field of an object.
這個函數返回一個對象實例(非靜態)域的值。
The result is a reference to a java.lang.Object, or a subclass thereof.
其結果是對一個java.lang.Object的引用,或者其子類。AndroidJNI.GetShortArrayElement 獲取短整數數組元素
static function GetShortArrayElement (array : IntPtr, index : int) : Int16
Description描述
Returns the value of one element of a primitive array.
返回一個基本數組一個元素的值。
This function is a special case of GetShortArrayRegion(), called with region size set to 1.
這個函數是一個特殊情況的GetShortArrayRegion(),就是region大小設置為1時。AndroidJNI.GetShortField 獲取短整數域
static function GetShortField (obj : IntPtr, fieldID : IntPtr) : Int16
Description描述
This function returns the value of an instance (nonstatic) field of an object.
這個函數返回一個對象實例(非靜態)域的值。AndroidJNI.GetStaticBooleanField 獲取靜態布爾域
static function GetStaticBooleanField (clazz : IntPtr, fieldID : IntPtr) : bool
Description描述
This function returns the value of a static field of an object.
這個函數返回一個對象靜態域的值。AndroidJNI.GetStaticByteField 獲取靜態字節域
static function GetStaticByteField (clazz : IntPtr, fieldID : IntPtr) : Byte
Description描述
This function returns the value of a static field of an object.
這個函數返回一個對象靜態域的值。AndroidJNI.GetStaticCharField 獲取靜態字符域
static function GetStaticCharField (clazz : IntPtr, fieldID : IntPtr) : Char
Description描述
This function returns the value of a static field of an object.
這個函數返回一個對象靜態域的值。AndroidJNI.GetStaticDoubleField 獲取靜態雙精度浮點數域
static function GetStaticDoubleField (clazz : IntPtr, fieldID : IntPtr) : double
Description描述
This function returns the value of a static field of an object.
這個函數返回一個對象靜態域的值。AndroidJNI.GetStaticFieldID 獲取靜態域ID
static function GetStaticFieldID (clazz : IntPtr, name : string, sig : string) : IntPtr
Description描述
Returns the field ID for a static field of a class.
返回類的靜態域的域 ID。域由其名稱和簽名指定。
GetStaticFieldID() 將未初始化的類初始化。AndroidJNI.GetStaticFloatField 獲取靜態浮點數域
static function GetStaticFloatField (clazz : IntPtr, fieldID : IntPtr) : float
Description描述
This function returns the value of a static field of an object.
這個函數返回一個對象靜態域的值。AndroidJNI.GetStaticIntField 獲取靜態整數域
static function GetStaticIntField (clazz : IntPtr, fieldID : IntPtr) : Int64
Description描述
This function returns the value of a static field of an object.
這個函數返回一個對象靜態域的值。AndroidJNI.GetStaticLongField 獲取靜態長整數域
static function GetStaticLongField (clazz : IntPtr, fieldID : IntPtr) : Int64
Description描述
This function returns the value of a static field of an object.
這個函數返回一個對象靜態域的值。AndroidJNI.GetStaticMethodID 獲取靜態方法ID
static function GetStaticMethodID (clazz : IntPtr, name : string, sig : string) : IntPtr
Description描述
Returns the method ID for a static method of a class.
返回類的靜態方法的方法 ID。方法由其名稱和簽名指定。
GetStaticMethodID() 將未初始化的類初始化。AndroidJNI.GetStaticObjectField 獲取靜態對象域
static function GetStaticObjectField (clazz : IntPtr, fieldID : IntPtr) : IntPtr
Description描述
This function returns the value of a static field of an object.
這個函數返回一個對象靜態域的值。
The result is a reference to a java.lang.Object, or a subclass thereof.
該結果是一個java.lang.Object的引用,或者其子類。AndroidJNI.GetStaticShortField 獲取靜態短整數域
static function GetStaticShortField (clazz : IntPtr, fieldID : IntPtr) : Int16
Description描述
This function returns the value of a static field of an object.
這個函數返回一個對象靜態域的值。AndroidJNI.GetStaticStringField 獲取靜態字符串域
static function GetStaticStringField (clazz : IntPtr, fieldID : IntPtr) : string
Description描述
This function returns the value of a static field of an object.
這個函數返回一個對象靜態域的值。
This is a convenience function that calls GetStaticObjectField() with the same parameters, but creates a managed string from the result.
這是一個方便的函數,調用帶有相同參數的GetStaticObjectField(),但從該結果創建一個托管字符串。AndroidJNI.GetStringField 獲取字符串域
static function GetStringField (obj : IntPtr, fieldID : IntPtr) : string
Description描述
This function returns the value of an instance (nonstatic) field of an object.
這個函數返回一個對象實例(非靜態)域的值。
This is a convenience function that calls GetObjectField() with the same parameters, but creates a managed string from the result.
這是一個方便的函數,調用帶有相同參數的GetObjectField(),但從結果創建一個托管字符串。AndroidJNI.GetStringUTFChars 獲取字符串UTF的字符
static function GetStringUTFChars (str : IntPtr) : string
Description描述
Returns a managed string object representing the string in modified UTF-8 encoding.
返回由UTF-8修改的托管的字符串對象。
另解,返回指向字符串的 UTF-8 字符數組的指針。
This method is a modification of the original GetStringUTFChars, which returns a pointer to an array of bytes.
這個方法是原始GetStringUTFChars的修改,返回指向字節的數組。AndroidJNI.GetStringUTFLength 獲取字符串UTF的長度
static function GetStringUTFLength (str : IntPtr) : int
Description描述
Returns the length in bytes of the modified UTF-8 representation of a string.
以字節為單位返回字符串的 UTF-8 長度。AndroidJNI.GetSuperclass 獲取超類
static function GetSuperclass (clazz : IntPtr) : IntPtr
Description描述
If clazz represents any class other than the class Object, then this function returns the object that represents the superclass of the class specified by clazz.
如果 clazz 代表類而非類 object,則該函數返回由 clazz 所指定的類的超類。
If clazz specifies the class Object, or clazz represents an interface, this function returns NULL.
如果 clazz 指定類 Object,或代表某個接口,則該函數返回 NULL。AndroidJNI.GetVersion 獲取版本
static function GetVersion () : int
Description描述
Returns the version of the native method interface.
返回本地方法接口的版本。AndroidJNI.IsAssignableFrom 是否可賦值
static function IsAssignableFrom (clazz1 : IntPtr, clazz2 : IntPtr) : bool
Description描述
Determines whether an object of clazz1 can be safely cast to clazz2.
確定 clazz1 的對象是否可安全地強制轉換為 clazz2。AndroidJNI.IsInstanceOf 是否某類的實例
static function IsInstanceOf (obj : IntPtr, clazz : IntPtr) : bool
Description描述
Tests whether an object is an instance of a class.
測試對象是否為某個類的實例。AndroidJNI.IsSameObject 是否同一對象
static function IsSameObject (obj1 : IntPtr, obj2 : IntPtr) : bool
Description描述
Tests whether two references refer to the same Java object.
測試兩個引用是否引用同一 Java 對象。AndroidJNI.NewBooleanArray 新建布爾數組
static function NewBooleanArray (size : int) : IntPtr
Description描述
Construct a new primitive array object.
構造一個新的基本數組對象。AndroidJNI.NewByteArray 新建字節數組
static function NewByteArray (size : int) : IntPtr
Description描述
Construct a new primitive array object.
構造一個新的基本數組對象。AndroidJNI.NewCharArray 新建字符數組
static function NewCharArray (size : int) : IntPtr
Description描述
Construct a new primitive array object.
構造一個新的基本數組對象。AndroidJNI.NewDoubleArray 新建雙精度浮點數數組
static function NewDoubleArray (size : int) : IntPtr
Description描述
Construct a new primitive array object.
構造一個新的基本數組對象。AndroidJNI.NewFloatArray 新建浮點數數組
static function NewFloatArray (size : int) : IntPtr
Description描述
Construct a new primitive array object.
構造一個新的基本數組對象。AndroidJNI.NewGlobalRef 新建全局引用
static function NewGlobalRef (obj : IntPtr) : IntPtr
Description描述
Creates a new global reference to the object referred to by the obj argument.
創建 obj 參數所引用對象的新全局引用。全局引用通過調用 DeleteGlobalRef() 來顯式撤消。
返回全局引用。如果系統內存不足則返回 NULL。AndroidJNI.NewIntArray 新建整數數組
static function NewIntArray (size : int) : IntPtr
Description描述
Construct a new primitive array object.
構造一個新的基本數組對象。AndroidJNI.NewLocalRef 新建局部引用
static function NewLocalRef (obj : IntPtr) : IntPtr
Description描述
Creates a new local reference that refers to the same object as obj.
創建 obj 參數對象的新局部引用。AndroidJNI.NewLongArray 新建長整數數組
static function NewLongArray (size : int) : IntPtr
Description描述
Construct a new primitive array object.
構造一個新的基本數組對象。AndroidJNI.NewObjectArray 新建對象數組
static function NewObjectArray (size : int, clazz : IntPtr, obj : IntPtr) : IntPtr
Description描述
Constructs a new array holding objects in class clazz. All elements are initially set to obj.
構造新的數組,它將保存在類 clazz 中的對象。所有元素初始值均設為 obj。AndroidJNI.NewObject 新建對象
static function NewObject (clazz : IntPtr, methodID : IntPtr, args : jvalue[]) : IntPtr
Description描述
Constructs a new Java object. The method ID indicates which constructor method to invoke. This ID must be obtained by calling GetMethodID() with as the method name and void (V) as the return type.
構造新的 Java 對象。方法 ID指示應調用的構造函數方法。該 ID 必須通過調用 GetMethodID() 獲得,且調用時的方法名必須為 <init>,而返回類型必須為 void (V)。
clazz 參數務必不要引用數組類。AndroidJNI.NewShortArray 新建短整數數組
static function NewShortArray (size : int) : IntPtr
Description描述
Construct a new primitive array object.
構造一個新的基本數組對象。AndroidJNI.NewStringUTF 新建UTF字符串
static function NewStringUTF (bytes : string) : IntPtr
Description描述
Constructs a new java.lang.String object from an array of characters in modified UTF-8 encoding.
利用 UTF-8 字符數組構造新的 java.lang.String 對象。AndroidJNI.PopLocalFrame 彈出局部幀
static function PopLocalFrame (result : IntPtr) : IntPtr
Description描述
Pops off the current local reference frame, frees all the local references, and returns a local reference in the previous local reference frame for the given result object.
彈出關閉當前局部引用幀,釋放所有的本地引用,并返回一個局部引用,在前一個局部引用幀,用于給定的結果對象。
PushLocalFrame為一定數量的局部引用創建了一個使用堆棧,而PopLocalFrame負責銷毀堆棧頂端的引用。
Push/PopLocalFrame函數對提供了對局部引用的生命周期更方便的管理。
在管理局部引用的生命周期中,Push/PopLocalFrame是非常方便的。你可以在本地函數的入口處調用PushLocalFrame,然后在出 口處調用PopLocalFrame,這樣的話,在函數對中間任何位置創建的局部引用都會被釋放。而且,這兩個函數是非常高效的。
如果你在函數的入口處調用了PushLocalFrame,記住在所有的出口(有return出現的地方)調用PopLocalFrame。
大量的局部引用創建會浪費不必要的內存。一個局部引用會導致它本身和它所指向的對象都得不到回收。尤其要注意那些長時間運行的方法. 創建局部引用的循環和工具函數,充分得利用Pus/PopLocalFrame來高效地管理局部引用。AndroidJNI.PushLocalFrame 壓入局部幀
static function PushLocalFrame (capacity : int) : int
Description描述
Creates a new local reference frame, in which at least a given number of local references can be created.
創建一個新的局部引入幀,至少一個給定的局部引用可以被創建的數。
PushLocalFrame為一定數量的局部引用創建了一個使用堆棧,而PopLocalFrame負責銷毀堆棧頂端的引用。
Push/PopLocalFrame函數對提供了對局部引用的生命周期更方便的管理。
在管理局部引用的生命周期中,Push/PopLocalFrame是非常方便的。你可以在本地函數的入口處調用PushLocalFrame,然后在出 口處調用PopLocalFrame,這樣的話,在函數對中間任何位置創建的局部引用都會被釋放。而且,這兩個函數是非常高效的。
如果你在函數的入口處調用了PushLocalFrame,記住在所有的出口(有return出現的地方)調用PopLocalFrame。
大量的局部引用創建會浪費不必要的內存。一個局部引用會導致它本身和它所指向的對象都得不到回收。尤其要注意那些長時間運行的方法. 創建局部引用的循環和工具函數,充分得利用Pus/PopLocalFrame來高效地管理局部引用。AndroidJNI.SetBooleanArrayElement 設置布爾數組數組元素
static function SetBooleanArrayElement (array : IntPtr, index : int, val : byte) : void
Description描述
Sets the value of one element in a primitive array.
設置一個基本數組一個元素的值。
This function is a special case of SetBooleanArrayRegion(), called with region size set to 1.
這個函數是一個特殊情況的SetBooleanArrayRegion(),就是region大小設置為1時。AndroidJNI.SetBooleanField 設置布爾域
static function SetBooleanField (obj : IntPtr, fieldID : IntPtr, val : bool) : void
Description描述
This function sets the value of an instance (nonstatic) field of an object.
這個函數設置一個對象實例(非靜態)域的值。AndroidJNI.SetByteArrayElement 設置字節數組元素
static function SetByteArrayElement (array : IntPtr, index : int, val : sbyte) : void
Description描述
Sets the value of one element in a primitive array.
設置一個基本數組一個元素的值。
This function is a special case of SetByteArrayRegion(), called with region size set to 1.
這個函數是一個特殊情況的SetByteArrayRegion(),就是region大小設置為1時。AndroidJNI.SetByteField 設置字節域
static function SetByteField (obj : IntPtr, fieldID : IntPtr, val : Byte) : void
Description描述
This function sets the value of an instance (nonstatic) field of an object.
這個函數設置一個對象實例(非靜態)域的值。AndroidJNI.SetCharArrayElement 設置字符數組元素
static function SetCharArrayElement (array : IntPtr, index : int, val : Char) : void
Description描述
Sets the value of one element in a primitive array.
設置一個基本數組一個元素的值。
This function is a special case of SetCharArrayRegion(), called with region size set to 1.
這個函數是一個特殊情況的SetCharArrayRegion(),就是region大小設置為1時。AndroidJNI.SetCharField 設置字符域
static function SetCharField (obj : IntPtr, fieldID : IntPtr, val : Char) : void
Description描述
This function sets the value of an instance (nonstatic) field of an object.
這個函數設置一個對象實例(非靜態)域的值。AndroidJNI.SetDoubleArrayElement 設置雙精度浮點數數組元素
static function SetDoubleArrayElement (array : IntPtr, index : int, val : double) : void
Description描述
Sets the value of one element in a primitive array.
設置一個基本數組一個元素的值。
This function is a special case of SetDoubleArrayRegion(), called with region size set to 1.
這個函數是一個特殊情況的SetDoubleArrayRegion(),就是region大小設置為1時。AndroidJNI.SetDoubleField 設置雙精度浮點數域
static function SetDoubleField (obj : IntPtr, fieldID : IntPtr, val : double) : void
Description描述
This function sets the value of an instance (nonstatic) field of an object.
這個函數設置一個對象實例(非靜態)域的值。AndroidJNI.SetFloatArrayElement 設置浮點數數組元素
static function SetFloatArrayElement (array : IntPtr, index : int, val : float) : void
Description描述
Sets the value of one element in a primitive array.
設置一個基本數組一個元素的值。
This function is a special case of SetFloatArrayRegion(), called with region size set to 1.
這個函數是一個特殊情況的SetFloatArrayRegion(),就是region大小設置為1時。AndroidJNI.SetFloatField 設置浮點數域
static function SetFloatField (obj : IntPtr, fieldID : IntPtr, val : float) : void
Description描述
This function sets the value of an instance (nonstatic) field of an object.
這個函數設置一個對象實例(非靜態)域的值。AndroidJNI.SetIntArrayElement 設置整數數組元素
static function SetIntArrayElement (array : IntPtr, index : int, val : Int32) : void
Description描述
Sets the value of one element in a primitive array.
設置一個基本數組一個元素的值。
This function is a special case of SetIntArrayRegion(), called with region size set to 1.
這個函數是一個特殊情況的SetIntArrayRegion(),就是region大小設置為1時。AndroidJNI.SetIntField 設置整數域
static function SetIntField (obj : IntPtr, fieldID : IntPtr, val : Int32) : void
Description描述
This function sets the value of an instance (nonstatic) field of an object.
這個函數設置一個對象實例(非靜態)域的值。AndroidJNI.SetLongArrayElement 設置長整數數組元素
static function SetLongArrayElement (array : IntPtr, index : int, val : Int64) : void
Description描述
Sets the value of one element in a primitive array.
設置一個基本數組一個元素的值。
This function is a special case of SetLongArrayRegion(), called with region size set to 1.
這個函數是一個特殊情況的SetLongArrayRegion(),就是region大小設置為1時。AndroidJNI.SetLongField 設置長整數域
static function SetLongField (obj : IntPtr, fieldID : IntPtr, val : Int64) : void
Description描述
This function sets the value of an instance (nonstatic) field of an object.
這個函數設置一個對象實例(非靜態)域的值。AndroidJNI.SetObjectArrayElement 設置對象數組元素
static function SetObjectArrayElement (array : IntPtr, index : int, obj : IntPtr) : void
Description描述
Sets an element of an Object array.
設置一個對象數組的一個元素。AndroidJNI.SetObjectField 設置對象域
static function SetObjectField (obj : IntPtr, fieldID : IntPtr, val : IntPtr) : void
Description描述
This function sets the value of an instance (nonstatic) field of an object.
這個函數設置一個對象實例(非靜態)域的值。
The value to set is a reference to either a java.lang.Object, or a subclass thereof.
要設置的值無論是一個java.lang.Object的引用,或者其子類。AndroidJNI.SetShortArrayElement 設置短整數數組元素
static function SetShortArrayElement (array : IntPtr, index : int, val : Int16) : void
Description描述
Sets the value of one element in a primitive array.
設置一個基本數組一個元素的值。
This function is a special case of SetShortArrayRegion(), called with region size set to 1.
這個函數是一個特殊情況的SetShortArrayRegion(),就是region大小設置為1時。AndroidJNI.SetShortField 設置短整數域
static function SetShortField (obj : IntPtr, fieldID : IntPtr, val : Int16) : void
Description描述
This function sets the value of an instance (nonstatic) field of an object.
這個函數設置一個對象實例(非靜態)域的值。AndroidJNI.SetStaticBooleanField 設置靜態布爾域
static function SetStaticBooleanField (clazz : IntPtr, fieldID : IntPtr, val : bool) : void
Description描述
This function ets the value of a static field of an object.
這個函數設置一個對象的靜態域的值。AndroidJNI.SetStaticByteField 設置靜態字節域
static function SetStaticByteField (clazz : IntPtr, fieldID : IntPtr, val : Byte) : void
Description描述
This function ets the value of a static field of an object.
這個函數設置一個對象的靜態域的值。AndroidJNI.SetStaticCharField 設置靜態字符域
static function SetStaticCharField (clazz : IntPtr, fieldID : IntPtr, val : Char) : void
Description描述
This function ets the value of a static field of an object.
這個函數設置一個對象的靜態域的值。AndroidJNI.SetStaticDoubleField 設置靜態雙精度浮點數域
static function SetStaticDoubleField (clazz : IntPtr, fieldID : IntPtr, val : double) : void
Description描述
This function ets the value of a static field of an object.
這個函數設置一個對象的靜態域的值。AndroidJNI.SetStaticFloatField 設置靜態浮點數域
static function SetStaticFloatField (clazz : IntPtr, fieldID : IntPtr, val : float) : void
Description描述
This function ets the value of a static field of an object.
這個函數設置一個對象的靜態域的值。AndroidJNI.SetStaticIntField 設置靜態整數域
static function SetStaticIntField (clazz : IntPtr, fieldID : IntPtr, val : Int32) : void
Description描述
This function ets the value of a static field of an object.
這個函數設置一個對象的靜態域的值。AndroidJNI.SetStaticLongField 設置靜態長整數域
static function SetStaticLongField (clazz : IntPtr, fieldID : IntPtr, val : Int64) : void
Description描述
This function ets the value of a static field of an object.
這個函數設置一個對象的靜態域的值。AndroidJNI.SetStaticObjectField 設置靜態對象域
static function SetStaticObjectField (clazz : IntPtr, fieldID : IntPtr, val : IntPtr) : void
Description描述
This function ets the value of a static field of an object.
這個函數設置一個對象的靜態域的值。
The value to set is a reference to either a java.lang.Object, or a subclass thereof.
設置該值不管是一個java.lang.Object的引用,或是其子類。AndroidJNI.SetStaticShortField 設置靜態短整數域
static function SetStaticShortField (clazz : IntPtr, fieldID : IntPtr, val : Int16) : void
Description描述
This function ets the value of a static field of an object.
這個函數設置一個對象的靜態域的值。AndroidJNI.SetStaticStringField 設置靜態字符串域
static function SetStaticStringField (clazz : IntPtr, fieldID : IntPtr, val : string) : void
Description描述
This function ets the value of a static field of an object.
這個函數設置一個對象的靜態域的值。
This is a convenience function that calls SetStaticObjectField() with the same parameters, but performs the necessary marshalling of the string value.
這是一個方便的函數,調用帶有相同參數的SetStaticObjectField(),但執行需要字符串的值編組。AndroidJNI.SetStringField 設置字符串域
static function SetStringField (obj : IntPtr, fieldID : IntPtr, val : string) : void
Description描述
This function sets the value of an instance (nonstatic) field of an object.
這個函數設置一個對象實例(非靜態)域的值。
This is a convenience function that calls SetObjectField() with the same parameters, but performs the necessary marshalling of the string value.
這是一個方便的函數,調用帶有相同參數的SetObjectField(),但執行字符串的值需要編組。AndroidJNI.ThrowNew 新的拋出
static function ThrowNew (clazz : IntPtr, message : string) : int
Description描述
Constructs an exception object from the specified class with the message specified by message and causes that exception to be thrown.
利用指定類的消息(由 message 指定)構造異常對象并拋出該異常。AndroidJNI.Throw 拋出
static function Throw (obj : IntPtr) : int
Description描述
Causes a java.lang.Throwable object to be thrown.
導致一個java.lang.Throwable的對象被拋出。AndroidJNI.ToBooleanArray 到布爾數組
static function ToBooleanArray (array : Boolean[]) : IntPtr
Description描述
Convert a managed array of System.Boolean to a Java array of boolean.
轉換一個System.Boolean的托管數組到一個Java布爾數組。AndroidJNI.ToByteArray 到字節數組
static function ToByteArray (array : Byte[]) : IntPtr
Description描述
Convert a managed array of System.Byte to a Java array of byte.
轉換一個System.Byte的托管數組到一個Java的字節數組。AndroidJNI.ToCharArray 到字符數組
static function ToCharArray (array : Char[]) : IntPtr
Description描述
Convert a managed array of System.Char to a Java array of char.
轉換一個System.Char的托管數組到一個Java的字符數組。AndroidJNI.ToDoubleArray 到雙精度浮點數數組
static function ToDoubleArray (array : double[]) : IntPtr
Description描述
Convert a managed array of System.Double to a Java array of double.
轉換一個System.Double的托管數組到一個Java的雙精度浮點數數組。AndroidJNI.ToFloatArray 到浮點數數組
static function ToFloatArray (array : float[]) : IntPtr
Description描述
Convert a managed array of System.Single to a Java array of float.
轉換一個System.Single的托管數組到一個Java的浮點數數組。AndroidJNI.ToIntArray 到整數數組
static function ToIntArray (array : Int32[]) : IntPtr
Description描述
Convert a managed array of System.Int32 to a Java array of int.
轉換一個System.Int32的托管數組到一個Java的整數數組。AndroidJNI.ToLongArray 到長整數數組
static function ToLongArray (array : Int64[]) : IntPtr
Description描述
Convert a managed array of System.Int64 to a Java array of long.
轉換一個System.Int64的托管數組到一個Java的長整數數組。AndroidJNI.ToObjectArray 到對象數組
static function ToObjectArray (array : IntPtr[]) : IntPtr
Description描述
Convert a managed array of System.IntPtr, representing Java objects, to a Java array of java.lang.Object.
轉換一個System.IntPtr的托管數組,表示Java對象,到一個Java的java.lang.Object數組。AndroidJNI.ToReflectedField 到反射的域
static function ToReflectedField (clazz : IntPtr, fieldID : IntPtr, isStatic : bool) : IntPtr
Description描述
Converts a field ID derived from cls to a java.lang.reflect.Field object.
轉換一個取自clazz的域ID到一個java.lang.reflect.Field對象。AndroidJNI.ToReflectedMethod 到反射的方法
static function ToReflectedMethod (clazz : IntPtr, methodID : IntPtr, isStatic : bool) : IntPtr
Description描述
Converts a method ID derived from clazz to a java.lang.reflect.Method or java.lang.reflect.Constructor object.
轉換一個取自clazz的方法ID到一個java.lang.reflect.Method 或 java.lang.reflect.Constructor對象。AndroidJNI.ToShortArray 到短整數數組
static function ToShortArray (array : Int16[]) : IntPtr
Description描述
Convert a managed array of System.Int16 to a Java array of short.
轉換一個System.Int16的托管數組到一個Java的短整數數組。