AndroidJNI

class in UnityEngine

Switch to Manual

Description

'Raw' JNI interface to Android Java VM from Unity scripting (C#).

Note: Using raw JNI functions requires advanced knowledge of the Android Java Native Interface (JNI). Please take note.

Static Functions

AllocObjectAllocates a new Java object without invoking any of the constructors for the object.
AttachCurrentThreadНазначает текущий поток виртуальной машине Java (Dalvik).
CallBooleanMethodCalls a Java instance method defined by methodID, optionally passing an array of arguments (args) to the method.
CallCharMethodCalls a Java instance method defined by methodID, optionally passing an array of arguments (args) to the method.
CallDoubleMethodCalls a Java instance method defined by methodID, optionally passing an array of arguments (args) to the method.
CallFloatMethodCalls a Java instance method defined by methodID, optionally passing an array of arguments (args) to the method.
CallIntMethodCalls a Java instance method defined by methodID, optionally passing an array of arguments (args) to the method.
CallLongMethodCalls a Java instance method defined by methodID, optionally passing an array of arguments (args) to the method.
CallObjectMethodCalls a Java instance method defined by methodID, optionally passing an array of arguments (args) to the method.
CallSByteMethodCalls a Java instance method defined by methodID, optionally passing an array of arguments (args) to the method.
CallShortMethodCalls a Java instance method defined by methodID, optionally passing an array of arguments (args) to the method.
CallStaticBooleanMethodInvokes the specified methodID static method on a Java object, optionally passing in an array of arguments (args).
CallStaticCharMethodInvokes the specified methodID static method on a Java object, optionally passing in an array of arguments (args).
CallStaticDoubleMethodInvokes the specified methodID static method on a Java object, optionally passing in an array of arguments (args).
CallStaticFloatMethodInvokes the specified methodID static method on a Java object, optionally passing in an array of arguments (args).
CallStaticIntMethodInvokes the specified methodID static method on a Java object, optionally passing in an array of arguments (args).
CallStaticLongMethodInvokes the specified methodID static method on a Java object, optionally passing in an array of arguments (args).
CallStaticObjectMethodInvokes the specified methodID static method on a Java object, optionally passing in an array of arguments (args).
CallStaticSByteMethodInvokes the specified methodID static method on a Java object, optionally passing in an array of arguments (args).
CallStaticShortMethodInvokes the specified methodID static method on a Java object, optionally passing in an array of arguments (args).
CallStaticStringMethodInvokes the specified methodID static method on a Java object, optionally passing in an array of arguments (args).
CallStaticVoidMethodInvokes the specified methodID static method on a Java object, optionally passing in an array of arguments (args).
CallStringMethodCalls a Java instance method defined by methodID, optionally passing an array of arguments (args) to the method.
CallVoidMethodCalls a Java instance method defined by methodID, optionally passing an array of arguments (args) to the method.
DeleteGlobalRefDeletes the global reference pointed to by obj.
DeleteLocalRefDeletes the local reference pointed to by obj.
DeleteWeakGlobalRefDeletes the global weak reference pointed to by obj.
DetachCurrentThreadDetaches the current thread from a Java (Dalvik) VM.
EnsureLocalCapacityГарантирует, что по меньшей мере данное число ссылок может быть создано в текущем потоке.
ExceptionClearClears any exception that is currently being thrown.
ExceptionDescribePrints an exception and a backtrace of the stack to the logcat
ExceptionOccurredDetermines if an exception is being thrown.
FatalErrorRaises a fatal error and does not expect the VM to recover. This function does not return.
FindClassЭта функция загружает локально определенный класс.
FromBooleanArrayConverts a Java array of boolean to a managed array of System.Boolean.
FromCharArrayConverts a Java array of char to a managed array of System.Char.
FromDoubleArrayConverts a Java array of double to a managed array of System.Double.
FromFloatArrayConverts a Java array of float to a managed array of System.Single.
FromIntArrayConverts a Java array of int to a managed array of System.Int32.
FromLongArrayConverts a Java array of long to a managed array of System.Int64.
FromObjectArrayConverts a Java array of java.lang.Object to a managed array of System.IntPtr, representing Java objects.
FromReflectedFieldКонвертирует java.lang.reflect.Field в поле ID.
FromReflectedMethodКонвертирует java.lang.reflect.Method или java.lang.reflect.Constructor объект в метод ID.
FromSByteArrayConverts a Java array of byte to a managed array of System.SByte.
FromShortArrayConverts a Java array of short to a managed array of System.Int16.
GetArrayLengthВозвращает число элементов в массиве.
GetBooleanArrayElementReturns the value of one element of a primitive array.
GetBooleanFieldReturns the value of an instance (nonstatic) field of an object.
GetCharArrayElementReturns the value of one element of a primitive array.
GetCharFieldReturns the value of an instance (nonstatic) field of an object.
GetDoubleArrayElementReturns the value of one element of a primitive array.
GetDoubleFieldReturns the value of an instance (nonstatic) field of an object.
GetFieldIDВозвращает поле ID для экземпляра (не статического) поля класса.
GetFloatArrayElementReturns the value of one element of a primitive array.
GetFloatFieldReturns the value of an instance (nonstatic) field of an object.
GetIntArrayElementReturns the value of one element of a primitive array.
GetIntFieldReturns the value of an instance (nonstatic) field of an object.
GetLongArrayElementReturns the value of one element of a primitive array.
GetLongFieldReturns the value of an instance (nonstatic) field of an object.
GetMethodIDReturns the method ID for an instance (nonstatic) method of a class or interface.
GetObjectArrayElementВозвращает элемент Object массива.
GetObjectClassВозвращает класс объекта.
GetObjectFieldReturns the value of an instance (nonstatic) field of an object.
GetSByteArrayElementReturns the value of one element of a primitive array.
GetSByteFieldReturns the value of an instance (nonstatic) field of an object.
GetShortArrayElementReturns the value of one element of a primitive array.
GetShortFieldReturns the value of an instance (nonstatic) field of an object.
GetStaticBooleanFieldReturns the value of a static field of an object.
GetStaticCharFieldReturns the value of a static field of an object.
GetStaticDoubleFieldReturns the value of a static field of an object.
GetStaticFieldIDВозвращает ID поля для статического поля класса.
GetStaticFloatFieldReturns the value of a static field of an object.
GetStaticIntFieldReturns the value of a static field of an object.
GetStaticLongFieldReturns the value of a static field of an object.
GetStaticMethodIDВозвращает ID метода для статического метода класса.
GetStaticObjectFieldReturns the value of a static field of an object.
GetStaticSByteFieldReturns the value of a static field of an object.
GetStaticShortFieldReturns the value of a static field of an object.
GetStaticStringFieldReturns the value of a static field of an object.
GetStringCharsReturns a pointer to the array of Unicode characters of the string. This pointer is valid until ReleaseStringchars() is called.
GetStringFieldReturns the value of an instance (nonstatic) field of an object.
GetStringLengthReturns the length (the count of Unicode characters) of a Java string.
GetStringUTFCharsВозвращает управляемый объект - строку, представляющую собой строку в модифицированной UTF-8 кодировке.
GetStringUTFLengthReturns the length in bytes of the modified UTF-8 representation of a string.
GetSuperclassЕсли clazz представляет собой какой-либо класс, кроме класса Object, то эта функция возвращает объект, который представляет суперкласс класса, указанного clazz.
GetVersionВозвращает версию родного интерфейса метода.
IsAssignableFromDetermines whether an object of clazz1 can be safely cast to clazz2.
IsInstanceOfПроверяет, является ли объект экземпляром класса.
IsSameObjectПроверяет, ссылаются ли две ссылки на тот же Java объект.
NewBooleanArrayConstructs a new primitive array object.
NewCharArrayConstructs a new primitive array object.
NewDoubleArrayConstructs a new primitive array object.
NewFloatArrayConstructs a new primitive array object.
NewGlobalRefСоздает новую глобальную ссылку на объект, на который ссылается obj аргумент.
NewIntArrayConstructs a new primitive array object.
NewLocalRefСоздает новую локальную ссылку, которая ссылается на тот же объект, как obj.
NewLongArrayConstructs a new primitive array object.
NewObjectConstructs a new Java object. The method ID indicates which constructor method to invoke. This ID must be obtained by calling GetMethodID() with <init> as the method name and void (V) as the return type.
NewObjectArrayConstructs a new array holding objects in class clazz. All elements are initially set to obj.
NewSByteArrayConstructs a new primitive array object.
NewShortArrayConstructs a new primitive array object.
NewStringConstructs a new java.lang.String object from an array of Unicode characters.
NewStringUTFConstructs a new java.lang.String object from an array of characters in modified UTF-8 encoding.
NewWeakGlobalRefCreates a new global weak reference to the object referred to by the obj argument.
PopLocalFramePops 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.
PushLocalFrameCreates a new local reference frame, in which at least a given number of local references can be created.
SetBooleanArrayElementSets the boolean value of one element in a primitive array.
SetBooleanFieldSets the value of an instance field of the specified object.
SetCharArrayElementSets the char value of one element in a primitive array.
SetCharFieldSets the value of an instance field of the specified object.
SetDoubleArrayElementSets the double value of one element in a primitive array.
SetDoubleFieldSets the value of an instance field of the specified object.
SetFloatArrayElementSets the float value of one element in a primitive array.
SetFloatFieldSets the value of an instance field of the specified object.
SetIntArrayElementSets the int value of one element in a primitive array.
SetIntFieldSets the value of an instance field of the specified object.
SetLongArrayElementSets the long value of one element in a primitive array.
SetLongFieldSets the value of an instance field of the specified object.
SetObjectArrayElementSets an element of an Object array.
SetObjectFieldSets the value of an instance field of the specified object.
SetSByteArrayElementSets the sbyte value of one element in a primitive array.
SetSByteFieldSets the value of an instance field of the specified object.
SetShortArrayElementSets the short value of one element in a primitive array.
SetShortFieldSets the value of an instance field of the specified object.
SetStaticBooleanFieldSets the value of a static field in the specified object.
SetStaticCharFieldSets the value of a static field in the specified object.
SetStaticDoubleFieldSets the value of a static field in the specified object.
SetStaticFloatFieldSets the value of a static field in the specified object.
SetStaticIntFieldSets the value of a static field in the specified object.
SetStaticLongFieldSets the value of a static field in the specified object.
SetStaticObjectFieldSets the value of a static field in the specified object.
SetStaticSByteFieldSets the value of a static field in the specified object.
SetStaticShortFieldSets the value of a static field in the specified object.
SetStaticStringFieldSets the value of a static field in the specified object.
SetStringFieldSets the value of an instance field of the specified object.
ThrowCauses a java.lang.Throwable object to be thrown.
ThrowNewConstructs an exception object from the specified class with the message specified by message and causes that exception to be thrown.
ToBooleanArrayConverts a managed array of System.Boolean to a Java array of boolean.
ToCharArrayConverts a managed array of System.Char to a Java array of char.
ToDoubleArrayConverts a managed array of System.Double to a Java array of double.
ToFloatArrayConverts a managed array of System.Single to a Java array of float.
ToIntArrayConverts a managed array of System.Int32 to a Java array of int.
ToLongArrayConverts a managed array of System.Int64 to a Java array of long.
ToObjectArrayConverts a managed array of System.IntPtr, representing Java objects, to a Java array of java.lang.Object.
ToReflectedFieldConverts a field ID derived from cls to a java.lang.reflect.Field object.
ToReflectedMethodConverts a method ID derived from clazz to a java.lang.reflect.Method or java.lang.reflect.Constructor object.
ToSByteArrayConverts a managed array of System.SByte to a Java array of byte.
ToShortArrayConverts a managed array of System.Int16 to a Java array of short.
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961