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!