Using WifiManager to connect to a network


Last Updated:

  1. derolph

    derolph New Member This Topic's Starter

    Joined:
    Jan 31, 2010
    Messages:
    1
    Likes Received:
    0
    Hello everyone,

    I am using a Nexus One with 2.1 SDK. I am having problems with a module in my application connecting programmatically to a network. The code snippet that I am using is:

    WifiConfiguration wifiConfig = new WifiConfiguration();
    wifiConfig.BSSID="00:0C:41:F5:B0:08";
    wifiConfig.SSID="test";
    WifiManager wifi = (WifiManager) getSystemService(Context.WIFI_SERVICE);
    wifi.setWifiEnabled(true);
    int netId = wifi.addNetwork(wifiConfig);
    wifi.enableNetwork(netId, true);

    Monitoring the network, I see probe requests transmitting from the device, but I do not see an Authentication/Association request to the access point that I specify in the BSSID. Ultimately, I will perform a scan to determine valid AP BSSIDs, but for testing, I simply want to connect to a test AP which is in close proximity to my Nexus One.

    I have set the appropriate permissions in my manifest xml and am not seeing any negative log statements from adb.

    Any pointers or suggestions with using WifiManager to perform this action would be very appreciated.

    Thank you very much!

    Dan
     

    Advertisement

Share This Page

Loading...