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
6
votes
1 answer

WifiManager getConnectionInfo() got deprecated in Android API level 31

We uses Wifimanger getConnectionInfo() method to get SSID and BBSID of connected wifi. But starting with Andorid API level 31 , Android has deprecated the getConnectionInfo() method. The solution that they have provided to use getTransportInfo()…
Ranjeet Kumar yadav
  • 152
  • 1
  • 3
  • 11
6
votes
1 answer

Wificonfiguration is deprecated Android 10

Wifi configuration is deprecated at 29 Android Version. I want to share the file using WIFI but there is no such library which i can use for this purpose. So If Anybody has a solution for this problem kindly share it. WifiConfiguration wc = new…
Ahmad Idrees
  • 181
  • 3
  • 12
6
votes
0 answers

Alternative for deprecated WifiManager.getConfiguredNetworks and WifiManager.removeNetwork methods on Android Q?

For a UiTest class setup, I need to begin with no remembered Wifi Networks. To do this I use a combination of the WifiManager.getConfiguredNetworks() and WifiManager.removeNetwork(), both of which are now restricted and deprecated for Android…
MahNas92
  • 327
  • 1
  • 17
6
votes
1 answer

Correct usage of wifi RTT ranging in Android 9

Android 9 (Pie) introduces wifi RTT ranging for the purpose of wifi-based gelolocation. In versions up until Android 8 (Oreo), applications would periodically request wifi scans. This functionality is being massively throttled in Android 9: a…
user149408
  • 5,385
  • 4
  • 33
  • 69
6
votes
5 answers

WifiManager.WifiInfo getSSID & getBSSID not working if targetSdkVersion >= 26

I'm getting correctly those values if I compile with API 27 but target API 25. If I set targetSdkVersion to 27, then, those values are not correctly retrieved. Targeting SDK 25 or less, values are correct, but targeting 26 or more, I get those…
NullPointerException
  • 36,107
  • 79
  • 222
  • 382
6
votes
1 answer

Android WiFi manager network switch when connecting to a configured network

I am seeing some interesting behaviour when dealing with Wifi Manager on latest versions of Android(on Pixel especially). I am trying to make the WIFI manager connect to a known hotspot(IOT appliance). Google lists the steps clearly in a blog post,…
6
votes
1 answer

Get Android DhcpInfo connected via Ethernet

How to get DhcpInfo() (gateway ip, netmask, dns, etc) of android device connected via Ethernet? I know how to get it if device connected via Wifi and using ACCESS_WIFI_STATE permission: WifiManager wifi = (WifiManager)…
6
votes
0 answers

Android drops WiFi after connecting programmatically

I am experiencing a strange behavior in my Android app: Every time I connect programmatically to a WiFi network (source see below), first it works as intended, but after a couple of seconds (between 5 and around a minute) the connection is dropped…
2mac
  • 111
  • 3
6
votes
1 answer

Android Wifi Scan - BroadcastReceiver for SCAN_RESULTS_AVAILABLE_ACTION not getting called

Here is my code: public class FloatWifiManager implements IWifiManager { private WifiManager wifiManager; private BroadcastReceiver wifiScanReceiver; public FloatWifiManager(Context context) { ... wifiManager =…
6
votes
3 answers

how can i determine internet speed in my android application

In my application I want that when i click a button it show me the exact internet speed. I had read all answer about this question which has already been asked in this links determining internet speed in android , Calculating Internet Speed in…
e.hadid
  • 999
  • 9
  • 20
6
votes
3 answers

Android WifiManager getScanResult complains Need ACCESS_COARSE_LOCATION or ACCESS_FINE_LOCATION permission although declared permission

I am developing an App to check Wifi points. I am getting error "java.lang.SecurityException: Need ACCESS_COARSE_LOCATION or ACCESS_FINE_LOCATION permission to get scan results" at wifiManager.getScanResults() even though I already declared those…
kevin0228ca
  • 479
  • 1
  • 8
  • 17
6
votes
1 answer

What is different of NSD and WifiP2pManager?

There are several choice for making a WiFi program in android, most common methods are using NSD and WifiP2pManager. What is different between these 2 choice?
hamedata
  • 125
  • 1
  • 12
5
votes
1 answer

How to get the BSSID of the WiFi networks configured in the supplicant - android?

When i use getConfiguredNetworks() to get the BSSID value, it doesnt give me anything. I get all other values except BSSID. Can anyone tell me why this is happening? And yes the networks which i receive have their respective BSSIDs. I found that out…
Vikram Gupta
  • 6,496
  • 5
  • 34
  • 47
5
votes
0 answers

Can I enable dual channel acceleration for my app?

I am making an Android flutter app where I connect to a WiFi hotspot which does not have a connection to the internet. While being connected to this WiFi, I need to communicate with an online backend. After Android 10(from my understanding), some…
Daniel
  • 546
  • 6
  • 17
5
votes
1 answer

WiFi suggestion API fail on Android

I've been trying to use the new Android WiFi Suggestion API with the code taken exactly from the example, but each time I try to connect to a network, when I call wifiManager.addNetworkSuggestions(suggestionsList) I get status 3 in response, which…
Mohru
  • 725
  • 1
  • 7
  • 17