Sunday, April 24, 2011

[android-developers] Wifi lock with WIFI_MODE_SCAN_ONLY

Hello All,

Here is what I do to scan on wifi while connected to 3G.

WifiLock wifiLock =
wifiService.createWifiLock(WifiManager.WIFI_MODE_SCAN_ONLY,
"MyLock");

if(!wifiLock.isHeld()){
wifiLock.acquire();
}

if(wifiService.isWifiEnabled() == false){
wifiService.setWifiEnabled(true);
}

Is my usage of WIFI_MODE_SCAN_ONLY is correct. It did not work for me.
When I enable Wifi, it automatically connects to the remembered
network. I just want to scan but not connect.

Regards,
Seema

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate