本文整理匯總了C#中MonoJavaBridge.JniHandle類的典型用法代碼示例。如果您正苦於以下問題:C# JniHandle類的具體用法?C# JniHandle怎麽用?C# JniHandle使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
JniHandle類屬於MonoJavaBridge命名空間,在下文中一共展示了JniHandle類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Unregister
public static unsafe void Unregister(JniHandle clazz, JNIEnv env)
{
JNIResult res = env.UnregisterNatives(clazz);
if (res != JNIResult.JNI_OK)
{
throw new JNIException("Can't unbind native methods to class.");
}
}
示例2: SetBooleanArrayRegion
public void SetBooleanArrayRegion(JniHandle array, int start, int len, bool[] buf)
{
fixed (bool* ptr = &buf[0])
{
setBooleanArrayRegion(envPtr, array, start, len, (byte*) ptr);
}
ExceptionTest();
}
示例3: SetByteArrayRegion
public void SetByteArrayRegion(JniHandle array, int start, int len, byte[] buf)
{
fixed (byte* ptr = &buf[0])
{
setByteArrayRegion(envPtr, array, start, len, ptr);
}
ExceptionTest();
}
示例4: SetCharArrayRegion
public void SetCharArrayRegion(JniHandle array, int start, int len, char[] buf)
{
fixed (char* ptr = &buf[0])
{
setCharArrayRegion(envPtr, array, start, len, ptr);
}
ExceptionTest();
}
示例5: SetFloatArrayRegion
public void SetFloatArrayRegion(JniHandle array, int start, int len, float[] buf)
{
fixed (float* ptr = &buf[0])
{
setFloatArrayRegion(envPtr, array, start, len, ptr);
}
ExceptionTest();
}
示例6: SetLongArrayRegion
public void SetLongArrayRegion(JniHandle array, int start, int len, long[] buf)
{
fixed (long* ptr = &buf[0])
{
setLongArrayRegion(envPtr, array, start, len, ptr);
}
ExceptionTest();
}
示例7: Register
public static unsafe void Register(List<JNINativeMethod> registrations, JniHandle clazz, JNIEnv env)
{
JNINativeMethod[] methods = registrations.ToArray();
JNIResult res = env.RegisterNatives(clazz, methods, methods.Length);
if (res!=JNIResult.JNI_OK)
{
throw new JNIException("Can't bind native methods to class. Is it in system classloader?");
}
}
示例8: GetArrayLength
public int GetArrayLength(JniHandle array)
{
int res = getArrayLength(envPtr, array);
ExceptionTest();
return res;
}
示例9: SetObjectArrayElement
public void SetObjectArrayElement(JniHandle array, int index, JniHandle val)
{
setObjectArrayElement(envPtr, array, index, val);
ExceptionTest();
}
示例10: GetShortArrayRegion
public void GetShortArrayRegion(JniHandle array, int start, int len, short[] buf)
{
fixed (short* ptr = &buf[0])
{
getShortArrayRegion(envPtr, array, start, len, ptr);
}
ExceptionTest();
}
示例11: GetDoubleArrayRegion
public void GetDoubleArrayRegion(JniHandle array, int start, int len, double[] buf)
{
fixed (double* ptr = &buf[0])
{
getDoubleArrayRegion(envPtr, array, start, len, ptr);
}
ExceptionTest();
}
示例12: Throw
internal void Throw(JniHandle ptr)
{
if (@throw(envPtr, ptr) != JNIResult.JNI_OK)
{
throw new JNIException("Can't throw");
}
}
示例13: NewObjectArray
public JniLocalHandle NewObjectArray(int len, JniHandle clazz, JniHandle init)
{
JniLocalHandle res = newObjectArray(envPtr, len, clazz, init);
ExceptionTest();
return res;
}
示例14: SetStaticDoubleField
internal void SetStaticDoubleField(JniHandle clazz, FieldId fieldID, double value)
{
setStaticDoubleField(envPtr, clazz, fieldID.native, value);
ExceptionTest();
}
示例15: CallDoubleMethod
public double CallDoubleMethod(JniHandle obj, MethodId methodIdNative, params Value[] args)
{
double res = callDoubleMethod(envPtr, obj, methodIdNative.native, args);
ExceptionTest();
return res;
}