问题
I have developed contact screen page using sencha touch2. my requirement is, based on type of wifi connection like 2G/3G depends on that. I want to disable some button in ipad. can any one provide the best way how to achieve this one using sencha touch2.
回答1:
I have searched in sencha website they given clearly how to get type of internet connection. it is working fine.
Here is solution:
Determining if the current device is online:
alert(Ext.device.Connection.isOnline());
Checking the type of connection the device has:
alert('Your connection type is: ' + Ext.device.Connection.getType());
The available connection types are:
UNKNOWN - Unknown connection
ETHERNET - Ethernet connection
WIFI - WiFi connection
CELL_2G - Cell 2G connection
CELL_3G - Cell 3G connection
CELL_4G - Cell 4G connection
NONE - No network connection
来源:https://stackoverflow.com/questions/11357301/how-to-check-which-type-of-wifi-connection-in-ipad-using-sencha-touch2