I am using Android-sdk-ndk in an Eclipse+ADT environment. In Android-sdk Java development, I could use “Log.i”, “Log.w”, … statements to output messages and variable contents to the “LogCat” window. However, in Android-ndk C/C++ development, is there any similar C/C++ “print-like” statement that outputs messages / variable contents from a JNI C/C++ module to the “LogCat” window so that I could have some debug informations for my program.
Thanks for any suggestion.
Lawrence
From this guide: http://www.srombauts.fr/2011/03/06/standalone-toolchain/
You can #define the logging methods like this:
And you need to make sure you’re linking to liblog by compiling similar to this (just add
-l log):