ostrya / PresencePublisher

An Android MQTT client that regularly publishes messages to notify about the device's presence
MIT License
79 stars 12 forks source link

Fix WiFi name selection in Android 10 #17

Closed ostrya closed 4 years ago

ostrya commented 4 years ago

When trying to select target networks on Android 10, an empty dialog is shown.

ostrya commented 4 years ago

All right, a reboot helped.

ostrya commented 4 years ago

While trying to upgrade to compile SDK version 29, I found out that Google, in their infinite wisdom, have disabled the API to get a list of persisted WiFi networks due to "privacy concerns" (see https://issuetracker.google.com/issues/142599314).

So after all, to be able to stay forward-compatible, this problem needs to be tackled. My current plan is to replace the multi-selection dialog by a new tab, where individual entries can be added with a string input. To make the UX a bit better, I will provide a list of known network names (*) as autofill hints.

(*) Obviously, I cannot use the list of saved networks in Android 10+, so I will fall back to the list of currently visible networks (i.e. WifiManager#getScanResults()).