Pass variable from AndroidHarness to the Game

Hi. Can you help me how to pass a variable from android harness activity to the game app?
My scenario is as follows: User starts the game then after button click he jumps to another activity which returns a result. I can read the result in the activity, but I don’t know how can I read it from the game.

It would be nice if you could give me some code example.
I am new to jMonkeyEngine, but I’ve read tutorials and a lot from documentation and probably I can solve my problem with some mechanism of enqueue callable, listeners or AppStates, but I dont know how to use that in my case.

Thanks in advance for help

In that direction it’s pretty easy.
The harness has a reference to the application names “app”
implement a doStuff method in your app
Then you just have to cast app to your app class name and call the doStuff method on it.

1 Like