• Advertisement
Sign in to follow this  

Javah problems with class that extends Activity

This topic is 1777 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey guys, I'm currently trying to write hello-jni but in my own code and projects to get an idea of the flow of getting an android app working.

I've setup my make file, my source file, got it all compiling. But I get an unsatisfied link error when I try to run the app. So I take a look around and see that I need to run the javah to create a .h file that will forward declare my function and avoid name mangling.

So I setup an external tool in Eclipse using this guide, and it seems to work fine, except I get an error saying

"Error: cannot access android.app.Activity

  class file for android.app.Activity not found"

From what searching I've done it's because it can't find the android.jar in the sdk directory, but how to I provide it properly? Or is that what is actually being looked for? 

I'm so close to getting this to work haha.

Share this post


Link to post
Share on other sites
Advertisement

Since no one is responding, I'll try a different question; is javah really necessary? It seems like I should be able to resolve the name mangling myself. And I never had to run it on hello-jni, though I imagine it's only because the name mangling isn't an issue in C.

Has anyone done any C++ development in Android using JNI?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement