아래순서대로 고대로 따라했습니다....근데...

make명령어를 쓰면
Android NDK: The APP variable is undefined or empty.
Android NDK: Please define it to one of:
Android NDK: You can also add new apllications by writing an Application.mk file.
Android NDK: See docs/Application-mk.txt for details.
build/core/main.mk:71: *** Android NDK: Aborting . stop.

이라는 오류메세지가 나오고요..

ndk-build 명령어를 사용하면
Android NDK: Your APP_BUILD_SCRIPT points to an unknown file: /home/Administrator/android-ndk-r4b/samples/NdkExample/jni/Android.mk
/home/administrator/android-ndk-r4b/build/core/add-application.mk:98: ***Android NDK: Aborting... .Stop.

이라는 오류 메세지가 나옴니다...

도대체 무엇이 잘 못된건가요?

제발좀 도와주세요...jni만드는것 자체가 넘 힘들어요...ㅠㅠ


1. make a new 'NdkExample' project under the 'ndk-root/apps' folder.


2. make a JNI java file(class) for wrapping.


public class NdkExample {
   
static {
        System.loadLibrary("NdkExample");
    }

    public native String stringFromJni();
}







3. make a 'Application.mk' file under the 'ndk-root/apps/NdkExample' folder.


APP_PROJECT_PATH := $(call my-dir)/project
APP_MODULES := NdkExample




4. make a 'NdkExample/project' and make 'jni' and 'libs' folder under the 'project' folder.




5. make a 'Android.mk' file under the 'jni' folder.


LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := NdkExample
LOCAL_SRC_FILES := NdkExample.c
include $(BUILD_SHARED_LIBRARY)




6. move to 'NdkExample/bin' folder and make a header file from the 'NdkExample.class' file


javah com.example.NdkExample



7. move the header file to 'NdkExample/project/jni' folder and rename to 'NdkExample.h' for using easier.



8. make a 'NdkExample.c' file under the 'NdkExample/project/jni' folder.


#include "NdkExample.h"
#include <string.h>

jstring Java_com_example_NdkExample_stringFromJni(JNIEnv *env, jobject thiz)
{
    return (*env)->NewStringUTF(env, "Hello world from native code.");
}



9. compile the project under the 'ndk-root' folder.


make APP=NdkExample