1

I'm trying to connect to an IoT device which communicates via access point it's hosting (there can be multiple IoT devices in the same room). On API older than 29 I used WifiManager methods to connect to the device. Now those are deprecated and suggested way is to use ConnectivityManager and its requestNetwork method.

Here I provide WifiNetworkSpecifier instance which, as the name implies specifies network name pattern (prefix in my case) and password. This results in system dialog which scans for matching networks and where user selects preferred network.

My problem with this is why API assumes that passwords on all matching WiFi access points are the same and requires them to be specified upfront (before scan dialog). Passing WiFiNetworkSpecifier without password results in dialog that scans for Open networks that match by name which is not my use case.

Is there a way to make Android ask for password after user selects item in that scan dialog?

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
  • Another related feature is that once the password has been set for a connection, all other attempts to set a password are ignored. See [this issue](https://stackoverflow.com/questions/61393636/android-q-always-reusing-the-first-entered-credentials-to-connect-to-the-wifi-ne). – SoftWyer Jan 28 '21 at 07:14

0 Answers0