is there a way/workaround to find out what connection speed the iphone device has to the internet? with phonegap you could only measure if you have 2g/3G-connection or wifi-connection (or no-connection). but I want to let my app find out if there is only a slow web connection (2G/EDGE and smaller).
Asked
Active
Viewed 1,682 times
2 Answers
3
Write a web service that returns 1 MB of data. Call the Ajax using Ext.ajax.request. At the same time also start a timer. Stop the timer when success handle is called. This will give you the number of miliseconds taken to download 1MB of data. Use simple mathematics to find out the connection speed.
//start time here
Ext.ajax.request({
url: someurl_that_returns_1MB_of_data,
method: GET,
success: function (){
//stop time here
}
});
Also see: how to count time

Community
- 1
- 1

hrishikeshp19
- 8,838
- 26
- 78
- 141
0
If you want to know what type of connection the device has you can simply use -
navigator.network.connection.type
See http://docs.phonegap.com/en/1.4.1/phonegap_connection_connection.md.html#Connection

Peter
- 4,493
- 6
- 41
- 64