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

Stay connected to network which doesn't have internet - Android

I am trying to receive data in an Android app from TCP server on an IoT device. I have searched on the internet. But I found information about transferring files between two android devices using WiFiP2PManager, WiFi Direct etc. Problem: Note: App…
pratiked
  • 1,712
  • 1
  • 11
  • 18
4
votes
1 answer

wifiManager.getScanResults() returns 0

I want to develop a software which scans available wifi networks in background with a handler thread. The problem is when i use handler.postDelayed(), WifiManager.getScanResults() return 0 meanwhile in normal situation its working . These are…
Alireza Nazari
  • 193
  • 1
  • 10
4
votes
0 answers

Oreo: LocalOnlyHotspot is created, but socket exception happens

I am creating some testing app, and I need to connect several devices via Wi-Fi direct. On Android 8 the only way to do it is to create LocalOnlyHotspot. I have done it successfully, devices are connecting. However I need to transfer some strings…
Dmitry K.
  • 193
  • 1
  • 1
  • 8
4
votes
1 answer

Android WifiManager::getScanResults() still returns empty list

As a newbie to Android programming, I am trying to get the SSID list using WifiManager's getScanResults() method, but it remains empty, even though I have granted it the ACCESS_COARSE_LOCATION permission as well as the CHANGE_WIFI_STATE (for the…
user4072916
4
votes
1 answer

Always getting -1 in adding new wifiConfiguration to the wifiiManager

I am creating a list of in-range wifis and show it to the user. I want to the user can select each of the items in the list and insert the password in order to connect to the selected SSID. I wrote this method for wifi connection: private…
Ehsan
  • 2,676
  • 6
  • 29
  • 56
4
votes
2 answers

Android - Wifimanager handle wifi-connection states

I've got an app which connect itself programatically to a wifi connection. My problem is, I want to handle the case, that the password is wrong. I want to detect that the password is not correct in runtime. To be precise I've got a progressdialog…
David
  • 273
  • 2
  • 20
4
votes
1 answer

Connect to wifi network programmatically(first access ssid)?

I want to connect first time wifi network (one not saved before). If I connected to the wifi before, the code below runs well and I access wifi, but if I try first time to connect, nothing happens. Why is this happening? String networkSSID =…
Engin
  • 41
  • 5
4
votes
1 answer

Android Wi-Fi Direct P2P send data from server to client

I have an Android app where I'd like to send data between 2 or more devices using Android's WiFi Direct P2P feature. My app is created based off Google's WiFi Direct Demo. The problem is, I wan to send data from the my server (group owner) to the…
Mace123
  • 65
  • 1
  • 1
  • 7
4
votes
1 answer

ESP8266 + WiFiManager + pubsubclient

I'm using an ESP8266 and want to control it using MQTT with the MQTT server being my Synology DS415+. I want the ESP to sit in a place where I cannot access it using serial once it is installed, so I need to be able to configure it's…
SirSiggi
  • 143
  • 1
  • 1
  • 9
4
votes
1 answer

Getting whether the wifi connection is locked(password protected) or not

In my app I am getting all available WiFi networks and displaying them in a list using WifiManager.startScan() and WifiManager.getScanResults().Also I am able to show signal strength.But I don't know how to show whether wifi is locked or not.In the…
Android Developer
  • 9,157
  • 18
  • 82
  • 139
4
votes
1 answer

Configure EAP-SIM for dual SIM devices in Android

I've tried configuring EAP-SIM for single SIM devices and got connected successfully. Now I want to configure for a specific SIM card on a dual SIM device. My observation is while configuring EAP in single SIM device, there is no provision to…
Kishore
  • 952
  • 2
  • 11
  • 31
4
votes
1 answer

Android connect to Wifi programmatically if wifi name match

I would like to build an app, that checks all the available WiFi networks, If a network's SSID matches a search key then connect to that network, if two networks match then connect to the one with the higher signal strength. e.g. SearchKey =…
Thiago
  • 12,778
  • 14
  • 93
  • 110
4
votes
0 answers

WifiManager.getScanResults returns old results if no APs are in range

Code in my current project periodically calls the WifiManager.startScan method and fetches the result via BroadcastReceiver: void setupWifiScanner() { final WifiManager wifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE); …
fxfour
  • 143
  • 1
  • 10
4
votes
0 answers

How to connect to a saved wifi in android?

I know there are methods to add and connect to a wifi network How do I connect to a specific Wi-Fi network in Android programmatically? But what I need is to connect to a network that is already been saved by the user in the device, Basically I…
Muhammad Naderi
  • 3,090
  • 3
  • 24
  • 37
4
votes
1 answer

WifiManager returns BSSID 00:00:00:00:00:00

I use the following code to get BSSID: public static String getBSSID(Context context) { WifiManager wifiMgr = (WifiManager) context.getSystemService(Context.WIFI_SERVICE); return wifiMgr.getConnectionInfo().getBSSID(); } When i use this…
Zbun
  • 4,875
  • 4
  • 19
  • 28