Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to open system dialog box for entering password for a secured wifi network in android?

I am struggling around with achieving the dialog box which appears when a secured wifi network is discovered . I am attaching the image of that dialog box . I simply want to invoke such dialog box from my application.

As seen in this image how to open such dialog box using intent or there is any other way to do it?

like image 412
vijay Avatar asked Dec 28 '12 14:12

vijay


People also ask

Is it possible to connect to a Wi-Fi without password?

Connect wifi without password by using a QR code Open your smartphone's settings app. Now choose network and internet. In the new screen that opens up, you will see a list of all the wifi connections that are around you. You will also a settings option that says add network, with QR code icon right next to it.

How do I connect to a specific Wi-Fi network in Android programmatically?

First and foremost, add permissions in your manifest file. These 4 permissions are required to make changes in your device network connectivity. Setup configuration to connect one specific wifi using WifiConfiguration. WifiConfiguration config = new WifiConfiguration();


1 Answers

Since the question is not as clear as it could be, there are 2 possible answers

1) If you want to create a dialog looking like the one in the picture, try styling an AlertDialog. It should not be too hard to do it. For examples, take a look at this questions: How to change theme for AlertDialog

2) If you want to open the system dialog box for entering the password for a Wi-Fi, I have some bad news. That functionality is not available via Intents or other means of IPC. The best you could do is direct the user towards the Wi-Fi settings page using this Activity invocation:

startActivity(new Intent(Settings.ACTION_WIFI_SETTINGS)); 

Hope this answers your question.

like image 129
Janis Peisenieks Avatar answered Oct 20 '22 11:10

Janis Peisenieks