rammohan.acharyadasa
Posts: 0
Joined: Thu Apr 05, 2012 5:03 pm

how to check internet connection

Hi
How to check internet connection using appery.io

Thanks,
Ram

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

how to check internet connection

Hi Ram,

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

John5766500
Posts: 0
Joined: Wed Apr 17, 2013 2:07 pm

how to check internet connection

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

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

how to check internet connection

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...

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

how to check internet connection

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.

John5766500
Posts: 0
Joined: Wed Apr 17, 2013 2:07 pm

how to check internet connection

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.

John5766500
Posts: 0
Joined: Wed Apr 17, 2013 2:07 pm

how to check internet connection

  • 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.

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

how to check internet connection

Glad it helped :)

Michal
Posts: 0
Joined: Tue Jun 24, 2014 11:47 am

how to check internet connection

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

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

how to check internet connection

Hello!

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

Return to “Issues”