Show HN: Quickly connect to WiFi by scanning text, no typing needed

github.com

43 points by ylj a day ago

I travel and work remotely a lot. Every new place—hotels, cafes, coworking spaces—means dealing with a new WiFi network. Sometimes there's a QR code, which is convenient, but usually, it's a hassle: manually finding the right SSID (especially frustrating when hotels have one SSID per room), then typing long, error-prone passwords.

To simplify this, I made a small Android app called Wify. It uses your phone's camera to capture WiFi details (network name and password) from printed text, then generates a QR code right on your screen. You can instantly connect using Google Circle to Search or Google Lens. You can also import an image from your gallery instead of using the camera.

Currently, it's Android-only since I daily-drive a Pixel 7, and WiFi APIs differ significantly between Android and iOS. Play Store link: https://play.google.com/store/apps/details?id=com.yilinjuang...

I'd appreciate your feedback or suggestions!

jmusall 17 hours ago

That's a nice idea. I wish stuff like this was builtin. Small suggestion: API level 29 (Android 10) introduced WifiNetworkSuggestion[1], which allows an app to prompt the user to add WiFi credentials to the system. The suggestion has to be sent as an extra in an ACTION_WIFI_ADD_NETWORKS intent[2] (which was added in API 30 for some reason, not sure right now what happens in between).

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

[2] https://developer.android.com/reference/android/provider/Set...

  • ylj 14 hours ago

    Thanks for the suggestion! 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/7e63f2a9e6759847b4...

    • jmusall an hour ago

      Makes sense. Good to know that API has some serious (undocumented?) drawbacks :)

IanCal 20 hours ago

I do like people building things, but isn't this what the share network button is in android? It creates a qr code with ssid and password, and when scanned with lens it gives you a "join" button.

Edit - ah is the point taking a photo of credentials and joining from that?

  • nyx 19 hours ago

    Yeah, from the demo video, it looks like this OCRs a photo of text and turns it into one of those QR codes. Then you can use Google Lens against the QR code onscreen to get the "join" button.

    • jeroenhd 17 hours ago

      From this state, adding a button to join the network shouldn't be too complicated, at least not on Android. There's an API for offering a WiFi connection to the user. I don't know about iOS but I presume there's a similar API there.

      • ylj 13 hours ago

        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.

  • ylj 13 hours ago

    Yes, exactly—the goal is to join a network using printed WiFi credentials when a QR code isn’t provided.

kleiba 20 hours ago

While this is def neat, it shows signs of a classical computer scientist fallacy: "There's a recurring problem I occasionally run into, and each time it takes me about 3 minutes to solve it. No more! Instead, I'm going to spend a few weeks programming an app that solves the problem for me!"

  • tcoff91 20 hours ago

    The thing is though that it takes 1 person a few weeks and then could save many more people time.

    Also if you are already familiar with Android this app should take hours not weeks.

  • rrix2 18 hours ago

    it's too bad they didn't release it so a few hundred or thousand people benefit from it and save a few minutes each!

    • kleiba 7 hours ago

      Ah, the internet! The place where people go to paraphrase what others have already posted, just with passive aggressive sarcasm. Thanks for that!

amenghra 17 hours ago

For anyone interested, the wifi QR code format is described here: https://www.wi-fi.org/system/files/WPA3%20Specification%20v3...

These QR codes usually work with your device's default camera app -- point at QR code and get prompted to join the network.

  • nkrisc 17 hours ago

    I created a few stickers with my guest network WiFi details QR code to put on my fridge and around the house for when I have guests. I also recommend writing the SSID and password on it for those times the QR code won’t work with someone’s device (usually my mom’s ancient Android phone).

    • ylj 13 hours ago

      That’s great! I’d love it if every place adopted this approach—then I wouldn’t even need to build this app.

endofreach 16 hours ago

Spending compute to encode a string just to decode it with more compute, because the whole purpose was to print the decoded string seems... a bit wasteful at best. I don't understand.

Sure, the excuse here might be that the generated QR code can be used to connect other devices as well, but if that was the reason, it would have been mentioned i guess. It seems like the QR code is only generated & displayed to be read from screen... It seems to me– a judgmental moron– almost as if chatgpt came up with this...

Sorry if this sounds harsh, most likely i am wrong and don't get something here. And usually i wouldn't have commented because my comment doesn't bring something positive to the table... But i really so much don't get it here, i had to comment in the hope of being enlightened why this is smart and not the opposite...

