Communicating with Android activity

Communicating with Android activity
0.0 0


Hi all. We’ve downloaded the sample project and got it up and running on android, with no problems.

The next thing we need to work out is how the Cocos code communicates with the enclosing Android project?

How can I send a message from the C++ code which ultimately means I can _doSomething()_ in java?

Many thanks for any help.


I think you can look how cocosdension is implemented on Android platform.


Minggo, I think we can write a wiki page describing how to invoke java methods from c++ via JNI, just write the contents of your lecture in ShangHai.
This question is asked too frequently.


I will try my best.


Thank you for your responses.

We actually figured it out, using this guide (which you’re probably already aware of):

I hope this helps someone else!