I have PhoneGap-Android application and I want to check network connection type (No connection, WIFI, GSM) by using PhoneGap API as described in http://docs.phonegap.com/phonegap_network_network.md.html
However, I don’t need to check if specific hostname is reachable. The only thing I need to know is the connection type, so no ping to internet will occur.
I’ve tried variants such as these, but with no luck:
navigator.network.isReachable(null, reachableCallback);
navigator.network.isReachable(false, reachableCallback);
navigator.network.isReachable('', reachableCallback);
Is there a way how to get network connection type without actually accessing the internet in PhoneGap Android app ?
at the moment there is no way to do this.
you can always write a plugin for phonegap to achieve what you want in native code. Here is a good entry on how to write a plugin: http://wiki.phonegap.com/w/page/36752779/PhoneGap-Plugins
I am sorry but I have no good suggeestion how to write that functionality in Java for Android.