Playmaker Forum
PlayMaker Help & Tips => Android Help => Topic started by: djaydino on April 23, 2015, 10:55:35 PM
-
Check internet does not seem to work very well on android device :
when i am offline from a fresh restart it gives offline correctly,
then i go online and start the game and it gives online correctly.
but then when i disconnect the internet and start the game again it still gives online as result... i tried editing the url, changed it to my own website, but gives the same result....
greetings,
Dino
Modify message
-
Hi,
Where did you get this action?
typically, you need to bypass the cache ( which is likely the issue), and so everytime you check, the url you use to access internet and check the result must be different always.
this is done by appending a dummy url variable like &time=123123
where 123123 is the current time, and so you won't hit any caching issue.
Bye,
Jean
-
this code works better for me.
try
{
//Dns.GetHostEntry("www.google.com");
using (var client = new WebClient())
{
using (var stream = client.OpenRead("http://www.google.com"))
{
Fsm.Event(internetIsOn);
}
}
Finish();
}
catch
{
Fsm.Event(internetIsOff);
Finish();
}