1.在C/C++中實(shí)現(xiàn)本地方法
生成C/C++頭文件之后,你就需要寫頭文件對(duì)應(yīng)的本地方法。注意:所有的本地方法的第一個(gè)參數(shù)都是指向JNIEnv結(jié)構(gòu)的。這個(gè)結(jié)構(gòu)是用來(lái)調(diào)用JNI函數(shù)的。第二個(gè)參數(shù)jclass的意義,要看方法是不是靜態(tài)的(static)或者實(shí)例(Instance)的。前者,jclass代表一個(gè)類對(duì)象的引用,而后者是被調(diào)用的方法所屬對(duì)象的引用。
返回值和參數(shù)類型根據(jù)等價(jià)約定映射到本地C/C++類型,如表JNI類型映射所示。有些類型,在本地代碼中可直接使用,而其他類型只有通過(guò)JNI調(diào)用操作。
2.JNI函數(shù)大全
1、AndroidJNI.AllocObject 分配對(duì)象
static function AllocObject (clazz : IntPtr) : IntPtrDescription描述Allocates a new Java object without invoking any of the constructors for the object.分配新 Java 對(duì)象而不調(diào)用該對(duì)象的任何構(gòu)造函數(shù)。返回該對(duì)象的引用。clazz 參數(shù)務(wù)必不要引用數(shù)組類。
2、AndroidJNI.AttachCurrentThread 附加當(dāng)前線程
static function AttachCurrentThread () : intDescription描述Attaches the current thread to a Java (Dalvik) VM.附加當(dāng)前線程到一個(gè)Java(Dalvik)虛擬機(jī)。A thread must be attached to the VM before any other JNI calls can be made.一個(gè)線程必須附加到虛擬機(jī),在任何其他JNI可調(diào)用之前。Returns 0 on success; returns a negative number on failure.成功返回0,失敗返回一個(gè)負(fù)數(shù)。
3、AndroidJNI.CallBooleanMethod 調(diào)用布爾方法
static function CallBooleanMethod (obj : IntPtr, methodID : IntPtr, args : jvalue[]) : boolDescription描述Calls an instance (nonstatic) Java method defined by methodID, optionally passing an array of arguments (args) to the method.調(diào)用一個(gè)由methodID定義的實(shí)例的Java方法,可選擇傳遞參數(shù)(args)的數(shù)組到這個(gè)方法。
4、AndroidJNI.CallByteMethod 調(diào)用字節(jié)方法
static function CallByteMethod (obj : IntPtr, methodID : IntPtr, args : jvalue[]) : ByteDescription描述Calls an instance (nonstatic) Java method defined by methodID, optionally passing an array of arguments (args) to the method.
調(diào)用一個(gè)由methodID定義的實(shí)例的Java方法,可選擇傳遞參數(shù)(args)的數(shù)組到這個(gè)方法。
5、AndroidJNI.CallCharMethod 調(diào)用字符方法
static function CallCharMethod (obj : IntPtr, methodID : IntPtr, args : jvalue[]) : CharDescription描述Calls an instance (nonstatic) Java method defined by methodID, optionally passing an array of arguments (args) to the method.調(diào)用一個(gè)由methodID定義的實(shí)例的Java方法,可選擇傳遞參數(shù)(args)的數(shù)組到這個(gè)方法。
6、AndroidJNI.CallDoubleMethod 調(diào)用雙精度浮點(diǎn)數(shù)方法
static function CallDoubleMethod (obj : IntPtr, methodID : IntPtr, args : jvalue[]) : doubleDescription描述Calls an instance (nonstatic) Java method defined by methodID, optionally passing an array of arguments (args) to the method.調(diào)用一個(gè)由methodID定義的實(shí)例的Java方法,可選擇傳遞參數(shù)(args)的數(shù)組到這個(gè)方法。
7、AndroidJNI.CallFloatMethod 調(diào)用浮點(diǎn)數(shù)方法
static function CallFloatMethod (obj : IntPtr, methodID : IntPtr, args : jvalue[]) : floatDescription描述Calls an instance (nonstatic) Java method defined by methodID, optionally passing an array of arguments (args) to the method.調(diào)用一個(gè)由methodID定義的實(shí)例的Java方法,可選擇傳遞參數(shù)(args)的數(shù)組到這個(gè)方法。
8、AndroidJNI.CallIntMethod 調(diào)用整數(shù)方法
static function CallObjectMethod (obj : IntPtr, methodID : IntPtr, args : jvalue[]) : IntPtrDescription描述Calls an instance (nonstatic) Java method defined by methodID, optionally passing an array of arguments (args) to the method.調(diào)用一個(gè)由methodID定義的實(shí)例的Java方法,可選擇傳遞參數(shù)(args)的數(shù)組到這個(gè)方法。
9、AndroidJNI.CallLongMethod 調(diào)用長(zhǎng)整數(shù)方法
static function CallLongMethod (obj : IntPtr, methodID : IntPtr, args : jvalue[]) : Int64Description描述Calls an instance (nonstatic) Java method defined by methodID, optionally passing an array of arguments (args) to the method.調(diào)用一個(gè)由methodID定義的實(shí)例的Java方法,可選擇傳遞參數(shù)(args)的數(shù)組到這個(gè)方法。
10、AndroidJNI.CallObjectMethod 調(diào)用對(duì)象方法
static function CallObjectMethod (obj : IntPtr, methodID : IntPtr, args : jvalue[]) : IntPtrDescription描述Calls an instance (nonstatic) Java method defined by methodID, optionally passing an array of arguments (args) to the method.調(diào)用一個(gè)由methodID定義的實(shí)例的Java方法,可選擇傳遞參數(shù)(args)的數(shù)組到這個(gè)方法。This method returns a reference to a java.lang.Object, or a subclass thereof.這個(gè)方法返回一個(gè)引用到j(luò)ava.lang.Object,或者其子類。
11、AndroidJNI.CallShortMethod 調(diào)用短整數(shù)方法
static function CallShortMethod (obj : IntPtr, methodID : IntPtr, args : jvalue[]) : Int16Description描述Calls an instance (nonstatic) Java method defined by methodID, optionally passing an array of arguments (args) to the method.調(diào)用一個(gè)由methodID定義的實(shí)例的Java方法,可選擇傳遞參數(shù)(args)的數(shù)組到這個(gè)方法。
12、AndroidJNI.CallStaticBooleanMethod 調(diào)用靜態(tài)布爾方法
static function CallStaticBooleanMethod (clazz : IntPtr, methodID : IntPtr, args : jvalue[]) : boolDescription描述Invokes a static method on a Java object, according to the specified methodID, optionally passing an array of arguments (args) to the method.在一個(gè)Java對(duì)象調(diào)用一個(gè)靜態(tài)方法,根據(jù)指定的methodID,可選傳遞參數(shù)(args)的數(shù)組到該方法。
13、AndroidJNI.CallStaticByteMethod 調(diào)用靜態(tài)字節(jié)方法
static function CallStaticByteMethod (clazz : IntPtr, methodID : IntPtr, args : jvalue[]) : ByteDescription描述Invokes a static method on a Java object, according to the specified methodID, optionally passing an array of arguments (args) to the method.在一個(gè)Java對(duì)象調(diào)用一個(gè)靜態(tài)方法,根據(jù)指定的methodID,可選傳遞參數(shù)(args)的數(shù)組到該方法。
14、AndroidJNI.CallStaticCharMethod 調(diào)用靜態(tài)字符方法
static function CallStaticCharMethod (clazz : IntPtr, methodID : IntPtr, args : jvalue[]) : CharDescription描述Invokes a static method on a Java object, according to the specified methodID, optionally passing an array of arguments (args) to the method.在一個(gè)Java對(duì)象調(diào)用一個(gè)靜態(tài)方法,根據(jù)指定的methodID,可選傳遞參數(shù)(args)的數(shù)組到該方法。
15、AndroidJNI.CallStaticDoubleMethod 調(diào)用靜態(tài)雙精度浮點(diǎn)數(shù)方法
static function CallStaticDoubleMethod (clazz : IntPtr, methodID : IntPtr, args : jvalue[]) : doubleDescription描述Invokes a static method on a Java object, according to the specified methodID, optionally passing an array of arguments (args) to the method.在一個(gè)Java對(duì)象調(diào)用一個(gè)靜態(tài)方法,根據(jù)指定的methodID,可選傳遞參數(shù)(args)的數(shù)組到該方法。
16、AndroidJNI.CallStaticFloatMethod 調(diào)用靜態(tài)浮點(diǎn)數(shù)方法
static function CallStaticFloatMethod (clazz : IntPtr, methodID : IntPtr, args : jvalue[]) : floatDescription描述Invokes a static method on a Java object, according to the specified methodID, optionally passing an array of arguments (args) to the method.在一個(gè)Java對(duì)象調(diào)用一個(gè)靜態(tài)方法,根據(jù)指定的methodID,可選傳遞參數(shù)(args)的數(shù)組到該方法。
17、AndroidJNI.CallStaticIntMethod 調(diào)用靜態(tài)整數(shù)方法
static function CallStaticIntMethod (clazz : IntPtr, methodID : IntPtr, args : jvalue[]) : Int32Description描述Invokes a static method on a Java object, according to the specified methodID, optionally passing an array of arguments (args) to the method.在一個(gè)Java對(duì)象調(diào)用一個(gè)靜態(tài)方法,根據(jù)指定的methodID,可選傳遞參數(shù)(args)的數(shù)組到該方法。
18、AndroidJNI.CallStaticLongMethod 調(diào)用靜態(tài)長(zhǎng)整數(shù)方法
static function CallStaticLongMethod (clazz : IntPtr, methodID : IntPtr, args : jvalue[]) : Int64Description描述Invokes a static method on a Java object, according to the specified methodID, optionally passing an array of arguments (args) to the method.在一個(gè)Java對(duì)象調(diào)用一個(gè)靜態(tài)方法,根據(jù)指定的methodID,可選傳遞參數(shù)(args)的數(shù)組到該方法。
19、AndroidJNI.CallStaticObjectMethod 調(diào)用靜態(tài)對(duì)象方法
static function CallStaticObjectMethod (clazz : IntPtr, methodID : IntPtr, args : jvalue[]) : IntPtrDescription描述Invokes a static method on a Java object, according to the specified methodID, optionally passing an array of arguments (args) to the method.在一個(gè)Java對(duì)象調(diào)用一個(gè)靜態(tài)方法,根據(jù)指定的methodID,可選傳遞參數(shù)(args)的數(shù)組到該方法。This method returns a reference to a java.lang.Object, or a subclass thereof.這個(gè)方法返回一個(gè)java.lang.Object的引用,或者其子類。
20、AndroidJNI.CallStaticShortMethod 調(diào)用靜態(tài)短整數(shù)方法
static function CallStaticShortMethod (clazz : IntPtr, methodID : IntPtr, args : jvalue[]) : Int16Description描述Invokes a static method on a Java object, according to the specified methodID, optionally passing an array of arguments (args) to the method.在一個(gè)Java對(duì)象調(diào)用一個(gè)靜態(tài)方法,根據(jù)指定的methodID,可選傳遞參數(shù)(args)的數(shù)組到該方法。
21、AndroidJNI.CallStaticStringMethod 調(diào)用靜態(tài)字符串方法
static function CallStaticStringMethod (clazz : IntPtr, methodID : IntPtr, args : jvalue[]) : stringDescription描述Invokes a static method on a Java object, according to the specified methodID, optionally passing an array of arguments (args) to the method.在一個(gè)Java對(duì)象調(diào)用一個(gè)靜態(tài)方法,根據(jù)指定的methodID,可選傳遞參數(shù)(args)的數(shù)組到該方法。This is a convenience function that calls CallStaticObjectMethod() with the same parameters, but creates a managed string from the result.這是一個(gè)方便的函數(shù),調(diào)用帶有相同參數(shù)的CallStaticObjectMethod(),但從該結(jié)果創(chuàng)建一個(gè)托管字符串。
22、AndroidJNI.CallStaticVoidMethod 調(diào)用靜態(tài)無(wú)類型方法
static function CallStaticVoidMethod (clazz : IntPtr, methodID : IntPtr, args : jvalue[]) : voidDescription描述Invokes a static method on a Java object, according to the specified methodID, optionally passing an array of arguments (args) to the method.
在一個(gè)Java對(duì)象調(diào)用一個(gè)靜態(tài)方法,根據(jù)指定的methodID,可選傳遞參數(shù)(args)的數(shù)組到該方法。
23、AndroidJNI.CallStringMethod 調(diào)用字符串方法
static function CallStringMethod (obj : IntPtr, methodID : IntPtr, args : jvalue[]) : stringDescription描述Calls an instance (nonstatic) Java method defined by methodID, optionally passing an array of arguments (args) to the method.調(diào)用一個(gè)由methodID定義的實(shí)例的Java方法,可選擇傳遞參數(shù)(args)的數(shù)組到這個(gè)方法。This is a convenience function that calls CallObjectMethod() with the same parameters, but creates a managed string from the result.這是一個(gè)方便的函數(shù),調(diào)用帶有相同參數(shù)的CallObjectMethod(),但從整個(gè)結(jié)果創(chuàng)建一個(gè)托管字符串。
24、AndroidJNI.CallVoidMethod 調(diào)用無(wú)類型方法
static function CallVoidMethod (obj : IntPtr, methodID : IntPtr, args : jvalue[]) : voidDescription描述Calls an instance (nonstatic) Java method defined by methodID, optionally passing an array of arguments (args) to the method.調(diào)用一個(gè)由methodID定義的實(shí)例的Java方法,可選擇傳遞參數(shù)(args)的數(shù)組到這個(gè)方法。
25、AndroidJNI.DeleteGlobalRef 刪除全局引用
static function DeleteGlobalRef (obj : IntPtr) : voidDescription描述Deletes the global reference pointed to by obj.刪除 obj 所指向的全局引用。
26、AndroidJNI.DeleteLocalRef 刪除局部引用
static function DeleteLocalRef (obj : IntPtr) : voidDescription描述Deletes the local reference pointed to by obj.刪除 obj 所指向的局部引用。
27、AndroidJNI.DetachCurrentThread 分離當(dāng)前線程
static function DetachCurrentThread () : intDescription描述Detaches the current thread from a Java (Dalvik) VM.從一個(gè)Java(Dalvik)虛擬機(jī),分類當(dāng)前線程。A thread must be detached from the VM before exiting.從退出虛擬機(jī)之前,一個(gè)線程必須被分類。
28、AndroidJNI.EnsureLocalCapacity 確保局部性能
static function EnsureLocalCapacity (capacity : int) : intDescription描述Ensures that at least a given number of local references can be created in the current thread.在當(dāng)前線程確保至少一個(gè)可以被創(chuàng)建的給定局部引用數(shù)。
29、AndroidJNI.ExceptionClear 清除異常
static function ExceptionClear () : voidDescription描述Clears any exception that is currently being thrown.清除當(dāng)前拋出的任何異常。如果當(dāng)前無(wú)異常,則此例程不產(chǎn)生任何效果。
30、AndroidJNI.ExceptionDescribe 描述異常
static function ExceptionDescribe () : voidDescription描述Prints an exception and a backtrace of the stack to the logcat將異常及堆棧的回溯輸出到系統(tǒng)錯(cuò)誤報(bào)告信道。該例程可便利調(diào)試操作。
31、AndroidJNI.ExceptionOccurred 發(fā)生異常
static function ExceptionOccurred () : IntPtrDescription描述Determines if an exception is being thrown確定是否某個(gè)異常正被拋出。
32、AndroidJNI.FatalError 致命錯(cuò)誤
static function FatalError (message : string) : voidDescription描述Raises a fatal error and does not expect the VM to recover. This function does not return.拋出致命錯(cuò)誤并且不希望虛擬機(jī)進(jìn)行修復(fù)。該函數(shù)無(wú)返回值。
33、AndroidJNI.FindClass 查找類
static function FindClass (name : string) : IntPtrDescription描述This function loads a locally-defined class.這個(gè)函數(shù)加載一個(gè)本地定義的類。
34、AndroidJNI.FromBooleanArray 從布爾數(shù)組
static function FromBooleanArray (array : IntPtr) : Boolean[]Description描述Convert a Java array of boolean to a managed array of System.Boolean.轉(zhuǎn)換一個(gè)Java布爾數(shù)組到一個(gè)托管System.Boolean數(shù)組。
35、AndroidJNI.FromByteArray 從字節(jié)數(shù)組
static function FromByteArray (array : IntPtr) : Byte[]Description描述Convert a Java array of byte to a managed array of System.Byte.轉(zhuǎn)換一個(gè)Java字節(jié)數(shù)組到一個(gè)托管的System.Byte數(shù)組。
36、AndroidJNI.FromCharArray 從字符數(shù)組
static function FromCharArray (array : IntPtr) : Char[]Description描述Convert a Java array of char to a managed array of System.Char.轉(zhuǎn)換一個(gè)Java字符數(shù)組到一個(gè)托管的System.Char數(shù)組。
37、AndroidJNI.FromDoubleArray 從雙精度浮點(diǎn)數(shù)數(shù)組
static function FromDoubleArray (array : IntPtr) : double[]Description描述Convert a Java array of double to a managed array of System.Double.轉(zhuǎn)換一個(gè)Java雙精度浮點(diǎn)數(shù)數(shù)組到一個(gè)托管的System.Double數(shù)組。
38、AndroidJNI.FromFloatArray 從浮點(diǎn)數(shù)數(shù)組
static function FromFloatArray (array : IntPtr) : float[]Description描述Convert a Java array of float to a managed array of System.Single.轉(zhuǎn)換一個(gè)Java浮點(diǎn)數(shù)數(shù)組到一個(gè)托管的System.Single數(shù)組。
39、AndroidJNI.FromIntArray 從整數(shù)數(shù)組
static function FromIntArray (array : IntPtr) : Int32[]Description描述Convert a Java array of int to a managed array of System.Int32.轉(zhuǎn)換一個(gè)Java整數(shù)數(shù)組到一個(gè)托管的System.Int32數(shù)組。
40、AndroidJNI.FromLongArray 從整長(zhǎng)數(shù)數(shù)組
static function FromLongArray (array : IntPtr) : Int64[]Description描述Convert a Java array of long to a managed array of System.Int64.轉(zhuǎn)換一個(gè)Java長(zhǎng)整數(shù)數(shù)組到一個(gè)托管的System.Int64數(shù)組。
41、AndroidJNI.FromObjectArray 從對(duì)象數(shù)組
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轉(zhuǎn)換一個(gè)Java的java.lang.Object數(shù)組到一個(gè)托管的System.IntPtr數(shù)組,表示Java對(duì)象。
42、AndroidJNI.FromReflectedField 來(lái)自反射的域
static function FromReflectedField (refField : IntPtr) : IntPtrDescription描述Converts a java.lang.reflect.Field to a field ID.轉(zhuǎn)換一個(gè)java.lang.reflect.Field到一個(gè)域ID。
43、AndroidJNI.FromReflectedMethod 來(lái)自反射的方法
static function FromReflectedMethod (refMethod : IntPtr) : IntPtrDescription描述Converts a java.lang.reflect.Method or java.lang.reflect.Constructor object to a method ID.轉(zhuǎn)換一個(gè)java.lang.reflect.Method或java.lang.reflect.Constructor對(duì)象到一個(gè)方法ID。
44、AndroidJNI.FromShortArray 從短整數(shù)數(shù)組
static function FromShortArray (array : IntPtr) : Int16[]Description描述Convert a Java array of short to a managed array of System.Int16.
轉(zhuǎn)換一個(gè)Java短整數(shù)數(shù)組到一個(gè)托管的System.Int16數(shù)組。
45、AndroidJNI.GetArrayLength 獲取數(shù)組長(zhǎng)度
static function GetArrayLength (array : IntPtr) : intDescription描述Returns the number of elements in the array.返回?cái)?shù)組的元素?cái)?shù)。
46、AndroidJNI.GetBooleanArrayElement 獲取布爾數(shù)組元素
static function GetBooleanArrayElement (array : IntPtr, index : int) : boolDescription描述Returns the value of one element of a primitive array.返回一個(gè)基本數(shù)組一個(gè)元素的值。This function is a special case of GetBooleanArrayRegion(), called with region size set to 1.這個(gè)函數(shù)是一個(gè)特殊情況的GetBooleanArrayRegion(),就是region大小設(shè)置為1時(shí)。
47、AndroidJNI.GetBooleanField 獲取布爾域
static function GetBooleanField (obj : IntPtr, fieldID : IntPtr) : boolDescription描述This function returns the value of an instance (nonstatic) field of an object.這個(gè)函數(shù)返回一個(gè)對(duì)象實(shí)例(非靜態(tài))域的值。
48、AndroidJNI.GetByteArrayElement 獲取字節(jié)數(shù)組元素
static function GetByteArrayElement (array : IntPtr, index : int) : ByteDescription描述Returns the value of one element of a primitive array.返回一個(gè)基本數(shù)組一個(gè)元素的值。This function is a special case of GetByteArrayRegion(), called with region size set to 1.這個(gè)函數(shù)是一個(gè)特殊情況的GetByteArrayRegion(),就是region大小設(shè)置為1時(shí)。
49、AndroidJNI.GetByteField 獲取字節(jié)域
static function GetByteField (obj : IntPtr, fieldID : IntPtr) : ByteDescription描述This function returns the value of an instance (nonstatic) field of an object.這個(gè)函數(shù)返回一個(gè)對(duì)象實(shí)例(非靜態(tài))域的值。
50、AndroidJNI.GetCharArrayElement 獲取字符數(shù)組元素
static function GetCharArrayElement (array : IntPtr, index : int) : CharDescription描述Returns the value of one element of a primitive array.返回一個(gè)基本數(shù)組一個(gè)元素的值。This function is a special case of GetCharArrayRegion(), called with region size set to 1.這個(gè)函數(shù)是一個(gè)特殊情況的GetCharArrayRegion(),就是region大小設(shè)置為1時(shí)。
51、AndroidJNI.GetCharField 獲取字符域
static function GetCharField (obj : IntPtr, fieldID : IntPtr) : CharDescription描述This function returns the value of an instance (nonstatic) field of an object.這個(gè)函數(shù)返回一個(gè)對(duì)象實(shí)例(非靜態(tài))域的值。
52、AndroidJNI.GetDoubleArrayElement 獲取雙精度浮點(diǎn)數(shù)數(shù)組元素
static function GetDoubleArrayElement (array : IntPtr, index : int) : doubleDescription描述Returns the value of one element of a primitive array.返回一個(gè)基本數(shù)組一個(gè)元素的值。This function is a special case of GetDoubleArrayRegion(), called with region size set to 1.這個(gè)函數(shù)是一個(gè)特殊情況的GetDoubleArrayRegion(),就是region大小設(shè)置為1時(shí)。
53、AndroidJNI.GetDoubleField 獲取雙精度浮點(diǎn)數(shù)域
static function GetDoubleField (obj : IntPtr, fieldID : IntPtr) : doubleDescription描述This function returns the value of an instance (nonstatic) field of an object.這個(gè)函數(shù)返回一個(gè)對(duì)象實(shí)例(非靜態(tài))域的值。
54、AndroidJNI.GetFieldID 獲取域ID
static function GetFieldID (clazz : IntPtr, name : string, sig : string) : IntPtrDescription描述Returns the field ID for an instance (nonstatic) field of a class.返回類的實(shí)例(非靜態(tài))域的域 ID。該域由其名稱及簽名指定。GetFieldID() 將未初始化的類初始化。
55、AndroidJNI.GetFloatArrayElement 獲取浮點(diǎn)數(shù)數(shù)組元素
static function GetFloatArrayElement (array : IntPtr, index : int) : floatDescription描述Returns the value of one element of a primitive array.返回一個(gè)基本數(shù)組一個(gè)元素的值。This function is a special case of GetFloatArrayRegion(), called with region size set to 1.這個(gè)函數(shù)是一個(gè)特殊情況的GetFloatArrayRegion(),就是region大小設(shè)置為1時(shí)。
56、AndroidJNI.GetFloatField 獲取浮點(diǎn)數(shù)域
static function GetFloatField (obj : IntPtr, fieldID : IntPtr) : floatDescription描述This function returns the value of an instance (nonstatic) field of an object.這個(gè)函數(shù)返回一個(gè)對(duì)象實(shí)例(非靜態(tài))域的值。
57、AndroidJNI.GetIntArrayElement 獲取整數(shù)數(shù)組元素
static function GetIntArrayElement (array : IntPtr, index : int) : Int32Description描述Returns the value of one element of a primitive array.返回一個(gè)基本數(shù)組一個(gè)元素的值。This function is a special case of GetIntArrayRegion(), called with region size set to 1.這個(gè)函數(shù)是一個(gè)特殊情況的GetIntArrayRegion(),就是region大小設(shè)置為1時(shí)。
58、AndroidJNI.GetIntField 獲取整數(shù)域
static function GetIntField (obj : IntPtr, fieldID : IntPtr) : Int32Description描述This function returns the value of an instance (nonstatic) field of an object.這個(gè)函數(shù)返回一個(gè)對(duì)象實(shí)例(非靜態(tài))域的值。
59、AndroidJNI.GetLongArrayElement 獲取長(zhǎng)整數(shù)數(shù)組元素
static function GetLongArrayElement (array : IntPtr, index : int) : Int64Description描述Returns the value of one element of a primitive array.返回一個(gè)基本數(shù)組一個(gè)元素的值。This function is a special case of GetLongArrayRegion(), called with region size set to 1.這個(gè)函數(shù)是一個(gè)特殊情況的GetLongArrayRegion(),就是region大小設(shè)置為1時(shí)。
60、AndroidJNI.GetLongField 獲取長(zhǎng)整數(shù)域
static function GetLongField (obj : IntPtr, fieldID : IntPtr) : Int64Description描述This function returns the value of an instance (nonstatic) field of an object.這個(gè)函數(shù)返回一個(gè)對(duì)象實(shí)例(非靜態(tài))域的值。
61、AndroidJNI.GetMethodID 獲取方法ID
static function GetMethodID (clazz : IntPtr, name : string, sig : string) : IntPtrDescription描述Returns the method ID for an instance (nonstatic) method of a class or interface.返回類或接口實(shí)例(非靜態(tài))方法的方法 ID。方法可在某個(gè) clazz 的超類中定義,也可從 clazz 繼承。該方法由其名稱和簽名決定。GetMethodID() 可使未初始化的類初始化。
62、AndroidJNI.GetObjectArrayElement 獲取對(duì)象數(shù)組元素
static function GetObjectArrayElement (array : IntPtr, index : int) : IntPtrDescription描述Returns an element of an Object array.返回一個(gè)對(duì)象數(shù)組的一個(gè)元素。
63、AndroidJNI.GetObjectClass 獲取對(duì)象類
static function GetObjectClass (obj : IntPtr) : IntPtrDescription描述Returns the class of an object.返回一個(gè)對(duì)象的類。
64、AndroidJNI.GetObjectField 獲取對(duì)象域
static function GetObjectField (obj : IntPtr, fieldID : IntPtr) : IntPtrDescription描述This function returns the value of an instance (nonstatic) field of an object.這個(gè)函數(shù)返回一個(gè)對(duì)象實(shí)例(非靜態(tài))域的值。The result is a reference to a java.lang.Object, or a subclass thereof.其結(jié)果是對(duì)一個(gè)java.lang.Object的引用,或者其子類。
65、AndroidJNI.GetShortArrayElement 獲取短整數(shù)數(shù)組元素
static function GetShortArrayElement (array : IntPtr, index : int) : Int16Description描述Returns the value of one element of a primitive array.返回一個(gè)基本數(shù)組一個(gè)元素的值。This function is a special case of GetShortArrayRegion(), called with region size set to 1.這個(gè)函數(shù)是一個(gè)特殊情況的GetShortArrayRegion(),就是region大小設(shè)置為1時(shí)。
66、AndroidJNI.GetShortField 獲取短整數(shù)域
static function GetShortField (obj : IntPtr, fieldID : IntPtr) : Int16Description描述This function returns the value of an instance (nonstatic) field of an object.這個(gè)函數(shù)返回一個(gè)對(duì)象實(shí)例(非靜態(tài))域的值。
67、AndroidJNI.GetStaticBooleanField 獲取靜態(tài)布爾域
static function GetStaticBooleanField (clazz : IntPtr, fieldID : IntPtr) : boolDescription描述This function returns the value of a static field of an object.這個(gè)函數(shù)返回一個(gè)對(duì)象靜態(tài)域的值。
68、AndroidJNI.GetStaticByteField 獲取靜態(tài)字節(jié)域
static function GetStaticByteField (clazz : IntPtr, fieldID : IntPtr) : ByteDescription描述This function returns the value of a static field of an object.這個(gè)函數(shù)返回一個(gè)對(duì)象靜態(tài)域的值。
69、AndroidJNI.GetStaticCharField 獲取靜態(tài)字符域
static function GetStaticCharField (clazz : IntPtr, fieldID : IntPtr) : CharDescription描述This function returns the value of a static field of an object.這個(gè)函數(shù)返回一個(gè)對(duì)象靜態(tài)域的值。
70、AndroidJNI.GetStaticDoubleField 獲取靜態(tài)雙精度浮點(diǎn)數(shù)域
static function GetStaticDoubleField (clazz : IntPtr, fieldID : IntPtr) : doubleDescription描述This function returns the value of a static field of an object.這個(gè)函數(shù)返回一個(gè)對(duì)象靜態(tài)域的值。
71、AndroidJNI.GetStaticFieldID 獲取靜態(tài)域ID
static function GetStaticFieldID (clazz : IntPtr, name : string, sig : string) : IntPtrDescription描述Returns the field ID for a static field of a class.返回類的靜態(tài)域的域 ID。域由其名稱和簽名指定。GetStaticFieldID() 將未初始化的類初始化。
72、AndroidJNI.GetStaticFloatField 獲取靜態(tài)浮點(diǎn)數(shù)域
static function GetStaticFloatField (clazz : IntPtr, fieldID : IntPtr) : floatDescription描述This function returns the value of a static field of an object.這個(gè)函數(shù)返回一個(gè)對(duì)象靜態(tài)域的值。
73、AndroidJNI.GetStaticIntField 獲取靜態(tài)整數(shù)域
static function GetStaticIntField (clazz : IntPtr, fieldID : IntPtr) : Int64Description描述This function returns the value of a static field of an object.這個(gè)函數(shù)返回一個(gè)對(duì)象靜態(tài)域的值。
74、AndroidJNI.GetStaticLongField 獲取靜態(tài)長(zhǎng)整數(shù)域
static function GetStaticLongField (clazz : IntPtr, fieldID : IntPtr) : Int64Description描述This function returns the value of a static field of an object.這個(gè)函數(shù)返回一個(gè)對(duì)象靜態(tài)域的值。
75、AndroidJNI.GetStaticMethodID 獲取靜態(tài)方法ID
static function GetStaticMethodID (clazz : IntPtr, name : string, sig : string) : IntPtrDescription描述Returns the method ID for a static method of a class.返回類的靜態(tài)方法的方法 ID。方法由其名稱和簽名指定。GetStaticMethodID() 將未初始化的類初始化。
76、AndroidJNI.GetStaticObjectField 獲取靜態(tài)對(duì)象域
static function GetStaticObjectField (clazz : IntPtr, fieldID : IntPtr) : IntPtrDescription描述This function returns the value of a static field of an object.這個(gè)函數(shù)返回一個(gè)對(duì)象靜態(tài)域的值。The result is a reference to a java.lang.Object, or a subclass thereof.該結(jié)果是一個(gè)java.lang.Object的引用,或者其子類。
77、AndroidJNI.GetStaticShortField 獲取靜態(tài)短整數(shù)域
static function GetStaticShortField (clazz : IntPtr, fieldID : IntPtr) : Int16Description描述This function returns the value of a static field of an object.這個(gè)函數(shù)返回一個(gè)對(duì)象靜態(tài)域的值。
78、AndroidJNI.GetStaticStringField 獲取靜態(tài)字符串域
static function GetStaticStringField (clazz : IntPtr, fieldID : IntPtr) : stringDescription描述This function returns the value of a static field of an object.這個(gè)函數(shù)返回一個(gè)對(duì)象靜態(tài)域的值。This is a convenience function that calls GetStaticObjectField() with the same parameters, but creates a managed string from the result.這是一個(gè)方便的函數(shù),調(diào)用帶有相同參數(shù)的GetStaticObjectField(),但從該結(jié)果創(chuàng)建一個(gè)托管字符串。
79、AndroidJNI.GetStringField 獲取字符串域
static function GetStringField (obj : IntPtr, fieldID : IntPtr) : stringDescription描述This function returns the value of an instance (nonstatic) field of an object.這個(gè)函數(shù)返回一個(gè)對(duì)象實(shí)例(非靜態(tài))域的值。This is a convenience function that calls GetObjectField() with the same parameters, but creates a managed string from the result.這是一個(gè)方便的函數(shù),調(diào)用帶有相同參數(shù)的GetObjectField(),但從結(jié)果創(chuàng)建一個(gè)托管字符串。
80、AndroidJNI.GetStringUTFChars 獲取字符串UTF的字符
static function GetStringUTFChars (str : IntPtr) : stringDescription描述Returns a managed string object representing the string in modified UTF-8 encoding.返回由UTF-8修改的托管的字符串對(duì)象。另解,返回指向字符串的 UTF-8 字符數(shù)組的指針。This method is a modification of the original GetStringUTFChars, which returns a pointer to an array of bytes.這個(gè)方法是原始GetStringUTFChars的修改,返回指向字節(jié)的數(shù)組。
81、AndroidJNI.GetStringUTFLength 獲取字符串UTF的長(zhǎng)度
static function GetStringUTFLength (str : IntPtr) : intDescription描述Returns the length in bytes of the modified UTF-8 representation of a string.以字節(jié)為單位返回字符串的 UTF-8 長(zhǎng)度。
82、AndroidJNI.GetSuperclass 獲取超類
static function GetSuperclass (clazz : IntPtr) : IntPtrDescription描述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,則該函數(shù)返回由 clazz 所指定的類的超類。If clazz specifies the class Object, or clazz represents an interface, this function returns NULL.如果 clazz 指定類 Object,或代表某個(gè)接口,則該函數(shù)返回 NULL。
83、AndroidJNI.GetVersion 獲取版本
static function GetVersion () : intDescription描述Returns the version of the native method interface.返回本地方法接口的版本。
84、AndroidJNI.IsAssignableFrom 是否可賦值
static function IsAssignableFrom (clazz1 : IntPtr, clazz2 : IntPtr) : boolDescription描述Determines whether an object of clazz1 can be safely cast to clazz2.確定 clazz1 的對(duì)象是否可安全地強(qiáng)制轉(zhuǎn)換為 clazz2。
85、AndroidJNI.IsInstanceOf 是否某類的實(shí)例
static function IsInstanceOf (obj : IntPtr, clazz : IntPtr) : boolDescription描述Tests whether an object is an instance of a class.測(cè)試對(duì)象是否為某個(gè)類的實(shí)例。
86、AndroidJNI.IsSameObject 是否同一對(duì)象
static function IsSameObject (obj1 : IntPtr, obj2 : IntPtr) : boolDescription描述Tests whether two references refer to the same Java object.測(cè)試兩個(gè)引用是否引用同一 Java 對(duì)象。
87、AndroidJNI.NewBooleanArray 新建布爾數(shù)組
static function NewBooleanArray (size : int) : IntPtrDescription描述Construct a new primitive array object.構(gòu)造一個(gè)新的基本數(shù)組對(duì)象。
88、AndroidJNI.NewByteArray 新建字節(jié)數(shù)組
static function NewByteArray (size : int) : IntPtrDescription描述Construct a new primitive array object.構(gòu)造一個(gè)新的基本數(shù)組對(duì)象。
89、AndroidJNI.NewCharArray 新建字符數(shù)組
static function NewCharArray (size : int) : IntPtrDescription描述Construct a new primitive array object.構(gòu)造一個(gè)新的基本數(shù)組對(duì)象。
90、AndroidJNI.NewDoubleArray 新建雙精度浮點(diǎn)數(shù)數(shù)組
static function NewDoubleArray (size : int) : IntPtrDescription描述Construct a new primitive array object.構(gòu)造一個(gè)新的基本數(shù)組對(duì)象。
91、AndroidJNI.NewFloatArray 新建浮點(diǎn)數(shù)數(shù)組
static function NewFloatArray (size : int) : IntPtrDescription描述Construct a new primitive array object.構(gòu)造一個(gè)新的基本數(shù)組對(duì)象。
92、AndroidJNI.NewGlobalRef 新建全局引用
static function NewGlobalRef (obj : IntPtr) : IntPtrDescription描述Creates a new global reference to the object referred to by the obj argument.創(chuàng)建 obj 參數(shù)所引用對(duì)象的新全局引用。全局引用通過(guò)調(diào)用 DeleteGlobalRef() 來(lái)顯式撤消。返回全局引用。如果系統(tǒng)內(nèi)存不足則返回 NULL。
93、AndroidJNI.NewIntArray 新建整數(shù)數(shù)組
static function NewIntArray (size : int) : IntPtrDescription描述Construct a new primitive array object.構(gòu)造一個(gè)新的基本數(shù)組對(duì)象。
94、AndroidJNI.NewLocalRef 新建局部引用
static function NewLocalRef (obj : IntPtr) : IntPtrDescription描述Creates a new local reference that refers to the same object as obj.創(chuàng)建 obj 參數(shù)對(duì)象的新局部引用。
95、AndroidJNI.NewLongArray 新建長(zhǎng)整數(shù)數(shù)組
static function NewLongArray (size : int) : IntPtrDescription描述Construct a new primitive array object.
構(gòu)造一個(gè)新的基本數(shù)組對(duì)象。
96、AndroidJNI.NewObjectArray 新建對(duì)象數(shù)組
static function NewObjectArray (size : int, clazz : IntPtr, obj : IntPtr) : IntPtrDescription描述Constructs a new array holding objects in class clazz. All elements are initially set to obj.構(gòu)造新的數(shù)組,它將保存在類 clazz 中的對(duì)象。所有元素初始值均設(shè)為 obj。
97、AndroidJNI.NewObject 新建對(duì)象
static function NewObject (clazz : IntPtr, methodID : IntPtr, args : jvalue[]) : IntPtrDescription描述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.構(gòu)造新的 Java 對(duì)象。方法 ID指示應(yīng)調(diào)用的構(gòu)造函數(shù)方法。該 ID 必須通過(guò)調(diào)用 GetMethodID() 獲得,且調(diào)用時(shí)的方法名必須為 ,而返回類型必須為 void (V)。clazz 參數(shù)務(wù)必不要引用數(shù)組類。98、AndroidJNI.NewShortArray 新建短整數(shù)數(shù)組
static function NewShortArray (size : int) : IntPtrDescription描述Construct a new primitive array object.構(gòu)造一個(gè)新的基本數(shù)組對(duì)象。
99、AndroidJNI.NewStringUTF 新建UTF字符串
static function NewStringUTF (bytes : string) : IntPtrDescription描述Constructs a new java.lang.String object from an array of characters in modified UTF-8 encoding.利用 UTF-8 字符數(shù)組構(gòu)造新的 java.lang.String 對(duì)象。
100、AndroidJNI.PopLocalFrame 彈出局部幀
static function PopLocalFrame (result : IntPtr) : IntPtrDescription描述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.彈出關(guān)閉當(dāng)前局部引用幀,釋放所有的本地引用,并返回一個(gè)局部引用,在前一個(gè)局部引用幀,用于給定的結(jié)果對(duì)象。 PushLocalFrame為一定數(shù)量的局部引用創(chuàng)建了一個(gè)使用堆棧,而PopLocalFrame負(fù)責(zé)銷毀堆棧頂端的引用。 Push/PopLocalFrame函數(shù)對(duì)提供了對(duì)局部引用的生命周期更方便的管理。 在管理局部引用的生命周期中,Push/PopLocalFrame是非常方便的。你可以在本地函數(shù)的入口處調(diào)用PushLocalFrame,然后在出 口處調(diào)用PopLocalFrame,這樣的話,在函數(shù)對(duì)中間任何位置創(chuàng)建的局部引用都會(huì)被釋放。而且,這兩個(gè)函數(shù)是非常高效的。 如果你在函數(shù)的入口處調(diào)用了PushLocalFrame,記住在所有的出口(有return出現(xiàn)的地方)調(diào)用PopLocalFrame。 大量的局部引用創(chuàng)建會(huì)浪費(fèi)不必要的內(nèi)存。一個(gè)局部引用會(huì)導(dǎo)致它本身和它所指向的對(duì)象都得不到回收。尤其要注意那些長(zhǎng)時(shí)間運(yùn)行的方法、創(chuàng)建局部引用的循環(huán)和工具函數(shù),充分得利用Pus/PopLocalFrame來(lái)高效地管理局部引用。
101、AndroidJNI.PushLocalFrame 壓入局部幀
static function PushLocalFrame (capacity : int) : intDescription描述Creates a new local reference frame, in which at least a given number of local references can be created.創(chuàng)建一個(gè)新的局部引入幀,至少一個(gè)給定的局部引用可以被創(chuàng)建的數(shù)。 PushLocalFrame為一定數(shù)量的局部引用創(chuàng)建了一個(gè)使用堆棧,而PopLocalFrame負(fù)責(zé)銷毀堆棧頂端的引用。 Push/PopLocalFrame函數(shù)對(duì)提供了對(duì)局部引用的生命周期更方便的管理。 在管理局部引用的生命周期中,Push/PopLocalFrame是非常方便的。你可以在本地函數(shù)的入口處調(diào)用PushLocalFrame,然后在出 口處調(diào)用PopLocalFrame,這樣的話,在函數(shù)對(duì)中間任何位置創(chuàng)建的局部引用都會(huì)被釋放。而且,這兩個(gè)函數(shù)是非常高效的。 如果你在函數(shù)的入口處調(diào)用了PushLocalFrame,記住在所有的出口(有return出現(xiàn)的地方)調(diào)用PopLocalFrame。 大量的局部引用創(chuàng)建會(huì)浪費(fèi)不必要的內(nèi)存。一個(gè)局部引用會(huì)導(dǎo)致它本身和它所指向的對(duì)象都得不到回收。尤其要注意那些長(zhǎng)時(shí)間運(yùn)行的方法、創(chuàng)建局部引用的循環(huán)和工具函數(shù),充分得利用Pus/PopLocalFrame來(lái)高效地管理局部引用。
102、AndroidJNI.SetBooleanArrayElement 設(shè)置布爾數(shù)組數(shù)組元素
static function SetBooleanArrayElement (array : IntPtr, index : int, val : byte) : voidDescription描述Sets the value of one element in a primitive array.設(shè)置一個(gè)基本數(shù)組一個(gè)元素的值。This function is a special case of SetBooleanArrayRegion(), called with region size set to 1.這個(gè)函數(shù)是一個(gè)特殊情況的SetBooleanArrayRegion(),就是region大小設(shè)置為1時(shí)。
103、AndroidJNI.SetBooleanField 設(shè)置布爾域
static function SetBooleanField (obj : IntPtr, fieldID : IntPtr, val : bool) : voidDescription描述This function sets the value of an instance (nonstatic) field of an object.這個(gè)函數(shù)設(shè)置一個(gè)對(duì)象實(shí)例(非靜態(tài))域的值。
104、AndroidJNI.SetByteArrayElement 設(shè)置字節(jié)數(shù)組元素
static function SetByteArrayElement (array : IntPtr, index : int, val : sbyte) : voidDescription描述Sets the value of one element in a primitive array.設(shè)置一個(gè)基本數(shù)組一個(gè)元素的值。This function is a special case of SetByteArrayRegion(), called with region size set to 1.這個(gè)函數(shù)是一個(gè)特殊情況的SetByteArrayRegion(),就是region大小設(shè)置為1時(shí)。
106、AndroidJNI.SetByteField 設(shè)置字節(jié)域
static function SetByteField (obj : IntPtr, fieldID : IntPtr, val : Byte) : voidDescription描述This function sets the value of an instance (nonstatic) field of an object.這個(gè)函數(shù)設(shè)置一個(gè)對(duì)象實(shí)例(非靜態(tài))域的值。
107、AndroidJNI.SetCharArrayElement 設(shè)置字符數(shù)組元素
static function SetCharArrayElement (array : IntPtr, index : int, val : Char) : voidDescription描述Sets the value of one element in a primitive array.設(shè)置一個(gè)基本數(shù)組一個(gè)元素的值。This function is a special case of SetCharArrayRegion(), called with region size set to 1.這個(gè)函數(shù)是一個(gè)特殊情況的SetCharArrayRegion(),就是region大小設(shè)置為1時(shí)。
108、AndroidJNI.SetCharField 設(shè)置字符域
static function SetCharField (obj : IntPtr, fieldID : IntPtr, val : Char) : voidDescription描述This function sets the value of an instance (nonstatic) field of an object.這個(gè)函數(shù)設(shè)置一個(gè)對(duì)象實(shí)例(非靜態(tài))域的值。
109、AndroidJNI.SetDoubleArrayElement 設(shè)置雙精度浮點(diǎn)數(shù)數(shù)組元素
static function SetDoubleArrayElement (array : IntPtr, index : int, val : double) : voidDescription描述Sets the value of one element in a primitive array.設(shè)置一個(gè)基本數(shù)組一個(gè)元素的值。This function is a special case of SetDoubleArrayRegion(), called with region size set to 1.這個(gè)函數(shù)是一個(gè)特殊情況的SetDoubleArrayRegion(),就是region大小設(shè)置為1時(shí)。
110、AndroidJNI.SetDoubleField 設(shè)置雙精度浮點(diǎn)數(shù)域
static function SetDoubleField (obj : IntPtr, fieldID : IntPtr, val : double) : voidDescription描述This function sets the value of an instance (nonstatic) field of an object.這個(gè)函數(shù)設(shè)置一個(gè)對(duì)象實(shí)例(非靜態(tài))域的值。
111、AndroidJNI.SetFloatArrayElement 設(shè)置浮點(diǎn)數(shù)數(shù)組元素
static function SetFloatArrayElement (array : IntPtr, index : int, val : float) : voidDescription描述Sets the value of one element in a primitive array.設(shè)置一個(gè)基本數(shù)組一個(gè)元素的值。This function is a special case of SetFloatArrayRegion(), called with region size set to 1.這個(gè)函數(shù)是一個(gè)特殊情況的SetFloatArrayRegion(),就是region大小設(shè)置為1時(shí)。
112、AndroidJNI.SetFloatField 設(shè)置浮點(diǎn)數(shù)域
static function SetFloatField (obj : IntPtr, fieldID : IntPtr, val : float) : voidDescription描述This function sets the value of an instance (nonstatic) field of an object.這個(gè)函數(shù)設(shè)置一個(gè)對(duì)象實(shí)例(非靜態(tài))域的值。
113、AndroidJNI.SetIntArrayElement 設(shè)置整數(shù)數(shù)組元素
static function SetIntArrayElement (array : IntPtr, index : int, val : Int32) : voidDescription描述Sets the value of one element in a primitive array.設(shè)置一個(gè)基本數(shù)組一個(gè)元素的值。This function is a special case of SetIntArrayRegion(), called with region size set to 1.這個(gè)函數(shù)是一個(gè)特殊情況的SetIntArrayRegion(),就是region大小設(shè)置為1時(shí)。
114、AndroidJNI.SetIntField 設(shè)置整數(shù)域
static function SetIntField (obj : IntPtr, fieldID : IntPtr, val : Int32) : voidDescription描述This function sets the value of an instance (nonstatic) field of an object.這個(gè)函數(shù)設(shè)置一個(gè)對(duì)象實(shí)例(非靜態(tài))域的值。
115、AndroidJNI.SetLongArrayElement 設(shè)置長(zhǎng)整數(shù)數(shù)組元素
static function SetLongArrayElement (array : IntPtr, index : int, val : Int64) : voidDescription描述Sets the value of one element in a primitive array.設(shè)置一個(gè)基本數(shù)組一個(gè)元素的值。This function is a special case of SetLongArrayRegion(), called with region size set to 1.這個(gè)函數(shù)是一個(gè)特殊情況的SetLongArrayRegion(),就是region大小設(shè)置為1時(shí)。
116、AndroidJNI.SetLongField 設(shè)置長(zhǎng)整數(shù)域
static function SetLongField (obj : IntPtr, fieldID : IntPtr, val : Int64) : voidDescription描述This function sets the value of an instance (nonstatic) field of an object.這個(gè)函數(shù)設(shè)置一個(gè)對(duì)象實(shí)例(非靜態(tài))域的值。
117、AndroidJNI.SetObjectArrayElement 設(shè)置對(duì)象數(shù)組元素
static function SetObjectArrayElement (array : IntPtr, index : int, obj : IntPtr) : voidDescription描述Sets an element of an Object array.設(shè)置一個(gè)對(duì)象數(shù)組的一個(gè)元素。
118、AndroidJNI.SetObjectField 設(shè)置對(duì)象域
static function SetObjectField (obj : IntPtr, fieldID : IntPtr, val : IntPtr) : voidDescription描述This function sets the value of an instance (nonstatic) field of an object.這個(gè)函數(shù)設(shè)置一個(gè)對(duì)象實(shí)例(非靜態(tài))域的值。The value to set is a reference to either a java.lang.Object, or a subclass thereof.要設(shè)置的值無(wú)論是一個(gè)java.lang.Object的引用,或者其子類。
119、AndroidJNI.SetShortArrayElement 設(shè)置短整數(shù)數(shù)組元素
static function SetShortArrayElement (array : IntPtr, index : int, val : Int16) : voidDescription描述Sets the value of one element in a primitive array.設(shè)置一個(gè)基本數(shù)組一個(gè)元素的值。This function is a special case of SetShortArrayRegion(), called with region size set to 1.這個(gè)函數(shù)是一個(gè)特殊情況的SetShortArrayRegion(),就是region大小設(shè)置為1時(shí)。
120、AndroidJNI.SetShortField 設(shè)置短整數(shù)域
static function SetShortField (obj : IntPtr, fieldID : IntPtr, val : Int16) : voidDescription描述This function sets the value of an instance (nonstatic) field of an object.這個(gè)函數(shù)設(shè)置一個(gè)對(duì)象實(shí)例(非靜態(tài))域的值。
121、AndroidJNI.SetStaticBooleanField 設(shè)置靜態(tài)布爾域
static function SetStaticBooleanField (clazz : IntPtr, fieldID : IntPtr, val : bool) : voidDescription描述This function ets the value of a static field of an object.這個(gè)函數(shù)設(shè)置一個(gè)對(duì)象的靜態(tài)域的值。
122、AndroidJNI.SetStaticByteField 設(shè)置靜態(tài)字節(jié)域
static function SetStaticByteField (clazz : IntPtr, fieldID : IntPtr, val : Byte) : voidDescription描述This function ets the value of a static field of an object.這個(gè)函數(shù)設(shè)置一個(gè)對(duì)象的靜態(tài)域的值。
123、AndroidJNI.SetStaticCharField 設(shè)置靜態(tài)字符域
static function SetStaticCharField (clazz : IntPtr, fieldID : IntPtr, val : Char) : voidDescription描述This function ets the value of a static field of an object.這個(gè)函數(shù)設(shè)置一個(gè)對(duì)象的靜態(tài)域的值。
124、AndroidJNI.SetStaticDoubleField 設(shè)置靜態(tài)雙精度浮點(diǎn)數(shù)域
static function SetStaticDoubleField (clazz : IntPtr, fieldID : IntPtr, val : double) : voidDescription描述This function ets the value of a static field of an object.這個(gè)函數(shù)設(shè)置一個(gè)對(duì)象的靜態(tài)域的值。
125、AndroidJNI.SetStaticFloatField 設(shè)置靜態(tài)浮點(diǎn)數(shù)域
static function SetStaticFloatField (clazz : IntPtr, fieldID : IntPtr, val : float) : voidDescription描述This function ets the value of a static field of an object.這個(gè)函數(shù)設(shè)置一個(gè)對(duì)象的靜態(tài)域的值。
126、AndroidJNI.SetStaticIntField 設(shè)置靜態(tài)整數(shù)域
static function SetStaticIntField (clazz : IntPtr, fieldID : IntPtr, val : Int32) : voidDescription描述This function ets the value of a static field of an object.這個(gè)函數(shù)設(shè)置一個(gè)對(duì)象的靜態(tài)域的值。
127、AndroidJNI.SetStaticLongField 設(shè)置靜態(tài)長(zhǎng)整數(shù)域
static function SetStaticLongField (clazz : IntPtr, fieldID : IntPtr, val : Int64) : voidDescription描述This function ets the value of a static field of an object.這個(gè)函數(shù)設(shè)置一個(gè)對(duì)象的靜態(tài)域的值。
128、AndroidJNI.SetStaticObjectField 設(shè)置靜態(tài)對(duì)象域
static function SetStaticObjectField (clazz : IntPtr, fieldID : IntPtr, val : IntPtr) : voidDescription描述This function ets the value of a static field of an object.這個(gè)函數(shù)設(shè)置一個(gè)對(duì)象的靜態(tài)域的值。The value to set is a reference to either a java.lang.Object, or a subclass thereof.設(shè)置該值不管是一個(gè)java.lang.Object的引用,或是其子類。
129、AndroidJNI.SetStaticShortField 設(shè)置靜態(tài)短整數(shù)域
static function SetStaticShortField (clazz : IntPtr, fieldID : IntPtr, val : Int16) : voidDescription描述This function ets the value of a static field of an object.這個(gè)函數(shù)設(shè)置一個(gè)對(duì)象的靜態(tài)域的值。
130、AndroidJNI.SetStaticStringField 設(shè)置靜態(tài)字符串域
static function SetStaticStringField (clazz : IntPtr, fieldID : IntPtr, val : string) : voidDescription描述This function ets the value of a static field of an object.這個(gè)函數(shù)設(shè)置一個(gè)對(duì)象的靜態(tài)域的值。This is a convenience function that calls SetStaticObjectField() with the same parameters, but performs the necessary marshalling of the string value.這是一個(gè)方便的函數(shù),調(diào)用帶有相同參數(shù)的SetStaticObjectField(),但執(zhí)行需要字符串的值編組。
131、AndroidJNI.SetStringField 設(shè)置字符串域
static function SetStringField (obj : IntPtr, fieldID : IntPtr, val : string) : voidDescription描述This function sets the value of an instance (nonstatic) field of an object.這個(gè)函數(shù)設(shè)置一個(gè)對(duì)象實(shí)例(非靜態(tài))域的值。This is a convenience function that calls SetObjectField() with the same parameters, but performs the necessary marshalling of the string value.這是一個(gè)方便的函數(shù),調(diào)用帶有相同參數(shù)的SetObjectField(),但執(zhí)行字符串的值需要編組。
132、AndroidJNI.ThrowNew 新的拋出
static function ThrowNew (clazz : IntPtr, message : string) : intDescription描述Constructs an exception object from the specified class with the message specified by message and causes that exception to be thrown.利用指定類的消息(由 message 指定)構(gòu)造異常對(duì)象并拋出該異常。
133、AndroidJNI.Throw 拋出
static function Throw (obj : IntPtr) : intDescription描述Causes a java.lang.Throwable object to be thrown.導(dǎo)致一個(gè)java.lang.Throwable的對(duì)象被拋出。
134、AndroidJNI.ToBooleanArray 到布爾數(shù)組
static function ToBooleanArray (array : Boolean[]) : IntPtrDescription描述Convert a managed array of System.Boolean to a Java array of boolean.轉(zhuǎn)換一個(gè)System.Boolean的托管數(shù)組到一個(gè)Java布爾數(shù)組。
135、AndroidJNI.ToByteArray 到字節(jié)數(shù)組
static function ToByteArray (array : Byte[]) : IntPtrDescription描述Convert a managed array of System.Byte to a Java array of byte.轉(zhuǎn)換一個(gè)System.Byte的托管數(shù)組到一個(gè)Java的字節(jié)數(shù)組。
136、AndroidJNI.ToCharArray 到字符數(shù)組
static function ToCharArray (array : Char[]) : IntPtrDescription描述Convert a managed array of System.Char to a Java array of char.轉(zhuǎn)換一個(gè)System.Char的托管數(shù)組到一個(gè)Java的字符數(shù)組。
137、AndroidJNI.ToDoubleArray 到雙精度浮點(diǎn)數(shù)數(shù)組
static function ToDoubleArray (array : double[]) : IntPtrDescription描述Convert a managed array of System.Double to a Java array of double.轉(zhuǎn)換一個(gè)System.Double的托管數(shù)組到一個(gè)Java的雙精度浮點(diǎn)數(shù)數(shù)組。
138、AndroidJNI.ToFloatArray 到浮點(diǎn)數(shù)數(shù)組
static function ToFloatArray (array : float[]) : IntPtrDescription描述Convert a managed array of System.Single to a Java array of float.轉(zhuǎn)換一個(gè)System.Single的托管數(shù)組到一個(gè)Java的浮點(diǎn)數(shù)數(shù)組。
139、AndroidJNI.ToIntArray 到整數(shù)數(shù)組
static function ToIntArray (array : Int32[]) : IntPtrDescription描述Convert a managed array of System.Int32 to a Java array of int.轉(zhuǎn)換一個(gè)System.Int32的托管數(shù)組到一個(gè)Java的整數(shù)數(shù)組。
140、AndroidJNI.ToLongArray 到長(zhǎng)整數(shù)數(shù)組
static function ToLongArray (array : Int64[]) : IntPtrDescription描述Convert a managed array of System.Int64 to a Java array of long.轉(zhuǎn)換一個(gè)System.Int64的托管數(shù)組到一個(gè)Java的長(zhǎng)整數(shù)數(shù)組。
141、AndroidJNI.ToObjectArray 到對(duì)象數(shù)組
static function ToObjectArray (array : IntPtr[]) : IntPtrDescription描述Convert a managed array of System.IntPtr, representing Java objects, to a Java array of java.lang.Object.轉(zhuǎn)換一個(gè)System.IntPtr的托管數(shù)組,表示Java對(duì)象,到一個(gè)Java的java.lang.Object數(shù)組。
142、AndroidJNI.ToReflectedField 到反射的域
static function ToReflectedField (clazz : IntPtr, fieldID : IntPtr, isStatic : bool) : IntPtrDescription描述Converts a field ID derived from cls to a java.lang.reflect.Field object.轉(zhuǎn)換一個(gè)取自clazz的域ID到一個(gè)java.lang.reflect.Field對(duì)象。
143、AndroidJNI.ToReflectedMethod 到反射的方法
static function ToReflectedMethod (clazz : IntPtr, methodID : IntPtr, isStatic : bool) : IntPtrDescription描述Converts a method ID derived from clazz to a java.lang.reflect.Method or java.lang.reflect.Constructor object.轉(zhuǎn)換一個(gè)取自clazz的方法ID到一個(gè)java.lang.reflect.Method 或 java.lang.reflect.Constructor對(duì)象。
144、AndroidJNI.ToShortArray 到短整數(shù)數(shù)組
static function ToShortArray (array : Int16[]) : IntPtrDescription描述Convert a managed array of System.Int16 to a Java array of short.轉(zhuǎn)換一個(gè)System.Int16的托管數(shù)組到一個(gè)Java的短整數(shù)數(shù)組。
來(lái)自:學(xué)而不思則罔,思而不學(xué)則貽