cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jasper (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CB-1807) Android navigator.connection.type is not equal to navigator.network.connection.type
Date Thu, 03 Jan 2013 20:12:12 GMT

    [ https://issues.apache.org/jira/browse/CB-1807?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13543244#comment-13543244
] 

Jasper commented on CB-1807:
----------------------------

I have replaced the cordova.android.js with the 2.3.0rc2 one. I can see the corresponding
changes in the file.

Force stopped my app and cleared the cache and start over again.
But i still see the problem.

This is the code snippet : 

function checkConnection()
{
	
	if (((typeof(Cordova) != 'undefined' || typeof(cordova) != 'undefined') && navigator.connection))
	{
		 
		var networkState = navigator.connection.type
		alert(networkState)
		

                // network state:
		// none: No network on Android
		// unknown: No network on iOS
		if (networkState == "none" || networkState == "unknown")
		{
			return false
		}
	}

	return true
}

Could it be an OS issue if you verify that it works on your environment?
                
> Android navigator.connection.type is not equal to navigator.network.connection.type
> -----------------------------------------------------------------------------------
>
>                 Key: CB-1807
>                 URL: https://issues.apache.org/jira/browse/CB-1807
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android
>    Affects Versions: 2.2.0
>            Reporter: Thejaswi Puthraya
>            Assignee: Andrew Grieve
>             Fix For: 2.3.0
>
>         Attachments: index.html
>
>
> As per the documentation and example navigator.connection.type is what was previously
navigator.network.connection.type.
> """
> Before Cordova 2.2.0, the Connection object existed at: navigator.network.connection.
> To match the spec, this was changed to navigator.connection in 2.2.0.
> navigator.network.connection still exists, but is now deprecated and will be removed
in a future release.
> """
> But in the file that I am enclosing to reproduce the bug, navigator.connection.type is
always (irrespective of connection) 'unknown'(0) though navigator.network.connection.type
returns the correct value.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message