HN's idea of 'repost' is not totally obvious but is something like 'would it produce more-or-less the same discussion' and in this case it likely would.
That’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
Exactly. 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.
I’m not sure about iOS either. Could you point me to how an Android app can directly connect the user to a WiFi network? I know about the WiFi suggestion API, but I haven’t found a straightforward way to initiate a direct WiFi connection. That’s why I ended up with this quirky QR code workaround.
Thanks for looking into the code! Initially, I wanted the app to work consistently on both platforms, but I found that the WiFi connection APIs behave very differently. In the end, I focused mainly on Android to ensure it matched my intended use case.
You’re right about the LLM smell. I’ve been using cursor composer and find it very handy at times!
I know. The simple answer is that Android doesn’t allow apps to directly manage WiFi connections. I’ve provided a more detailed explanation here https://news.ycombinator.com/item?id=43384670
I understand your point and initially wanted to avoid the overhead of generating and scanning a QR code just to connect to WiFi. The reason for this approach is that the Android API doesn’t allow non-system or non-rooted apps to directly manage WiFi connections. In other words, it’s not possible to create a simple app that directly connects to WiFi with known network name and password.
Generating and scanning a QR code is a workaround to minimize steps—avoiding the need to manually select the network from a long list and type the password.
Android does provide a WiFi suggestion API [1], but it has several limitations and doesn’t behave quite as expected. I initially tried using that, but eventually settled on the QR code solution.
> Android does provide a WiFi suggestion API [1], but it has several limitations and doesn’t behave quite as expected.
Can you expand on this? I read the linked doc, and it looked like a separate API should be used to used to "persist a network connection" (my words), but as someone with no Android dev experience there don't seem to be any obvious limitations.
You did mention in another reply that only certain root apps can do [what we expect]. Is there a link where I can learn more about that?
Thanks, it does clarify. I thought one might at least be able to pretend to have a QR code parsed result string (eg wifi:T:WPA;S:MySSID;P:mypassword;;), to trigger the systems API. I didn't know that android now has these limitations.
I was sure, a third party QR code scanner should be able to read wifi qr codes and trigger a connection prompt as well. But apparently the it can't. This is dumb, but then you're app is not.