Apache Cordova
  1. Apache Cordova
  2. CB-77

Connection reported as Connection.NONE

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: None
    • Fix Version/s: 2.0.0
    • Component/s: Android
    • Labels:
      None

      Description

      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 (navigator.network && navigator.network.connection.type == 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 status.

      Maybe it doesn't work for some carriers? Or it shouldn't be relied upon for disabling functionality?

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

      http://code.google.com/p/android/issues/detail?id=11866

        Issue Links

          Activity

          Gavin made changes -
          Link This issue relates to CB-842 [ CB-842 ]
          Gavin made changes -
          Link This issue relates to CB-842 [ CB-842 ]
          Aurelien MERCIER made changes -
          Link This issue relates CB-842 [ CB-842 ]
          Hide
          Joe Bowser added a comment -

          Please open a new bug and provide details on the device. It's entirely possible that your device doesn't detect connectivity properly.

          Show
          Joe Bowser added a comment - Please open a new bug and provide details on the device. It's entirely possible that your device doesn't detect connectivity properly.
          Hide
          Chris Smith added a comment -

          I'm also experiencing the issue - I'm having customer bring in their device tomorrow to see if I can reproduce at all. Please can you reopen bug?

          Show
          Chris Smith added a comment - I'm also experiencing the issue - I'm having customer bring in their device tomorrow to see if I can reproduce at all. Please can you reopen bug?
          Joe Bowser made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Cannot Reproduce [ 5 ]
          Hide
          Joe Bowser added a comment -

          No response after a month, going to close since I can't reproduce this issue.

          Show
          Joe Bowser added a comment - No response after a month, going to close since I can't reproduce this issue.
          Hide
          Joe Bowser added a comment -

          Acutally, no it's not. I just threw an AT&T SIM into a device and it's reporting the connectivity correctly on the Nexus S we're using here. (It's roaming on Rogers)

          @pamelafox: Can you get information about the device and the carrier?

          Show
          Joe Bowser added a comment - Acutally, no it's not. I just threw an AT&T SIM into a device and it's reporting the connectivity correctly on the Nexus S we're using here. (It's roaming on Rogers) @pamelafox: Can you get information about the device and the carrier?
          Joe Bowser made changes -
          Fix Version/s 2.0.0 [ 12318875 ]
          Hide
          Joe Bowser added a comment -

          This relates to some of the AOSP hackery that I'm currently working on.

          Show
          Joe Bowser added a comment - This relates to some of the AOSP hackery that I'm currently working on.
          Joe Bowser made changes -
          Field Original Value New Value
          Assignee Joe Bowser [ bowserj ]
          Simon MacDonald created issue -

            People

            • Assignee:
              Joe Bowser
              Reporter:
              Simon MacDonald
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development