top | item 43384670

(no title)

ylj | 11 months ago

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.

Hope this clarifies things!

[1] https://developer.android.com/develop/connectivity/wifi/wifi...

discuss

order

jjayj|11 months ago

> 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?

jjayj|11 months ago

> 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?

Actually in the same comment I replied to, but there doesn't seem to be a way to edit posts in my mobile client.

endofreach|11 months ago

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.

Hope i didn't bring too much negativity.

ylj|11 months ago

Not at all. These are great questions I asked myself too!