This piece of code can get info about the device wifi.
if(!(netInfo==null))
ConnectivityManager conMgr;
NetworkInfo netInfo;
WifiManager wifiMgr;
WifiManager wifiMgr;
conMgr = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
netInfo = conMgr.getActiveNetworkInfo();
if(!(netInfo==null))
{
if (wifiMgr.isWifiEnabled())
{
//WIFI ENABLED
}
else
{
//WIFI DISABLED
}
}
else
{
//NOT AVAILABLE
}
No comments:
Post a Comment