Monday, 15 March 2010

java - how to check network connection status in libgdx with robovm? -



java - how to check network connection status in libgdx with robovm? -

according website https://github.com/libgdx/libgdx/wiki/admob-in-libgdx

i know how add together admob banner in libgdx game through robovm, , worked!

everything works fine when iphone connected either wifi or grps. when turn off wifi , grps, game quit after splash screen. because initializeads function not connected either wifi or gprs.

in objc there file named connection.h check whether gprs or wifi connected. after that, can initialize admob banner according status.

is there way check connection status robovm or there way avoid crash?

thanks!

just write simple function on java, ping google.com , homecoming true/false. utilize send request:

gdx.net.sendhttprequest(httprequest httprequest, httpresponselistener httpresponselistener);

than check in httpresponselistener if got respond (there net connection) if have error (there not).

p.s android add together manifest:

<uses-permission android:name="android.permission.internet" />

java ios libgdx robovm

No comments:

Post a Comment