How do I check Internet connection on Android (Crosswalk)?

Get help using Construct 2

Post » Wed May 25, 2016 8:37 am

I've been trying to use the browser "Is online" function and getting back unreliable results. It well say online for a while and then it will say offline even when I am connected. The same is true when I put the device into Airplane Mode, completely unpredictable. I have tested this on 2 different devices so I'm pretty sure it is not a hardware thing. Would really appreciate help, this is the only thing stopping me from publishing my game. :cry:
B
6
S
3
Posts: 7
Reputation: 604

Post » Wed May 25, 2016 7:05 pm

On further testing it seems that completely unrelated events toggle this. Is this a bug?
B
6
S
3
Posts: 7
Reputation: 604

Post » Wed May 25, 2016 8:00 pm

When I preview over wifi on android I get
"Javascript Error!
Uncaught TypeError: Cannot read property 'connect' of undefined http://.../cws-buy.js line 1 (col 282)
"

I have 2 third party plugins installed but everything was working fine before and I havent changed anything that is related to them.
I only get this error on Android devices. PC and iOS works fine. It also works when exported to Android (however I get unpredictable results using the Browser plugin to detect internet connection as stated above)
I havent had any luck reproducing this in a simpler capx yet.
B
6
S
3
Posts: 7
Reputation: 604

Post » Fri Sep 16, 2016 4:14 am

Guys Please Help me. Im now using the Admob for my app.

I just want to know how can I test if my app connected to the internet.
B
13
S
4
Posts: 5
Reputation: 839

Post » Fri Sep 16, 2016 11:51 am

@dhalvin
@mikegranger

Browser action "is online" work fine on windows, but for android and ios I use cranberrygame's plugin (CordovaNetworkInfo) from plugins-construct2-cordova-plugins_t109586
B
11
S
3
Posts: 111
Reputation: 1,401

Post » Fri Sep 16, 2016 3:31 pm

@dhalvin

Thank you for your reply. Very much appreciated.
Im now using admob. My ads only appear when connected to the internet before the layout start.
Every time I restart my app with no internet connection i has no ads (like what I expected) but when I turned on the internet the ads does not appear. I try already the Browser action "is online" to preload the banner ad but its not working.
B
13
S
4
Posts: 5
Reputation: 839


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 8 guests