Help regarding Android NDK
- by Siva Kumar
I am a beginner in using Android NDK.
I am using Eclipse and I installed cygwin to build the c file to generate the .so file
But while building the c file in cygwin I am always getting the error
make: ***No rule to make target 'file.c' ... .Stop
I tried building different C codes but for every file it says the same error ..
Here is the source code:
public class ndktest extends Activity
{
static {
System.loadLibrary("ndkt");
}
private native void helloLog(String logThis);
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
helloLog("this is to test log file");
} }
file.c
void Java_com_ndktest_helloLog(JNIEnv * env, jobject this, jstring logThis)
{
jboolean isCopy;
const char * szLogThis = (*env)->GetStringUTFChars(env, logThis, &isCopy);
(*env)->ReleaseStringUTFChars(env, logThis, szLogThis);
}
And here is my Android.mk
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_LDLIBS := -llog
LOCAL_MODULE := ndkt
LOCAL_SRC_FILES := file.c
include $(BUILD_SHARED_LIBRARY)
I searched for the solution for the cause of error ... but nothing works for me.
Can anyone tell me where I am making the mistake ?
Thanks,
Siva Kumar