Hi guys, I involved UIWebView code from this page( http://www.cocos2d-x.org/boards/6/topics/4450?r=9923#message-9923) , it’s working well on IOS, now I want transfer it to android, the process of build native is ok, but I cannot got any UI in android and have not got any error information also, like freeze.
Would you please give me some advices about my issue? Did I use it like the following code is right? Many thanks.
1. Used it as following code.
@ #if (CC_TARGET_PLATFORM CC_PLATFORM_ANDROID)
init();
updateURL(“close”); #else
web = new LayerWebView();
web->init();
web->updateURL(url.c_str());
float rate=getCC_DESIGN_W()/size.width;
web->setSize(size.width, size.height-bgButton->getContentSize().height/rate);
addChild(web,2); #endif
@
*2. Added two function in your code as following code.*
@
void updateURL(const char * url);
void setSize(float width,float height);
@
Did you check if pointers are not NULL? I don’t see your JVM in the code, you cannot take it from one part in the code and re-use in other, you must take it every function is going to use it.
No JNI_OnLoad found in; is not essential, you code must run without it. IT appear like in some zone, your code stay waiting for something and you get an App freeze timeout. What functions are you calling before your app is freeze? Put more CCLogs to check what steps work, and when it stop.