目的:

jni中(c++函数)一个 char buf[4] 如何通过env->CallVoidMethod(clazz,method_OnFindCards,jStringParam); 在app上显示出来

比如:

//获得Java层的回调函数
jclass mClazz = env->FindClass("com/android/server/RfidReaderService");
LOGI("the mClazz is obtained from the jobject clazz");
method_OnFindCards = env->GetMethodID(mClazz, "onFindCards","(Ljava/lang/String;)V");
if (method_OnFindCards== NULL)
{
LOGI("Fail to find method onFindCards");

}
LOGI("the method_OnFindCards is obtained ok!");
//(1)执行寻卡操作:

//(2)找到卡后,调用Java层的回调函数: cardNumber是一个jstring类型的字符串
jstring jStringParam = env->NewStringUTF("this is the value from the calling in the close reader in jni");
env->CallVoidMethod(clazz,method_OnFindCards,jStringParam);

在app上可以显示“this is the value from the calling in the close reader in jni”,,如何把buf中数据替换到该位置,同样在APP显示出来。虚心请教

最新文章

  1. 【BZOJ2157】旅游 LCT
  2. Makefile编译库
  3. SQLProfiler_SQL抓包
  4. S2--《优化MySchool数据库设计》总结
  5. 【T_SQL】 基础 视图、存储过程、触发器
  6. wordpress内存不足问题“Fatal error:out of memoryin etc...”
  7. 阿里DNS
  8. QTREE3 spoj 2798. Query on a tree again! 树链剖分+线段树
  9. mysql生成随机测试数据
  10. Link-Cut-Tree题目泛做(为了对应自己的课件)
  11. VS2012+SQL2008+ODBC编程,第一篇博客,写的不好忘各位大神指点一二~
  12. [原]Escape From the iOS Sanbox on Jailbreak Device
  13. SRM 592 DIV2 报告
  14. python并发编程之多线程
  15. Axios发送AJAX请求
  16. 关于 Abp 替换了 DryIoc 框架之后的问题
  17. springboot读取properties(yml)的几种常用方式
  18. 把Excel转换成DataTable,Excel2003+
  19. 结合order by 解CTF某题
  20. 获取String类型汉字乱码,如何进行编码

热门文章

  1. ###《Machine Learning》by Andrew NG
  2. android 权限总结
  3. 【制作镜像Win*】系统配置
  4. 九度OJ 1499 项目安排 -- 动态规划
  5. 教了几天C语言 C语言竞赛------家长们你们为什么这么急!!
  6. laravel1
  7. ubuntu u盘安装
  8. python实用函数
  9. poj 2796 Feel Good 单调栈区间问题
  10. 2014年度辛星html教程夏季版第五节