{ "id": "83466", "key": "TIMOB-6503", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2012-02-13T16:46:35.000+0000", "created": "2011-12-07T12:01:59.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [], "versions": [ { "id": "12580", "description": "Dual Runtime 1.8.0", "name": "Release 1.8.0.1", "archived": true, "released": true, "releaseDate": "2011-12-22" } ], "issuelinks": [], "assignee": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "updated": "2014-01-28T23:57:35.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "11500", "name": "MobileWeb", "description": "Mobile Web (HTML) Platform" } ], "description": "Regardless of browser or device, the networkType always returns -1 and the networkTypeName returns UNKNOWN.\r\n\r\n{code}\r\nTi.API.info('type:' + Titanium.Network.networkType);\r\nTi.API.info('online:' + Titanium.Network.online);\r\nTi.API.info('name:'+Titanium.Network.networkTypeName);\r\n{code}", "attachment": [], "flagged": false, "summary": "MobileWeb: Ti.Network.networkType always returns -1 with networkTypeName as UNKNOWN", "creator": { "name": "adecena", "key": "adecena", "displayName": "Anthony Decena", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "adecena", "key": "adecena", "displayName": "Anthony Decena", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "175342", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "The reason it's -1 is because that's the value of the constant Ti.Network.NETWORK_UNKNOWN. Android 2.2+ is the only web browser that reports the connectivity information. For all other browsers, there's no way to accurately detect the network type.\r\n\r\nYou could do a speed test downloading an image to best guess, but it's unreliable.\r\n\r\nTo implement this for Android 2.2+, implement checks for navigator.connection.type. Refer to http://davidbcalhoun.com/2010/using-navigator-connection-android and http://stackoverflow.com/questions/4459029/is-there-a-way-to-detect-if-a-user-is-on-a-wifi-connection-with-php-or-javascrip.", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2011-12-08T02:41:12.000+0000", "updated": "2011-12-08T02:41:12.000+0000" }, { "id": "175700", "author": { "name": "adecena", "key": "adecena", "displayName": "Anthony Decena", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This actually already returns correctly for the Android web browser. Returning type = 3 and name = MOBILE for any Android 2.2+ browser.", "updateAuthor": { "name": "adecena", "key": "adecena", "displayName": "Anthony Decena", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-12-10T14:57:00.000+0000", "updated": "2011-12-10T14:57:00.000+0000" }, { "id": "182996", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "This is a non-issue and works as expected.", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2012-02-13T16:46:35.000+0000", "updated": "2012-02-13T16:46:35.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }