Hi,

   I just came across the WiFi locks. It says that I can create a
lock
with scan_only mode and it will prevent me from automatic connection.
But it did not work for me. This is what I did

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

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


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

But it automatically connects to the remembered network.

Regards,
Seema

On Apr 22, 11:26 am, Zsolt Vasvari <[email protected]> wrote:
> My guess is that you cannot do this and for good reason.  I would be
> pretty pissed, as a user, if some app pervented me to connect to my
> WIFI network at home.
>
> On Apr 22, 2:18 pm, seema <[email protected]> wrote:
>
> > Hi,
>
> >      I am developing an app where I would like to know the available Wi-Fi
> > networks when connected to 3G.
> > When I enable Wi-Fi, it automatically connects to a wifi network and
> > disconnects from 3G. I want wifi
> > to be enabled, but not connected to any wifi networks instead remain in 3G.
>
>

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

Reply via email to