4 ms·
Surely Android exposes an API to connect to the network? Screenshotting a QR code then googling it feels kind of janky. I have devices like robot vacuums that u
by mvdtnz 2y ago
Surely Android exposes an API to connect to the network? Screenshotting a QR code then googling it feels kind of janky. I have devices like robot vacuums that use a local wifi connection to set themselves up, implying that such an API must exist? I don't do mobile development so maybe I'm off base.
- netsharc 2y agoYeah, I agree it feels janky. They could probably use this API: https://developer.android.com/develop/connectivity/wifi/wifi-suggest https://developer.android.com/develop/connectivity/wifi/wifi... or https://developer.android.com/reference/android/provider/Settings#ACTION_WIFI_ADD_NETWORKS https://developer.android.com/reference/android/provider/Set... to skip the step with Google Lens. Showing the QR-Code is still an interesting functionaliy, for the use case if they had a second phone they wanted to connect that doesn't have this app.
- ylj 2y agoExactly. I initially went with that approach [1], but eventually opted for on-screen QR code scanning. Suggested networks have lower connection priority and don’t always auto-connect. Also, passwords for suggested networks can’t be viewed or shared later, unlike regular WiFi connections. This is inconvenient because I often need to connect my Mac to the same network later. [1] https://github.com/yilinjuang/wify/commit/7e63f2a9e6759847b4d47f6418c85612d05f6692 https://github.com/yilinjuang/wify/commit/7e63f2a9e6759847b4...
- ylj 2y agoThat’s exactly the problem. Android’s API for directly connecting to WiFi is limited—it’s mainly designed for connecting to local or temporary networks, like the setup used by robot vacuums. More details explained here https://news.ycombinator.com/item?id=43384614 https://news.ycombinator.com/item?id=43384614