How to know whether Android is connected to WiFi or ethernet? -
how know whether i'm connected wifi or ethernet in android? in android os notified thess icons
does exist way know programmatically?
is enough?
connectivitymanager connmanager = (connectivitymanager) getsystemservice(context.connectivity_service); networkinfo wifi = connmanager.getnetworkinfo(connectivitymanager.type_wifi); if (wifi.isconnected()) { return true; }
also, wifi details:
wifimanager wifimanager = (wifimanager) getsystemservice(context.wifi_service); wifiinfo wifiinfo = wifimanager.getconnectioninfo(); return wifiinfo.getssid()
Comments
Post a Comment