Dear Michael,
Thanks for your reply.
Actually in order to run .CPP files using Android NDK, I modified
hello-jni sample code. I have created hello-jni.cpp(just as actual
hello-jni.c) file. I also added .CPP file to LOCAL_SRC_FILES in
Android.mk, but I think there is some problem with my hello-jni.cpp
file.
--------------------------------------
My Android.mk file is as follows:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := hello-jni
LOCAL_SRC_FILES := hello-jni.cpp
include $(BUILD_SHARED_LIBRARY)
-------------------------------------
My hello-jni.cpp is as follows:
#include <string.h>
#include <jni.h>
extern "C"{
JNIEXPORT jstring JNICALL
Java_com_example_hellojni_HelloJni_stringFromJNI( JNIEnv* env, jobject
thiz );
};
JNIEXPORT jstring JNICALL
Java_com_example_hellojni_HelloJni_stringFromJNI( JNIEnv* env, jobject
thiz )
{
return (env)->NewStringUTF(env, "Hello from JNI !");
}
---------------------------------------
I am trying to make same application as hello-jni sample but instead
of .C file, I am using .CPP file. Please tell me what changes are
needed to run this hello-jni code to run with hello-jni.CPP file.
Regards,
Atul Prakash Singh
On Apr 19, 12:39 pm, mic _ <
micol...@gmail.com> wrote:
> >>I think OpenGL 2.0 is not supported on Android emulator yet, thats why
> >>hello-gl2 sample is not running on Android emulator.
>
> Yes, it's not supported. It seems like it's the intention of the Android
> team to support it eventually, but there's no timeplan for it that I know
> of.
>
> >>I also want to run .CPP files using Android NDK
>
> There's nothing to it. Just add it to your LOCAL_SRC_FILES in Android.mk.
> Keep in mind that you'll have to make your JNIEXPORT functions extern "C",
> or they won't be found when you load the library.
>
> /Michael
>