Android NDK - How to print log in logCat

1.Add "LOCAL_LDLIBS := -llog" into android.mk

2.#include

3.

char myString[100];
sprintf(myString, "%d", need_len);
__android_log_write(ANDROID_LOG_DEBUG,"need_len",myString);

转载于:https://www.cnblogs.com/ezhozhe/p/3160793.html

你可能感兴趣的:(移动开发)