Set or View "Advanced Wi-fi" Settings programatically
Asked Answered
C

3

6

I need a way to open the "Advanced wifi" settings programatically to let the user change some of the settings, or, preferably, to change these advanced wireless settings programatically.

I can only access the wi-fi settings so far via startActivity(new Intent(Settings.ACTION_WIFI_SETTINGS)) but not the advanced settings.

Is there a way to open the "Advanced wifi" settings?

Chenault answered 22/8, 2013 at 19:10 Comment(1)
I can only access the wi-fi settings so far via startActivity(new Intent(Settings.ACTION_WIFI_SETTINGS)) ... but not the advanced settings.Chenault
T
1

There are two more settings that might work for you:

From the API documentation:

  • Settings.ACTION_WIRELESS_SETTINGS

    startActivity(new Intent(android.provider.Settings.ACTION_WIRELESS_SETTINGS));
    
  • Settings.ACTION_WIFI_IP_SETTINGS

    startActivity(new Intent(android.provider.Settings.ACTION_WIFI_IP_SETTINGS));
    

Try those two and see if they open what you're after.

Tailpipe answered 22/8, 2013 at 20:28 Comment(3)
thank you... Settings.ACTION_WIFI_IP_SETTINGS was what I needed.Chenault
btw, do you know if it is possible to mofify these settings programatically?Chenault
@DanielMF Check out this answer hereTailpipe
S
1

Here is the code snippet to open WIFI settings page

Intent intent = new Intent(Intent.ACTION_MAIN, null);
    intent.addCategory(Intent.CATEGORY_LAUNCHER);
    ComponentName cn = new ComponentName("com.android.settings", "com.android.settings.wifi.WifiSettings");
    intent.setComponent(cn);
    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    startActivity( intent);
Synchronous answered 14/7, 2016 at 16:51 Comment(0)
R
0

Here you can use this code to open wifi option directly

startActivity(new Intent(Settings.ACTION_WIFI_SETTINGS));
Repudiate answered 10/10, 2021 at 11:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.