Anybody have one example of a android project using a same time C++ and Java together, for example, one normal android project build on eclipse and in there add a cpp class and using this cpp class on java class…
say I have a class Foo on C++
class Foo{
...
}
and I have a class MyActivity on Java
public class MyActivity extends Activity{
...
}
how to i instance the Foo class on MyActivity class?…
thanks a lot for all.
First you have to make a .so of you c++ classes with build_ndk.sh
On the C++ side you have to declare your JNI methods
On the java side
Then use the function as you would do in java.
You should take a look at this nice tutorial