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.
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.
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();
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With