Android NDK Log
Android has log class named Log. In case of Android NDK, we can’t use cout, prinf of native C print code for log(DDMS).
To use DDMS log, we need a bit operation.
1. Link liblog.so(Change Android.mk)
2. Add __android_log_print for log
1. Link liblog.so(Add description of LINK)
LOCAL_LDLIBS := -llog
liblog.so isn’t linked by default. We need add linker option
2. Add log code in Native codes
#include <android/log.h> __android_log_print(ANDROID_LOG_DEBUG,"Tag","Hello %d",10);
ANDROID_LOG_DEBUG is level, that is same as Log.xxx of Android SDK.
- ANDROID_LOG_VERBOSE
- ANDROID_LOG_DEBUG
- ANDROID_LOG_INFO
- ANDROID_LOG_WARN
- ANDROID_LOG_ERROR
- ANDROID_LOG_FATAL
Terrific work! This is the type of info that should be shared around the web. Shame on the search engines for not positioning this post higher! Come on over and visit my site . Thanks =)
I just want to tell you that I am newbie to blogging and seriously liked this web-site. Very likely I’m want to bookmark your blog post . You certainly come with really good articles. Bless you for sharing with us your blog.
I simply want to tell you that I am beginner to blogging and honestly liked your web page. Very likely I’m planning to bookmark your blog post . You definitely have terrific article content. With thanks for revealing your webpage.