1.在Android.mk中加上

LOCAL_LDLIBS += -llog

2.在.c文件中

#include "android/log.h"static const char *TAG="serial_port";#define LOGI(fmt, args...) __android_log_print(ANDROID_LOG_INFO,  TAG, fmt, ##args)#define LOGD(fmt, args...) __android_log_print(ANDROID_LOG_DEBUG, TAG, fmt, ##args)#define LOGE(fmt, args...) __android_log_print(ANDROID_LOG_ERROR, TAG, fmt, ##args)

这样就可以在jni调试中打印出信息了。

更多相关文章

  1. NPM 和webpack 的基础使用
  2. 【阿里云镜像】使用阿里巴巴DNS镜像源——DNS配置教程
  3. Android平板电脑不能全屏显示的问题
  4. 三行代码去Android(安卓)USB ADB调试确认对话框
  5. Android中xml文件读写
  6. android中的Inflater
  7. Android中Manifest.xml配置文件
  8. android之layout配置文件解读
  9. android 从tomcat读取文件出错:connect failed: ECONNREFUSED

随机推荐

  1. android 多媒体
  2. Android的线程使用来更新UI----Thread、H
  3. Android之Activity组件
  4. Android(安卓)JNI开发工具篇(1)-开发环境
  5. Android虚拟键盘弹出时挡住EditText解决
  6. Android:用DialogFragment实现LoadingDial
  7. Android(安卓)Service总结04 之被绑定的
  8. Android(安卓)aapt 工具介绍
  9. Android的开发配置篇(linux平台)
  10. Android(安卓)Bundle类