cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joe Bowser (JIRA)" <>
Subject [jira] [Commented] (CB-77) Connection reported as Connection.NONE
Date Thu, 10 May 2012 17:08:51 GMT


Joe Bowser commented on CB-77:

Please open a new bug and provide details on the device.  It's entirely possible that your
device doesn't detect connectivity properly.
> Connection reported as Connection.NONE
> --------------------------------------
>                 Key: CB-77
>                 URL:
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android
>            Reporter: Simon MacDonald
>            Assignee: Joe Bowser
>             Fix For: 2.0.0
> To be pursuant with Apple guidelines, I recently put checks into my code to detect offline/online
status for my apps and alert accordingly. I used this function to detect:
> function isOnline() {
> // Presume online unless PhoneGap or HTML5 tell us otherwise.
> if ( && == Connection.NONE)
> return false;
> }
> if (navigator.onLine && typeof navigator.onLine == 'boolean' && navigator.onLine
=== false) {
> return false;
> }
> return true;
> }
> This works as expected for me, but for one of my users (on an Android 2.3), it reports
Connection.NONE even when they have perfect reception. So I'm no longer using the network.connection
> Maybe it doesn't work for some carriers? Or it shouldn't be relied upon for disabling
> @pamelafox that is a weird one. Going back over the code the only time Connection.NONE
should be returned is when the the NetworkInfo object is null or it's isConnected() method
returns false.
> Perhaps there is a window as the application starts up where the network info is not
ready. Are you making this check after a deviceready event?
> @pamelafox Can you ask your user if they are roaming when the have this problem? If so
I think it may be a bug with Android itself.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message