我想通过将日志消息插入 logcat 来调试 JNI C 应用程序。执行此操作的 C API 是什么?
最佳答案
像这样:
#include <android/log.h>
__android_log_write(ANDROID_LOG_ERROR, "Tag", "Error here");//Or ANDROID_LOG_INFO, ...
像这样将它添加到你的makefile中:
LOCAL_LDLIBS := -L$(SYSROOT)/usr/lib -llog
关于android - 从 Android JNI 程序调用的 Log API 是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5465941/