But either way: if it solves an issue for you the way you want it to: perfect. Congratulations on finishing an app as you imagined it. That is really great, regardless of opinions like mine.

  • ylj 13 hours 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...

    • jjayj 12 hours 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 12 hours 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 13 hours 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 13 hours ago

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

  • wolrah 16 hours ago

    I think the intended purpose are cases like hotels where they really should be offering QR codes but instead just display text on the TV. If you control the display device then definitely just use the QR code but the problem this solves is when someone else has made bad choices.

    • jjayj 15 hours ago

      I guess the question is "why generate a QR code rather than just connect?"

      > You can instantly connect using Google Circle to Search or Google Lens.

      Is there something special about the Google integrations that other apps can't achieve (I'm not an Android developer)?

      • endofreach 14 hours ago

        > I guess the question is "why generate a QR code rather than just connect?"

        Exactly. Why not use the API directly? Why encode a string into an image for the sole purpose of displaying that image to then basically do a screenshot to then read from the screen, to run an algorithm on that to detect & decode to get the string you already had after doing the OCR on the wifi credentials.

        Btw: i didn't even open the link. My comment was based solely on this post. Now i see that it's an expo / react project... so the amount of wasteful energy spent is even higher.

        I have looked at the code. This here stands out to me:

        >>> if (Platform.OS === "android") { // On Android, we use system built-in WiFi connection dialog via qr code return false; } else if (Platform.OS === "ios") { // On iOS, we need to use a different method await WiFiManager.connectToProtectedSSIDPrefix( ssid, password, !isWPA // iOS only ); <<<

        Aside from the fact that the comments indeed look very llm-esque to me, the way they're phrased also implies that the ios way of directly connecting is the "different" method. Like that one is the workaround of both approaches– and the wasteful way is the desired one– for no apparent reason.

        • ylj 13 hours ago

          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 added more explanation here https://news.ycombinator.com/item?id=43384670

    • ylj 14 hours ago

      Yes, exactly. If WiFi QR codes were provided in the first place, we could just use the built-in QR code reader to instantly connect. This app targets situations where WiFi credentials are displayed only as printed text.

killingtime74 13 hours ago

This is already available on Samsung natively. Great project for those who don't have access to that.

tootie 19 hours ago

I have a Pixel 8a and there is a built-in feature like this already. If you connect to a protected wifi it give the option to use the camera to read the password off a sign.

  • ylj 13 hours ago

    No way! I’m using a Pixel 7 and would love to have that built-in. Could you share a screenshot of how that works on your phone?

mvdtnz 19 hours 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.

XorNot 20 hours ago

What driving me nuts is that we still don't have a widely deployed standard for this though.

Work gave me an iPhone recently and I was shocked the wifi initial connection screen had no option to scan a QR code. It took Android way too long to get this as well.

But on top of that, even when the option is there it's so limited - i.e. it gets presented as "must be a wifi QR code" without the option to just fill a text box from a plain text one (although on reflection I'm now wondering why that's not just a global UX option on phones).

  • coder543 19 hours ago

    On iPhone, WiFi QR codes work just fine. You just open the camera app, and point the phone at the QR code. They're automatically detected and scanned, the same as any other normal QR code. (No, you can't open the camera app during initial setup... but, it's not for a lack of the standard or the feature.)

  • frizlab 19 hours ago

    If I’m not mistaken iOS can scan the text directly from the text field though (not a very well known feature).

    • coder543 19 hours ago

      Also true. Tap on any text field. In the menu where the "paste" option lives, there is also a Scan Text option. I've used that for a number of things over the years.

  • ajsnigrutin 18 hours ago

    With 5g less and less people use random wifi hotspots, and for home locations, phone manufacturers assume that it's easier for the user to just type in the password than to generate qr codes for their new phone every few years.

    • lxgr 18 hours ago

      It's still very common for guests to connect to the host's Wi-Fi, as not nearly everybody has unlimited data, and not every home has good 5G coverage.

      QR codes are a convenient way to make that happen.

cassepipe 19 hours ago

Meanwhile there is still a WPS option on my old 2016 phone and half the routers n my country have one.

There's also a nmcli connection modify option for the linux laptop.

Lucky me

  • MortyWaves 19 hours ago

    Very lucky for WPS to ever work for you. I stopped even trying a long time ago.

  • mvdtnz 19 hours ago

    Unlikely to have a WPS button in a hotel room.