Issue
Since It's pretty hard to debug native android code, I'm going to the "printf trace" approach.
So, my question is, in a native code, wheres the standards "printf("something")" appears when running a Android application?
Solution
Log to logcat.
1) To invoke the logger in native code include the header and call _android_log_write(..).
#include <android/log.h>
__android_log_write(ANDROID_LOG_INFO, "tag here", "message here");
2) In your Android.mk file include the log lib like this.
LOCAL_LDLIBS := -L$(SYSROOT)/usr/lib -llog
Answered By - Ryan Reeves
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.