Android: How to call call ndk function from AsyncTask?

Posted by user1628803 on Stack Overflow See other posts from Stack Overflow or by user1628803
Published on 2012-11-29T21:14:57Z Indexed on 2012/12/02 11:05 UTC
Read the original article Hit count: 592

I have a lot of jni calls in my Android projects which work like a charm but this one I just can't get right: When trying to call a jni function from an AsyncTask in Android I get this error message:

11-30 10:07:20.130: W/dalvikvm(16555): No implementation found for native Lcom/company/MainView$MyAsyncTask;.MyFunction (Ljava/lang/String;)Z

When usually the jni function declaration works like this:

JNIEXPORT jboolean JNICALL Java_com_company_MainView_myFunction()...

how would i declare it when calling from an AscnyTask? I didn't find the answer on Google and I have unsuccessfully tried:

JNIEXPORT jboolean JNICALL Java_com_company_MainView$MyAsyncTask_myFunction()

and

JNIEXPORT jboolean JNICALL Java_com_company_MainView_MyAsyncTask_myFunction()

Or is this not possible at all?

© Stack Overflow or respective owner

Related posts about android-ndk

Related posts about android-asynctask