Tutorial by Examples

project/jni/main.c #include <stdio.h> #include <unistd.h> int main(void) { printf("Hello world!\n"); return 0; } project/jni/Android.mk LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := hello_world LOCAL_SRC_FILES := main.c include $(BU...
If you need to clean the build: ndk-build clean
ndk-build NDK_PROJECT_PATH=PROJECT_PATH APP_BUILD_SCRIPT=MyAndroid.mk
First make sure you link against the logging library in your Android.mk file: LOCAL_LDLIBS := -llog Then use one of the following __android_log_print() calls: #include <android/log.h> #define TAG "MY LOG" __android_log_print(ANDROID_LOG_VERBOSE, TAG, "The valu...

Page 1 of 1