Page 1 of 2

how to check internet connection

Posted: Fri Jun 14, 2013 6:36 am
by rammohan.acharyadasa

Hi
How to check internet connection using appery.io

Thanks,
Ram


how to check internet connection

Posted: Fri Jun 14, 2013 6:40 am
by Kateryna Grynko

Hi Ram,

There are "online" and "offline" events in Phonegap/Cordova:
http://docs.phonegap.com/en/1.0.0/pho...


how to check internet connection

Posted: Fri Jun 14, 2013 6:44 am
by John5766500

Does something exist to tell whether the "online" connection is WIFI or not?


how to check internet connection

Posted: Fri Jun 14, 2013 7:18 am
by Kateryna Grynko

Hi John,

Modern mobile OS do not consider connection type to be important. Android 4 has a permission to check Wi-Fi connection (ACCESSS_WIFI_STATE in Appery.io)

http://cordova.apache.org/docs/en/2.4...


how to check internet connection

Posted: Fri Jun 14, 2013 7:19 am
by Kateryna Grynko

Screens in Appery.io builder have Online and Offline Cordova events.
You can write code that saves flag in local storage if there is an Internet connection available.


how to check internet connection

Posted: Fri Jun 14, 2013 7:27 am
by John5766500

Hi Katya,

The OS might not care, but unfortunately, the accounts departments do ;)

Looking at the link it appears iOS only returms "Connection.CELL_2G" for all cellular data, wifi or not where as Andriod 4 I can confirm its wifi.

Thanks

John.


how to check internet connection

Posted: Fri Jun 14, 2013 9:44 am
by John5766500
  • Its fine I've tested the code on iOS and I can get status of 2g or WIFI. That's good enough for me ;)

    Sorry for hijacking your thread Ram.


how to check internet connection

Posted: Fri Jun 14, 2013 9:46 am
by Kateryna Grynko

Glad it helped :)


how to check internet connection

Posted: Tue Aug 05, 2014 8:05 am
by Michal

Hi

As stated above "Screens in Appery.io builder have Online and Offline Cordova events" which works fine upon switching Internet on/off. But how can I know if the Internet connection is available when the user opens the app for the first time (and Internet is already either on or off)? Is there any way to read it?

Michal


how to check internet connection

Posted: Tue Aug 05, 2014 9:14 am
by Maryna Brodina

Hello!

Please take a look here http://cordova.apache.org/docs/en/3.3...