android平台JNI打印数据

Scroll Down

头文件引用

#include <android/log.h>
#define LOG_TAG "android_printf"

//日志等级
//ANDROID_LOG_DEBUG
//ANDROID_LOG_INFO  
//ANDROID_LOG_WARN  
//ANDROID_LOG_ERROR 
#define  LOGEE(...)  __android_log_print(ANDROID_LOG_INFO,LOG_TAG ,__VA_ARGS__)

#在CmakeLists.txt中添加
find_library( # Sets the name of the path variable.
              log-lib
	
              # Specifies the name of the NDK library that
              # you want CMake to locate.
              log )

target_link_libraries( # Specifies the target library.
                       native-lib

                       # Links the target library to the log library
                       # included in the NDK.
                       ${log-lib} )