We provide complete mobile and web apps development solutions

Tuesday, October 23, 2012

WifiManager in Android

java.lang.object

-  android.net.wifi.wifimanager

WifiManager class provides primary api for managing all aspects of wifi connectivity.

get the instance of this class by calling

contaxt.getSystemService(context.WIFI_Service);

it deals with list of configured networks. this can be viewed, updated.


check wifi status:

ConnectivityManager conMgr;
NetworkInfo netInfo;
WifiManager wifiMgr;

conMgr=(ConnectivityManager)getSystemService(context.WIFI_Service);
netInfo=conMgr.getActiveNetworkInfo();
if(!(netInfo==null))
{
if(WifiMgr.isWifiEnabled())
{
//wifi  enabled
}
else
{
//wifi disabled i.e not available
}
}







0 coment�rios:

Post a Comment

Online Training

Your Name :
Your Email: (required)
Your Message: (required)

Powered by Blogger.

Recent Posts

Find Us On Facebook

Popular Posts