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?
The Native Development Kit (NDK) is a set of tools that allows you to use C and C++ code with Android, and provides platform libraries you can use to manage native activities and access physical device components, such as sensors and touch input.
Bionic is an implementation of the standard C library, developed by Google for its Android operating system.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With