
- 简 写
- JNI
- 外文名
- Java Native Interface
- 编程语言
- Java
- 中文名
- Java本地接口
- 学 科
- Java和本地代码间的双向交互
- 目 的
- 使用 Java 本地接口书写程序
-
JNI
2013-09-14 16:43:41JNI 空函数调用开销是JAVA4倍以上,JAVA版本越低越差。 ● 需要直接操作物理设备,而没有相关的驱动程序,这时候我们可能需要用C甚至汇编语言来编写该设备的驱动,然后通过JNI调用; ● 涉及大量数学运算的部分,...JNI 空函数调用开销是JAVA4倍以上,JAVA版本越低越差。
● 需要直接操作物理设备,而没有相关的驱动程序,这时候我们可能需要用C甚至汇编语言来编写该设备的驱动,然后通过JNI调用;
● 涉及大量数学运算的部分,用Java会带来些效率上的损失;
● 用Java会产生系统难以支付的开销,如需要大量网络链接的场合;
● 存在大量可重用的C/C++代码,通过JNI可以减少开发工作量,避免重复开发。多的局部引用将使虚拟机在执行本地方法时耗尽内存;
● JNI技术不仅可以让Java程序调用C/C++代码,也可以让C/C++代码调用Java代码。 -
jni
2012-03-26 10:14:03JNI是Java Native Interface的缩写,译为Java本地接口。它允许Java代码和其他语言编写的代码进行交互。在android中提供JNI的方式,让Java程 序可以调用C语言程序。android中很多Java类都具有native接口,这些接口由...JNI是Java Native Interface的缩写,译为Java本地接口。它允许Java代码和其他语言编写的代码进行交互。在android中提供JNI的方式,让Java程 序可以调用C语言程序。android中很多Java类都具有native接口,这些接口由本地实现,然后注册到系统中。
主要的JNI代码放在以下的路径中:frameworks/base/core/jni/,这个路径中的内容被编译成库 libandroid_runtime.so,这是个普通的动态库,被放置在目标系统的/system/lib目录下。此外,android还有其他的 JNI库。JNI中的各个文件,实际上就是普通的C++源文件;在android中实现的JNI库,需要连接动态库 libnativehelper.so。
1,JNI的实现方式
实现JNI需要在Java源代码中声明,在C++代码中实现JNI的各种方法,并把这些方法注册到系统中。实现JNI的核心是 JNINativeMethod结构体。
typedef struct {
const char* name;
const char* signature;
void* fnPtr;
} JNINativeMethod;第一个变量name是Java中JNI函数的名字,第二个变量signature用字符串描述函数参数和返回值,第三个变量fnPtr是JNI函 数C指针。
在Java代码中,定义的函数由JNI实现时,需要指定函数为native。
2,在应用程 序中使用JNI,可以通过代码中/development/samples/SimpleJNI来分析:
A,分析顶层 Android.mk文件
LOCAL_PACKAGE_NAME := SimpleJNI //生成PACKAGE的名字,在out/target/product/smdk6410/obj/APPS
LOCAL_JNI_SHARED_LIBRARIES := libsimplejni //生成JNI共享库的名字,在....smdk6410/obj/SHARED_LIBRARIES
include $(BUILD_PACKAGE) //以生成APK的方式编译
include $(call all-makefiles-under,$(LOCAL_PATH)) //调用下层makefile
B,分析 JNI目录下Android.mk文件
LOCAL_SRC_FILES:= / //JNI的C++源文件
native.cppinclude $(BUILD_SHARED_LIBRARY) //以共享库方式编译
3,JNI的代码实现和调用
A,native.cpp内容
static jint
add(JNIEnv *env, jobject thiz, jint a, jint b) { //定义JAVA方法add
int result = a + b;
LOGI("%d + %d = %d", a, b, result);
return result;
}
static const char *classPathName = "com/example/android/simplejni/Native"; //目标JAVA类路径,此处即Native类的路径
static JNINativeMethod methods[] = {//本地实现方法列表
{"add", "(II)I", (void*)add },
};
/*
* Register several native methods for one class.
*/
static int registerNativeMethods(JNIEnv* env, const char* className,
JNINativeMethod* gMethods, int numMethods)
{
jclass clazz;
clazz = env->FindClass(className);
if (clazz == NULL) {
LOGE("Native registration unable to find class '%s'", className);
return JNI_FALSE;
}
if (env->RegisterNatives(clazz, gMethods, numMethods) < 0) {//最后调用jni.c中得方法
LOGE("RegisterNatives failed for '%s'", className);
return JNI_FALSE;
}
return JNI_TRUE;
}
/*
* Register native methods for all classes we know about.
*
* returns JNI_TRUE on success.
*/
static int registerNatives(JNIEnv* env)
{
if (!registerNativeMethods(env, classPathName,
methods, sizeof(methods) / sizeof(methods[0]))) {
return JNI_FALSE;
}
return JNI_TRUE;
}
// ----------------------------------------------------------------------------
/*
* This is called by the VM when the shared library is first loaded.
*/
typedef union {
JNIEnv* env;
void* venv;
} UnionJNIEnvToVoid;
jint JNI_OnLoad(JavaVM* vm, void* reserved)//为当前虚拟机平台注册本地JNI
{
UnionJNIEnvToVoid uenv;
uenv.venv = NULL;
jint result = -1;
JNIEnv* env = NULL;
LOGI("JNI_OnLoad");
if (vm->GetEnv(&uenv.venv, JNI_VERSION_1_4) != JNI_OK) {
LOGE("ERROR: GetEnv failed");
goto bail;
}
env = uenv.env;
if (registerNatives(env) != JNI_TRUE) {//跳到为所有类注册native方法
LOGE("ERROR: registerNatives failed");
goto bail;
}
result = JNI_VERSION_1_4;//告诉VM JINI的版本
bail:
return result;
}当VM执行到C组件(即*.so文件)的System.loadLibrary()函数时,首先去执行.cpp文件中的JNI_Onload()函数,JNI_Onload函数的作用:
1:告诉VM此C组件使用哪个JNI版本,如果没有提供JNI_OnLoad函数,VM默认JNI为1.1版本,如果使用新的JNI版本就必须由JNI_OnLoad来告诉VM
2:可以由JNI_OnLoad做初始化工作
B,SimpleJNI.java 内容
package com.example.android.simplejni; //JAVA包,跟文件路径对应
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView; //需要包含的类,以便调用函数public class SimpleJNI extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
TextView tv = new TextView(this);
int sum = Native.add(2, 3); //调用Native类的函数add,该add就是JNI函数,由CPP实现
tv.setText("2 + 3 = " + Integer.toString(sum));
setContentView(tv); //在屏幕上显示
}
}class Native {
static {
// The runtime will add "lib" on the front and ".o" on the end of
// the name supplied to loadLibrary.
System.loadLibrary("simplejni"); //载入由native.cpp生成的动态库,全名是lib+simplejni+.o
}static native int add(int a, int b); //声明动态库中实现的JNI函数add,供JAVA调用
}编译生成PACKAGE后,安装到MID上,运行即是2+3=5。
Android JNI 使用的数据结构JNINativeMethod详解
Andoird 中使用了一种不同传统Java JNI的方式来定义其native的函数。其中很重要的区别是Andorid使用了一种Java 和 C 函数的映射表数组,并在其中描述了函数的参数和返回值。这个数组的类型是JNINativeMethod,定义如下:此数据结构定义在jni.h中在\dalvik\libnativehelper\include\nativehelper文件夹中
typedef struct {
const char* name;
const char* signature;
void* fnPtr;
} JNINativeMethod;第一个变量name是Java中函数的名字。
第二个变量signature,用字符串是描述了函数的参数和返回值
第三个变量fnPtr是函数指针,指向C函数。
其中比较难以理解的是第二个参数,例如
"()V"
"(II)V"
"(Ljava/lang/String;Ljava/lang/String;)V"
实际上这些字符是与函数的参数类型一一对应的。
"()" 中的字符表示参数,后面的则代表返回值。例如"()V" 就表示void Func();
"(II)V" 表示 void Func(int, int);
具体的每一个字符的对应关系如下
字符 Java类型 C类型
V void void
Z jboolean boolean
I jint int
J jlong long
D jdouble double
F jfloat float
B jbyte byte
C jchar char
S jshort short数组则以"["开始,用两个字符表示
[I jintArray int[]
[F jfloatArray float[]
[B jbyteArray byte[]
[C jcharArray char[]
[S jshortArray short[]
[D jdoubleArray double[]
[J jlongArray long[]
[Z jbooleanArray boolean[]上面的都是基本类型。如果Java函数的参数是class,则以"L"开头,以";"结尾中间是用"/" 隔开的包及类名。而其对应的C函数名的参数则为jobject. 一个例外是String类,其对应的类为jstring
Ljava/lang/String; String jstring
Ljava/net/Socket; Socket jobject如果JAVA函数位于一个嵌入类,则用$作为类名间的分隔符。
例如 "(Ljava/lang/String;Landroid/os/FileUtils$FileStatus;)Z"
JNI调用原理:
JNI:
http://blog.csdn.net/droidpioneer/article/details/6787571
其中的目录:
internal目录:\frameworks\base\core\java\com\android\internal\os
RegFNIRec gRegJNI[]数组对应的函数在:\frameworks\base\core\jni
jniRegisterNativeMethods函数在:\dalvik\libnativehelper\JNIHelp.c中调用RegisterNatives 在\dalvik\vm\Jni.c中 -
Android:JNI 与 NDK到底是什么?(含实例教学)
2017-06-14 17:03:49今天,我将先介绍JNI 与 NDK & 之间的区别,手把手进行 NDK的使用教学,希望你们会喜欢 目录1. JNI介绍1.1 简介 定义:Java Native Interface,即 Java本地接口 作用: 使得Java 与 本地其他类型语言(如C、C++)...前言
- 在
Android
开发中,使用NDK
开发的需求正逐渐增大 - 但很多人却搞不懂
JNI
与NDK
到底是怎么回事 - 今天,我将先介绍
JNI
与NDK
& 之间的区别,手把手进行NDK
的使用教学,希望你们会喜欢
目录
1. JNI介绍
1.1 简介
- 定义:
Java Native Interface
,即Java
本地接口 - 作用: 使得
Java
与 本地其他类型语言(如C、C++
)交互
即在
Java
代码 里调用C、C++
等语言的代码 或C、C++
代码调用Java
代码- 特别注意:
JNI
是Java
调用Native
语言的一种特性JNI
是属于Java
的,与Android
无直接关系
1.2 为什么要有 JNI
- 背景:实际使用中,
Java
需要与 本地代码 进行交互 - 问题:因为
Java
具备跨平台的特点,所以Java
与 本地代码交互的能力非常弱 - 解决方案: 采用
JNI
特性 增强Java
与 本地代码交互的能力
1.3 实现步骤
- 在
Java
中声明Native
方法(即需要调用的本地方法) - 编译上述
Java
源文件javac(得到.class
文件) - 通过
javah
命令导出JNI
的头文件(.h
文件) - 使用
Java
需要交互的本地代码 实现在Java
中声明的Native
方法
如
Java
需要与C++
交互,那么就用C++
实现Java
的Native
方法- 编译
.so
库文件 - 通过
Java
命令执行Java
程序,最终实现Java
调用本地代码
更加详细过程请参考本文第4节:具体使用
2. NDK介绍
2.1 简介
- 定义:
Native Development Kit
,是Android
的一个工具开发包
NDK是属于
Android
的,与Java
并无直接关系- 作用:快速开发
C
、C++
的动态库,并自动将so
和应用一起打包成APK
即可通过
NDK
在Android
中 使用JNI
与本地代码(如C、C++)交互- 应用场景:在Android的场景下 使用JNI
即
Android
开发的功能需要本地代码(C/C++)实现- 特点
- 额外注意
2.2 使用步骤
- 配置
Android NDK
环境 - 创建
Android
项目,并与NDK
进行关联 - 在
Android
项目中声明所需要调用的Native
方法 - 使用
Android
需要交互的本地代码 实现在Android
中声明的Native
方法
比如
Android
需要与C++
交互,那么就用C++
实现Java
的Native
方法- 通过
ndk - bulid
命令编译产生.so
库文件 - 编译
Android Studio
工程,从而实现Android
调用本地代码
更加详细过程请参考本文第4节:具体使用
3. NDK与JNI关系
4. 具体使用
本文根据版本的不同介绍了两种在
Android Studio
中实现NDK
的方法:Android Studio
2.2 以下 & 2.2以上4.1
Android Studio
2.2 以下实现NDK-
步骤如下
- 配置
Android NDK
环境 - 关联
Andorid Studio
项目 与NDK
- 创建本地代码文件(即需要在
Android
项目中调用的本地代码文件) - 创建
Android.mk
文件 &Application.mk
文件 - 编译上述文件,生成
.so
库文件,并放入到工程文件中 - 在
Andoird Studio
项目中使用NDK
实现JNI
功能
- 配置
-
步骤详解
步骤1:配置 Android NDK环境
具体请看文章手把手教你配置Android NDK环境
步骤2: 关联Andorid Studio项目 与 NDK
- 当你的项目每次需要使用
NDK
时,都需要将该项目关联到NDK
- 此处使用的是
Andorid Studio
,与Eclipse
不同 - 还在使用
Eclipse
的同学请自行查找资料配置
- 具体配置如下
a. 在
Gradle
的local.properties
中添加配置ndk.dir=/Users/Carson_Ho/Library/Android/sdk/ndk-bundle
若
ndk
目录存放在SDK
的目录中,并命名为ndk-bundle
,则该配置自动添加b. 在
Gradle
的gradle.properties
中添加配置android.useDeprecatedNdk=true // 对旧版本的NDK支持
c. 在
Gradle
的build.gradle添加ndk节点- 至此,将Andorid Studio的项目 与 NDK 关联完毕
- 下面,将真正开始讲解如何在项目中使用NDK
步骤3:创建本地代码文件
- 即需要在Android项目中调用的本地代码文件
此处采用
C++
作为展示test.cpp
# include <jni.h> # include <stdio.h> extern "C" { JNIEXPORT jstring JNICALL Java_scut_carson_1ho_ndk_1demo_MainActivity_getFromJNI(JNIEnv *env, jobject obj ){ // 参数说明 // 1. JNIEnv:代表了VM里面的环境,本地的代码可以通过该参数与Java代码进行操作 // 2. obj:定义JNI方法的类的一个本地引用(this) return env -> NewStringUTF("Hello i am from JNI!"); // 上述代码是返回一个String类型的"Hello i am from JNI!"字符串 } }
此处需要注意:
- 如果本地代码是
C++
(.cpp
或者.cc
),要使用extern "C" { }
把本地方法括进去 JNIEXPORT jstring JNICALL
中的JNIEXPORT
和JNICALL
不能省- 关于方法名
Java_scut_carson_1ho_ndk_1demo_MainActivity_getFromJNI
- 格式 =
Java _包名 _ 类名_Java需要调用的方法名
Java
必须大写- 对于包名,包名里的
.
要改成_
,_
要改成_1
如我的包名是:
scut.carson_ho.ndk_demo
,则需要改成scut_carson_1ho_ndk_1demo
- 格式 =
最后,将创建好的test.cpp文件放入到工程文件目录中的
src/main/jni
文件夹若无
jni
文件夹,则手动创建。下面我讲解一下JNI类型与Java类型对应的关系介绍
步骤4:创建Android.mk文件
- 作用:指定源码编译的配置信息
如工作目录,编译模块的名称,参与编译的文件等
- 具体使用
LOCAL_PATH := $(call my-dir) // 设置工作目录,而my-dir则会返回Android.mk文件所在的目录 include $(CLEAR_VARS) // 清除几乎所有以LOCAL——PATH开头的变量(不包括LOCAL_PATH) LOCAL_MODULE := hello_jni // 设置模块的名称,即编译出来.so文件名 // 注,要和上述步骤中build.gradle中NDK节点设置的名字相同 LOCAL_SRC_FILES := test.cpp // 指定参与模块编译的C/C++源文件名 include $(BUILD_SHARED_LIBRARY) // 指定生成的静态库或者共享库在运行时依赖的共享库模块列表。
最后,将上述文件同样放在
src/main/jni
文件夹中。步骤5:创建Application.mk文件
- 作用:配置编译平台相关内容
- 具体使用
APP_ABI := armeabi // 最常用的APP_ABI字段:指定需要基于哪些CPU平台的.so文件 // 常见的平台有armeabi x86 mips,其中移动设备主要是armeabi平台 // 默认情况下,Android平台会生成所有平台的.so文件,即同APP_ABI := armeabi x86 mips // 指定CPU平台类型后,就只会生成该平台的.so文件,即上述语句只会生成armeabi平台的.so文件
最后,将上述文件同样放在
src/main/jni
文件夹中步骤6:编译上述文件,生成.so库文件
- 经过上述步骤,在
src/main/jni
文件夹中已经有3个文件
- 打开终端,输入以下命令
// 步骤1:进入该文件夹 cd /Users/Carson_Ho/AndroidStudioProjects/NDK_Demo/app/src/main/jni // 步骤2:运行NDK编译命令 ndk-build
- 编译成功后,在
src/main/
会多了两个文件夹libs
&obj
,其中libs
下存放的是.so
库文件
步骤7:在
src/main/
中创建一个名为jniLibs
的文件夹,并将上述生成的so文件夹放到该目录下- 要把名为
CPU
平台的文件夹放进去,而不是把.so
文件放进去 - 如果本来就有.so文件,那么就直接创建名为
jniLibs
的文件夹并放进去就可以
步骤8:在Andoird Studio项目中使用NDK实现JNI功能
- 此时,我们已经将本地代码文件编译成
.so
库文件并放入到工程文件中 - 在
Java
代码中调用本地代码中的方法,具体代码如下:
MainActivity.java
public class MainActivity extends AppCompatActivity { // 步骤1:加载生成的so库文件 // 注意要跟.so库文件名相同 static { System.loadLibrary("hello_jni"); } // 步骤2:定义在JNI中实现的方法 public native String getFromJNI(); // 此处设置了一个按钮用于触发JNI方法 private Button Button; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); // 通过Button调用JNI中的方法 Button = (Button) findViewById(R.id.button); Button.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Button.setText(getFromJNI()); } }); }
主布局文件:activity_main.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" tools:context="scut.carson_ho.ndk_demo.MainActivity"> // 此处设置了一个按钮用于触发JNI方法 <Button android:id="@+id/button" android:layout_centerInParent="true" android:layout_width="300dp" android:layout_height="50dp" android:text="调用JNI代码" /> </RelativeLayout>
结果展示
源码地址
4.2
Android Studio
2.2 以上实现NDK- 如果你的
Android Studio
是2.2以上的,那么请采用下述方法
因为
Android Studio
2.2以上已经内部集成NDK
,所以只需要在Android Studio
内部进行配置就可以- 步骤讲解
步骤1:按提示创建工程
在创建工程时,需要配置
NDK
,根据提示一步步安装即可。步骤2:根据需求使用NDK
- 配置好
NDK
后,Android Studio
会自动生成C++
文件并设置好调用的代码 - 你只需要根据需求修改
C++
文件 &Android
就可以使用了。
5. 总结
- 本文主要讲解
Java
的JNI
与Android
的NDK
相关知识 - 下面我将继续对
Android
中的NDK
进行深入讲解 ,有兴趣可以继续关注Carson_Ho的安卓开发笔记
请帮顶或评论点赞!因为你的鼓励是我写作的最大动力!
欢迎关注carson_ho的微信公众号
- 在
-
Android JNI详解,让你彻底了解JNI (下)
2020-03-26 09:32:04Android开发中,随着对移动程序的安全性、性能等方面的重视,JNI技术也越发重要。 如今,多数企业在招聘中、高级程序员时,基本上都要求熟悉JNI开发,所以,掌握JNI技术,也是我们迈进心仪企业的必备条件。 本套... -
Android JNI详解,让你彻底了解JNI (上)
2019-12-12 08:42:51Android开发中,随着对移动程序的安全性、性能等方面的重视,JNI技术也越发重要。 如今,多数企业在招聘中、高级程序员时,基本上都要求熟悉JNI开发,所以,掌握JNI技术,也是我们迈进心仪企业的必备条件。本套课程... -
JNI的两个头文件jni.h和jni_md.h
2011-04-13 09:59:14JNI的两个头文件jni.h和jni_md.h,提供需要的人下载!!!!! -
Android JNI精细化讲解,让你彻底了解JNI(中)
2019-12-15 13:38:08Android开发中,随着对移动程序的安全性、性能等方面的重视,JNI技术也越发重要。 如今,多数企业在招聘中、高级程序员时,基本上都要求熟悉JNI开发,所以,掌握JNI技术,也是我们迈进心仪企业的必备条件。 本套课程... -
JNI语法 JNI参考 JNI函数大全
2016-05-10 16:47:49原文地址:JNI语法 JNI参考 JNI函数大全 内容太多,请按Ctrl+F查找你需要的信息。 一、对照表 Java类型 本地类型 描述 boolean jboolean C/C++8位整型 byte jbyte C/C++带符号的8位整型 ...原文地址:JNI语法 JNI参考 JNI函数大全
内容太多,请按Ctrl+F查找你需要的信息。
一、对照表
Java类型 本地类型 描述
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.html1、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 参数务必不要引用数组类。
2、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,失败返回一个负数。
3、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)的数组到这个方法。
4、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)的数组到这个方法。
5、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)的数组到这个方法。
6、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)的数组到这个方法。
7、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)的数组到这个方法。
8、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)的数组到这个方法。
9、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)的数组到这个方法。
10、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,或者其子类。
11、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)的数组到这个方法。
12、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)的数组到该方法。
13、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)的数组到该方法。
14、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)的数组到该方法。
15、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)的数组到该方法。
16、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)的数组到该方法。
17、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)的数组到该方法。
18、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)的数组到该方法。
19、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的引用,或者其子类。
20、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)的数组到该方法。
21、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(),但从该结果创建一个托管字符串。
22、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)的数组到该方法。
23、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(),但从整个结果创建一个托管字符串。
24、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)的数组到这个方法。
25、AndroidJNI.DeleteGlobalRef 删除全局引用
static function DeleteGlobalRef (obj : IntPtr) : void
Description描述
Deletes the global reference pointed to by obj.
删除 obj 所指向的全局引用。
26、AndroidJNI.DeleteLocalRef 删除局部引用
static function DeleteLocalRef (obj : IntPtr) : void
Description描述
Deletes the local reference pointed to by obj.
删除 obj 所指向的局部引用。
27、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.
从退出虚拟机之前,一个线程必须被分类。
28、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.
在当前线程确保至少一个可以被创建的给定局部引用数。
29、AndroidJNI.ExceptionClear 清除异常
static function ExceptionClear () : void
Description描述
Clears any exception that is currently being thrown.
清除当前抛出的任何异常。如果当前无异常,则此例程不产生任何效果。
30、AndroidJNI.ExceptionDescribe 描述异常
static function ExceptionDescribe () : void
Description描述
Prints an exception and a backtrace of the stack to the logcat
将异常及堆栈的回溯输出到系统错误报告信道。该例程可便利调试操作。
31、AndroidJNI.ExceptionOccurred 发生异常
static function ExceptionOccurred () : IntPtr
Description描述
Determines if an exception is being thrown
确定是否某个异常正被抛出。
32、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.
抛出致命错误并且不希望虚拟机进行修复。该函数无返回值。
33、AndroidJNI.FindClass 查找类
static function FindClass (name : string) : IntPtr
Description描述
This function loads a locally-defined class.
这个函数加载一个本地定义的类。
34、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数组。
35、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数组。
36、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数组。
37、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数组。
38、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数组。
39、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数组。
40、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数组。
41、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对象。
42、AndroidJNI.FromReflectedField 来自反射的域
static function FromReflectedField (refField : IntPtr) : IntPtr
Description描述
Converts a java.lang.reflect.Field to a field ID.
转换一个java.lang.reflect.Field到一个域ID。
43、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。
44、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数组。
45、AndroidJNI.GetArrayLength 获取数组长度
static function GetArrayLength (array : IntPtr) : int
Description描述
Returns the number of elements in the array.
返回数组的元素数。
46、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时。
47、AndroidJNI.GetBooleanField 获取布尔域
static function GetBooleanField (obj : IntPtr, fieldID : IntPtr) : bool
Description描述
This function returns the value of an instance (nonstatic) field of an object.
这个函数返回一个对象实例(非静态)域的值。
48、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时。
49、AndroidJNI.GetByteField 获取字节域
static function GetByteField (obj : IntPtr, fieldID : IntPtr) : Byte
Description描述
This function returns the value of an instance (nonstatic) field of an object.
这个函数返回一个对象实例(非静态)域的值。
50、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时。
51、AndroidJNI.GetCharField 获取字符域
static function GetCharField (obj : IntPtr, fieldID : IntPtr) : Char
Description描述
This function returns the value of an instance (nonstatic) field of an object.
这个函数返回一个对象实例(非静态)域的值。
52、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时。
53、AndroidJNI.GetDoubleField 获取双精度浮点数域
static function GetDoubleField (obj : IntPtr, fieldID : IntPtr) : double
Description描述
This function returns the value of an instance (nonstatic) field of an object.
这个函数返回一个对象实例(非静态)域的值。
54、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() 将未初始化的类初始化。
55、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时。
56、AndroidJNI.GetFloatField 获取浮点数域
static function GetFloatField (obj : IntPtr, fieldID : IntPtr) : float
Description描述
This function returns the value of an instance (nonstatic) field of an object.
这个函数返回一个对象实例(非静态)域的值。
57、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时。
58、AndroidJNI.GetIntField 获取整数域
static function GetIntField (obj : IntPtr, fieldID : IntPtr) : Int32
Description描述
This function returns the value of an instance (nonstatic) field of an object.
这个函数返回一个对象实例(非静态)域的值。
59、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时。
60、AndroidJNI.GetLongField 获取长整数域
static function GetLongField (obj : IntPtr, fieldID : IntPtr) : Int64
Description描述
This function returns the value of an instance (nonstatic) field of an object.
这个函数返回一个对象实例(非静态)域的值。
61、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() 可使未初始化的类初始化。
62、AndroidJNI.GetObjectArrayElement 获取对象数组元素
static function GetObjectArrayElement (array : IntPtr, index : int) : IntPtr
Description描述
Returns an element of an Object array.
返回一个对象数组的一个元素。
63、AndroidJNI.GetObjectClass 获取对象类
static function GetObjectClass (obj : IntPtr) : IntPtr
Description描述
Returns the class of an object.
返回一个对象的类。
64、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的引用,或者其子类。
65、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时。
66、AndroidJNI.GetShortField 获取短整数域
static function GetShortField (obj : IntPtr, fieldID : IntPtr) : Int16
Description描述
This function returns the value of an instance (nonstatic) field of an object.
这个函数返回一个对象实例(非静态)域的值。
67、AndroidJNI.GetStaticBooleanField 获取静态布尔域
static function GetStaticBooleanField (clazz : IntPtr, fieldID : IntPtr) : bool
Description描述
This function returns the value of a static field of an object.
这个函数返回一个对象静态域的值。
68、AndroidJNI.GetStaticByteField 获取静态字节域
static function GetStaticByteField (clazz : IntPtr, fieldID : IntPtr) : Byte
Description描述
This function returns the value of a static field of an object.
这个函数返回一个对象静态域的值。
69、AndroidJNI.GetStaticCharField 获取静态字符域
static function GetStaticCharField (clazz : IntPtr, fieldID : IntPtr) : Char
Description描述
This function returns the value of a static field of an object.
这个函数返回一个对象静态域的值。
70、AndroidJNI.GetStaticDoubleField 获取静态双精度浮点数域
static function GetStaticDoubleField (clazz : IntPtr, fieldID : IntPtr) : double
Description描述
This function returns the value of a static field of an object.
这个函数返回一个对象静态域的值。
71、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() 将未初始化的类初始化。
72、AndroidJNI.GetStaticFloatField 获取静态浮点数域
static function GetStaticFloatField (clazz : IntPtr, fieldID : IntPtr) : float
Description描述
This function returns the value of a static field of an object.
这个函数返回一个对象静态域的值。
73、AndroidJNI.GetStaticIntField 获取静态整数域
static function GetStaticIntField (clazz : IntPtr, fieldID : IntPtr) : Int64
Description描述
This function returns the value of a static field of an object.
这个函数返回一个对象静态域的值。
74、AndroidJNI.GetStaticLongField 获取静态长整数域
static function GetStaticLongField (clazz : IntPtr, fieldID : IntPtr) : Int64
Description描述
This function returns the value of a static field of an object.
这个函数返回一个对象静态域的值。
75、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() 将未初始化的类初始化。
76、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的引用,或者其子类。
77、AndroidJNI.GetStaticShortField 获取静态短整数域
static function GetStaticShortField (clazz : IntPtr, fieldID : IntPtr) : Int16
Description描述
This function returns the value of a static field of an object.
这个函数返回一个对象静态域的值。
78、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(),但从该结果创建一个托管字符串。
79、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(),但从结果创建一个托管字符串。
80、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的修改,返回指向字节的数组。
81、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 长度。
82、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。
83、AndroidJNI.GetVersion 获取版本
static function GetVersion () : int
Description描述
Returns the version of the native method interface.
返回本地方法接口的版本。
84、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。
85、AndroidJNI.IsInstanceOf 是否某类的实例
static function IsInstanceOf (obj : IntPtr, clazz : IntPtr) : bool
Description描述
Tests whether an object is an instance of a class.
测试对象是否为某个类的实例。
86、AndroidJNI.IsSameObject 是否同一对象
static function IsSameObject (obj1 : IntPtr, obj2 : IntPtr) : bool
Description描述
Tests whether two references refer to the same Java object.
测试两个引用是否引用同一 Java 对象。
87、AndroidJNI.NewBooleanArray 新建布尔数组
static function NewBooleanArray (size : int) : IntPtr
Description描述
Construct a new primitive array object.
构造一个新的基本数组对象。
88、AndroidJNI.NewByteArray 新建字节数组
static function NewByteArray (size : int) : IntPtr
Description描述
Construct a new primitive array object.
构造一个新的基本数组对象。
89、AndroidJNI.NewCharArray 新建字符数组
static function NewCharArray (size : int) : IntPtr
Description描述
Construct a new primitive array object.
构造一个新的基本数组对象。
90、AndroidJNI.NewDoubleArray 新建双精度浮点数数组
static function NewDoubleArray (size : int) : IntPtr
Description描述
Construct a new primitive array object.
构造一个新的基本数组对象。
91、AndroidJNI.NewFloatArray 新建浮点数数组
static function NewFloatArray (size : int) : IntPtr
Description描述
Construct a new primitive array object.
构造一个新的基本数组对象。
92、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。
93、AndroidJNI.NewIntArray 新建整数数组
static function NewIntArray (size : int) : IntPtr
Description描述
Construct a new primitive array object.
构造一个新的基本数组对象。
94、AndroidJNI.NewLocalRef 新建局部引用
static function NewLocalRef (obj : IntPtr) : IntPtr
Description描述
Creates a new local reference that refers to the same object as obj.
创建 obj 参数对象的新局部引用。
95、AndroidJNI.NewLongArray 新建长整数数组
static function NewLongArray (size : int) : IntPtr
Description描述
Construct a new primitive array object.构造一个新的基本数组对象。
96、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。
97、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() 获得,且调用时的方法名必须为 ,而返回类型必须为 void (V)。
clazz 参数务必不要引用数组类。
98、AndroidJNI.NewShortArray 新建短整数数组
static function NewShortArray (size : int) : IntPtr
Description描述
Construct a new primitive array object.
构造一个新的基本数组对象。
99、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 对象。
100、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来高效地管理局部引用。
101、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来高效地管理局部引用。
102、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时。
103、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.
这个函数设置一个对象实例(非静态)域的值。
104、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时。
106、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.
这个函数设置一个对象实例(非静态)域的值。
107、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时。
108、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.
这个函数设置一个对象实例(非静态)域的值。
109、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时。
110、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.
这个函数设置一个对象实例(非静态)域的值。
111、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时。
112、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.
这个函数设置一个对象实例(非静态)域的值。
113、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时。
114、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.
这个函数设置一个对象实例(非静态)域的值。
115、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时。
116、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.
这个函数设置一个对象实例(非静态)域的值。
117、AndroidJNI.SetObjectArrayElement 设置对象数组元素
static function SetObjectArrayElement (array : IntPtr, index : int, obj : IntPtr) : void
Description描述
Sets an element of an Object array.
设置一个对象数组的一个元素。
118、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的引用,或者其子类。
119、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时。
120、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.
这个函数设置一个对象实例(非静态)域的值。
121、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.
这个函数设置一个对象的静态域的值。
122、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.
这个函数设置一个对象的静态域的值。
123、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.
这个函数设置一个对象的静态域的值。
124、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.
这个函数设置一个对象的静态域的值。
125、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.
这个函数设置一个对象的静态域的值。
126、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.
这个函数设置一个对象的静态域的值。
127、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.
这个函数设置一个对象的静态域的值。
128、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的引用,或是其子类。
129、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.
这个函数设置一个对象的静态域的值。
130、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(),但执行需要字符串的值编组。
131、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(),但执行字符串的值需要编组。
132、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 指定)构造异常对象并抛出该异常。
133、AndroidJNI.Throw 抛出
static function Throw (obj : IntPtr) : int
Description描述
Causes a java.lang.Throwable object to be thrown.
导致一个java.lang.Throwable的对象被抛出。
134、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布尔数组。
135、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的字节数组。
136、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的字符数组。
137、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的双精度浮点数数组。
138、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的浮点数数组。
139、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的整数数组。
140、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的长整数数组。
141、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数组。
142、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对象。
143、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对象。
144、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的短整数数组。 -
JNI 调用的步骤
2016-11-19 19:06:48JNI -
android jni (jni_onload方式)
2020-12-27 18:03:53JNI(Java Native Interface),Java本地接口,是为方便java调用C或者C++等本地代码所封装的一层接口。由于Java的跨平台性导致本地交互能力不好,一些和操作系统相关的特性Java无法完成,于是Java提供了JNI专门用于... -
Android JNI
2017-06-10 18:45:22什么是JNI,Java Native Interface ,Java 本地调用。Java 虽然具有跨平台的特性,但是Java和具体的平台之间的隔离是通过JNI层来实现的,Android 中 Java 通过 JNI 层调用 Linux 中的接口来实现对应的功能。JNI 层... -
【我的Android进阶之旅】Android调用JNI出错 java.lang.UnsatisfiedLinkError: No implementation found ...
2016-11-01 17:07:02今天使用第三方的so库时候,调用JNI方法时出现了错误。报错如下所示: 11-01 16:39:20.979 4669-4669/... -
JNI基础:JNI数据类型和类型描述符
2018-07-03 15:57:37在 JNI 开发中,我们知道,Java 的数据类型并不是直接在 JNI 里使用的,例如 int 就是使用 jint 来表示。 那么,就如我们来认识一下这些数据类型吧。 二、基本数据类型 Java数据类型 JNI... -
Android底层调用C代码(JNI实现)
2017-08-05 12:51:09Android底层调用C代码(JNI实现) 一、基础知识 二、从Android框架角度简单分析JNI 三、标准JNI实现步骤 四、实现JNI过程实例 一、基础知识 1、JNI:百度百科中解释:JNI是Java Native Interface的缩写,它... -
认识JNI
2013-11-10 22:52:16什么是JNI JNI全称为java native interface,Java本地开发接口,JNI是一个协议,这个协议可以用来沟通Java代码和本地的c/c++代码 让两者可以相互的调用 为什么用JNI JNI扩展了Java虚拟机的... -
JNI_OnLoad 与 JNI_OnUnload
2018-06-12 10:50:11JNI_OnLoad Dalvik虚拟机加载C库时,第一件事是调用JNI_OnLoad()函数,所以在JNI_OnLoad()里面进行一些初始化工作,如注册JNI函数等等。注册本地函数,可以加快java层调用本地函数的效率。 JNIEXPORT jint JNI_... -
JNI入门——hello jni
2017-03-18 16:17:01JNI(Java Native Interface,Java本地接口),实现了Java和其他语言的交互(主要是C/C++)。 -
JNI/NDK入门指南之JNI访问数组
2019-12-23 18:03:19JNI/NDK入门指南之JNI访问数组 在前面的章节JNI/NDK入门指南之JNI字符串处理中讲解了JNI对字符串的处理流程。今天我们继续向JNI的知识海洋进军讲解JNI对数组的处理。本章内容有点多哦! ... -
JNI_OnLoad和JNI_OnUnload
2018-04-24 15:54:29JNI_OnLoad和JNI_OnUnload 一、引用官方文档:https://docs.oracle.com/javase/7/docs/technotes/guides/jni/spec/invocation.html#library_versionJNI_OnLoadjint JNI_OnLoad(JavaVM *vm, void *reserved);... -
最详细的jni教程
2013-02-04 10:44:29最详细的Java jni教程 不是 最全的jni教程,但绝对是 史上最详细的Java jni教程。 菜鸟 能看懂的 java jni教程 非常经典的java jni教程 手把手教你的jni教程 包含 教程doc文档说明,java源码,C/C++源码 -
JNI开发之JNI常见错误
2017-05-20 12:20:52在上一篇文章中对JNI原理进行了介绍,这篇文章将对JNI开发中的一些常见错误进行总结一下。 一、常见错误原因分析 在JNI开发中,经常会遇到各种各样的错误,这里总结一下: find Library returned null 原因... -
JNI/NDK入门指南之JNI字符串处理
2019-12-19 09:54:45JNI/NDK开发指南之JNI字符串处理 在前面的章节JNI/NDK开发指南之JNI数据类型,描述符详解中我们了解了JNI能处理的基本类型,细心的读者会发现这其中不包括字符串。那么今天我们要重点讲解的... -
Android JNI编程—JNI基础
2017-02-04 15:29:11什么是JNI,怎么使用 JNI——Java Native Interface,它是...其实主要是定义了一些JNI函数,让开发者可以通过调用这些函数实现Java代码调用C/C++的代码,C/C++的代码也可以调用Java的代码,这样就可以发挥各 -
JNI调用机制与JNI实现
2015-08-04 17:04:06JNI调用机制JNI第一篇 此文是JNI的第二篇博客,我在之前的博客里写过如何实现一个基本的JNI,这篇文章是上一篇的升级版,详细解释了各种参数和实现方式,所以,在阅读此文前,请先看下如何实现一个基本的JNI调用,... -
Java JNI编程资料(JNI官方教程 官方文档等)
2011-07-19 17:50:04解压后,有4个JNI资料,如下: JNI Specification.CHM JNI 简介与实现.pdf JNI编程指南.pdf JNI程序员指南与规范.pdf -
Hello JNI
2016-09-18 18:49:12根据上一篇,这里写一个简单demo工程目录结构JniDemopackage com.test.git.jnidemo.JniUtil;...public class JniDemo { //路径:/JNIDemo/app/build/intermediates/classes/debug/com/test/git/jnide -
JNI 深入讲解
2018-05-01 22:24:13所以上层Java要调用底层的C/C++函数库必须通过Java的JNI来实现。实际上我们不鼓励使用JNI,除非必须使用。因为一旦使用JNI,JAVA程序就丧失了JAVA平台的两个优点:1、程序不再跨平台。要想跨平台,必须在不同的系统.... -
JNI学习笔记:第一个JNI程序
2018-03-19 21:10:001. 什么是JNI? 1.1 JNI简介 1.2 JNI的角色 2. 为什么要用JNI? 2.1 JNI的作用 2.2 JNI的副作用 3. 第一个JNI程序 :A+B 3.1 开发环境 3.2 程序流程 3.3 Java代码 3.4 C++代码 4. 参考文献 1. 什么是... -
JNI开发之JNI内存泄露
2017-05-20 12:27:52在上篇文章中介绍了JNI开发中遇到的常见错误,这篇文章将描述JNI开发中内存泄露问题。在Java编程中,内存泄漏可以根据泄漏的内存位置划分为两种:一种是JVM中的Java Heap的内存泄漏。另外一种是JVM中的Native memory...
-
XD、PS制作轻拟物界面
-
电气符号总集大全.zip
-
(Wpf)如何给TabControl选项卡TabItem添加图片
-
Excel高级图表技巧
-
const
-
1.20学习博客
-
M8E8连接设定.pdf
-
排序算法总结(比较类排序算法)
-
软件学院保研学校整合.docx
-
three.js入门速成
-
数据类型转换、运算符、方法入门
-
【数据分析-随到随学】SPSS调查问卷统计分析
-
河南大学软件学院软件体系结构期末考试重点.docx
-
RabbitMQ消息中间件实战(附讲义和源码)
-
【数据分析-随到随学】Python数据获取
-
ClashX.1.30.1.dmg
-
com.alibaba.fastjson.JSONArray cannot be cast to com.alibaba.fastjson.JSONObject
-
ProBuilder快速原型开发技术
-
镜像
-
Hibernate-Validator-6.2.0中文参考文档.pdf