Questions tagged [wifimanager]

WifiManager is the primary Android API for managing all aspects of Wi-Fi connectivity.

WifiManager is the primary Android API for managing all aspects of Wi-Fi connectivity.

As per the WifiManager documentation, this class provides access to:

  • The list of configured networks. The list can be viewed and updated, and attributes of individual entries can be modified.
  • The currently active Wi-Fi network, if any. Connectivity can be established or torn down, and dynamic information about the state of the network can be queried.
  • Results of access point scans, containing enough information to make decisions about what access point to connect to.
  • It defines the names of various Intent actions that are broadcast upon any sort of change in Wi-Fi state.
667 questions
8
votes
1 answer

Android WiFiManager enableNetwork returning false

TO BE CLEAR: The most likely part of the code which has the problem is the connect function, which you can find in the code block. EDIT: I've had a good dig through LogCat and found something interesting (this occurred the exact moment enableNetwork…
Thomas Cook
  • 4,371
  • 2
  • 25
  • 42
8
votes
1 answer

Need to forget configured Wifi network programmatically in Android 6.0

I have implemented the system to connect to wifi networks from my app programmatically, now I want to forget configured WIFI networks programmatically from the application. I have implemented this into my application already and its been working…
Kishan sharma
  • 701
  • 1
  • 6
  • 20
8
votes
3 answers

How to create Custom WPA Hotspot with ssid and password in android?

I am using the following code for creating the Wifi-hotspot configuration. I am able to create the Hotspot configuration and able to enable it. but i have give configuration for WPA-PSK, But it always taken as OPEN network. public boolean…
Yuvaraja
  • 715
  • 6
  • 22
8
votes
1 answer

WifiManager.is5GHzBandSupported() lying?

I am using new method is5GHzBandSupported() available in WifiManager since API level 21. http://developer.android.com/reference/android/net/wifi/WifiManager.html#is5GHzBandSupported%28%29 On my Nexus 5 it is working fine (returning yes as expected),…
8
votes
2 answers

Android - How to scan Access Points and select strongest signal?

I am currently trying to write a class in Android that will Scan for access points, calculate which access point has the best signal and then connect to that access point. So the application will be able to scan on the move and attach to new access…
Donal Rafferty
  • 19,707
  • 39
  • 114
  • 191
7
votes
1 answer

How to set the default WIFI network in mac?

My Mac is getting connected to a default network always. I want to change the default wifi network. How can i do that? Thanks and Regards
Anish Chandran
  • 141
  • 1
  • 8
7
votes
2 answers

What interval should I use between each WiFi scan on Android?

I need to perform Wifi scans at regular intervals. I am encountering a problem when the time interval is set to 1-2 seconds. It seems like I am not getting any ScanResult. Is there a minimum amount of time to set so that the WifiManager is able to…
user918197
  • 1,129
  • 6
  • 17
  • 29
7
votes
2 answers

Android Long Running Wi-Fi Scanning Service

I have been following https://developer.android.com/guide/topics/connectivity/wifi-scan guide in order to create a Wi-Fi scanner. I am using a foreground service with a handler to call wifiMananger.startScan(); every 30 seconds (I tried with 15…
7
votes
5 answers

Turning on wifi using WifiManager stops to work on Android 10

I have following code which used to work well pre Android 10. But it is not able to turn wifi on in Android 10 devices. WifiManager wifiMgr = (WifiManager) getApplicationContext().getSystemService(Context.WIFI_SERVICE); boolean res =…
AdeleGoldberg
  • 1,289
  • 3
  • 12
  • 28
7
votes
2 answers

Faster WiFi scanning alternative than WifiManager startScan()?

TL;DR version I need to scan and get the BSSID / M.A.C address and Signal Level of the nearby Access Points several times a second. WifiManager.startScan() scans about 3.5 seconds which is a bit slow. (better than 6 seconds for others but still…
Bogdan Mihai
  • 129
  • 9
7
votes
3 answers

Android 8.0 Oreo wifi list not getting

On Android 8.0, not getting wifi list using wifiManager, below API level 26 I am getting the list. This function returns the WifiManager Object public static WifiManager getWifiManager(Context context) { WifiManager wifiManager = null; …
Kumar Jadhav
  • 109
  • 2
  • 6
7
votes
1 answer

Check if ScanResult network is already configured (exists in getConfiguredNetworks() list)

I need to check for every network returned by getScanResults() method if it is already configured in the device, that is, I need to check if it exist in the list returned by getConfiguredNetworks(). The problem is: how can I do this since the only…
samugi
  • 395
  • 5
  • 17
7
votes
4 answers

Scanning for wifi signals only in 2.4Ghz band

I need to scan for available Wi-Fi signals and their strengths. I'm using wifiManager.startScan(); and asynchronous wifiManager.getScanResult();. On devices without support of 5GHz band it takes about 500ms to get the results, on devices with 5GHz…
donEgro
  • 71
  • 1
  • 5
7
votes
1 answer

Getting the MAC address of the device- when wifi is off

I am finding the MAC address of the Android Device using the following code: WifiManager manager = (WifiManager) getSystemService(Context.WIFI_SERVICE); WifiInfo info = manager.getConnectionInfo(); String address = info.getMacAddress()); But in…
Gaurav Arora
  • 8,282
  • 21
  • 88
  • 143
6
votes
1 answer

Thread hang on WifiManager.enableNetwork()

I am seeing my calling thread hang in native code when calling WifiManager.enableNetwork(). So far, I have only been able to reproduce this hang on the Motorola Xoom tablet running Android 3.2.1. I have tested on several other phones and tablets…
Greg R
  • 133
  • 3
  • 8
1 2
3
44 45