How to call a function in android using cocos2d-x?

Good day to all!

How can I use a function I created in android using cocos2d-x? I have a getCountry function in my
Cocos2dxActivity.java that returns a string. How can I get the return value in android and show it
on my cocos2d-x scene?

Cocos2dxActivity.java

public static String getCountry(String codes){ String locale = context.getResources().getConfiguration().locale.getDisplayCountry(); return locale; }

CCApplication.cpp

void CCApplication::getCurrentCountry(){ //What to put here? :( }

MyScene.cpp

void MyScene::getMyLocation(){ string myLocation = CCApplication::sharedApplication()->getCurrentCountry(); CCLog(myLocation.c_str()); }

Thanks in advance! any help is appreciated! :slight_smile:

http://www.cocos2d-x.org/projects/cocos2d-x/wiki/Scripting_and_Translating_between_Programming_Languages