user1106392
user1106392

Reputation: 33

How can I establish wifi connection?

I want to write a application list AccessPoints and when you click one, a wifi connection dialog will open (like WiFi Manager or WiFinder) but I don't know how to Open the default connection dialog ?and how to receive the intent or event to call the connection dialog?

To be clear, I want to open a dialog like when you open Wi-Fi setting, click on one of configured wifi network list; and it open a dialog asking you connect or forget.

Upvotes: 0

Views: 659

Answers (2)

dokkaebi
dokkaebi

Reputation: 9190

I think you want this:

startActivity(new Intent(WifiManager.ACTION_PICK_WIFI_NETWORK));

from here. The next post also mentions WifiManager which gives you finer control like a list of the configured networks.

Upvotes: 2

Lucifer
Lucifer

Reputation: 29672

Try this,

WifiManager wifi = (WifiManager) getSystemService(Context.WIFI_SERVICE);
wifi.setWifiEnabled(enabled);

Upvotes: 4

Related Questions