MLProgrammer-CiM
MLProgrammer-CiM

Reputation: 17257

Where can I learn the usage of JNI functions?

I am working on an Android project using C++ for the main development and I am trying to implement OpenFeint. I need to call several non-static Java methods and instantiate a couple of classes in my C++ code, and for that I need to learn how to properly use JNI functions.

Where can I find some comprehensive documentation or tutorial on the matter? What I have found so far in Sun's site is incomplete or lackluster, and does not even have the class-method reference.

Upvotes: 0

Views: 657

Answers (5)

reuf
reuf

Reputation: 550

IBM has an excellent step by step tutorial for JNI After you cover it you will feel confident in utilizing JNI.

Besides that I also recommend JNI tutorial on Youtube

Upvotes: 1

bobby
bobby

Reputation: 2789

I have always found the JNI Programmer's guide to be very useful.
Other than that if you post your questions more directly am sure SO will help. And specifically this section might help

Upvotes: 2

josefx
josefx

Reputation: 15656

Not sure how much of it applies to android, but the official jni specification is here. The members of jniEnv are listed as c functions, in c++ the first parameter (jniEnv) falls away.

Upvotes: 2

mkaes
mkaes

Reputation: 14119

Unfortunately there is not much good documentation about the JNI.

But you can have a look here. What you need is maybe creation and of course invocation.

Upvotes: 0

Andrew Fielden
Andrew Fielden

Reputation: 3899

Is this any good?

Calling Java methods from C/C++

Upvotes: 0

Related Questions