工作记录:
1、 首先在相应的cpp代码中添加函数,如下
|
static JNINativeMethod gMethods[] = { { "getDisplayMode", "()I", (void*)android_view_Display_getDisplayMode } };
|
其中I为int参数,()外的V为返回值。
2. 在相应的java中,增加java调用接口
路径选择要在相应的代码路径下,如:framewors/base/core/jin/中增加,就要在frameworks/base/core/java/中填加
|
/** * test program */ native public int getDisplayMode();
|
3. 最后make update api,结束
阅读(2404) | 评论(1) | 转发(0) |