var networkState = navigator.connection.type;
alert("Connection: " + navigator.connection); // result: Object Connection
alert("networkState: " + navigator.connection.type); // result: 0
var states = {};
states[Connection.UNKNOWN] = 'bad';
states[Connection.ETHERNET] = 'wifi';
states[Connection.WIFI] = 'wifi';
states[Connection.CELL_2G] = 'cell';
states[Connection.CELL_3G] = 'cell';
states[Connection.CELL_4G] = 'cell';
states[Connection.NONE] = 'bad';
return states[networkState];
While it should say "wifi", I get 0 as result of navigator.connection.type.
I'm testing on a Samsung Galaxy S3.
Any ideas?
--
-- You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to
phonegap+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
For more info on PhoneGap or to download the code go to www.phonegap.com
To compile in the cloud, check out build.phonegap.com