Hacker News new | ask | show | jobs
by sberder 899 days ago
Thanks for putting it in context, the Bluetooth API has been a big source of frustration in my exploration of PWAs. So many simple setup apps wouldn't need to be native. A cross platform Bluetooth API for the web would provide really easy PoC with MCUs.
4 comments

Lots of comments below shooting from the hip and throwing warnings of security issues clearly without any practical knowledge of the current BT API. Someyimes, not saying anything is also an option.
Yes I really want random websites to have access to Bluetooth
No, they do not get access unless you allow it and explicitly selet a bluetooth device the page is allowed to connect to. The bluetooth dialog is handled entirely by the browser.
They're not random websites though. They're apps that you have installed. And given permissions to.

The gatekeeping/FUD/wringing-of-pewrls over this seems absurd, cruel, and most of all arbitrary to me. Insubstantial naysaying.

I have never heard and end user say - “you know Electron apps are so great on the desktop, it would be really great if all apps on phones were PWAs.”
PWAs don't have one of the major downsides of Electron, which is bloat - you don't have to package the huge runtime yourself.

That aside, sure, I'll always take a native app if I can have it. But providing native apps across all major desktop and mobile platforms is a lot of effort, especially for small businesses and hobbyists. In that case, a PWA is vastly better than nothing at all, or a native app for one particular platform that just happens to be the one you don't use.

> So many simple setup apps wouldn't need to be native.

If they are simple, why not making them native?

Provisioning IoT devices has to be done through native apps if Web Bluetooth isn't viable. It's a total PITA.

Web BT permissions can be disabled if not needed. I reject Mozilla's and Apple's reasoning.

Because in native even simple is complicated?
Are you not saying that because you know webtech and not native? I find native easier, webtech with new frameworks and bundlers and fashion every two days is much more annoying to me.
Probably not. I've coded more for webtech, but have done native for Android (and Linux and Windows. And J2ME and Symbian FFS). Luckily very little iOS and MacOS apart from some reverse engineering.

You don't need frameworks or bundlers for simple cases. For many you need just one .html file.

For e.g. Android you need quite a bunch of files and directory structures to do even get a Hello world [1]. You need to compile and bundle and package. And install. And god knows what if you want the application distributed. And then you have to fight with the inconsistent and very boilerplatey Android APIs. And figure out which API was deprecated yesterday and what's today's one that will be deprecated tomorrow.

From what I gather, iOS native is even worse. E.g. have to buy a Mac and use MacOS. And Xcode. And faff with signing keys.

[1] https://github.com/IanDarwin/AndroidTemplate

In my experience, Android-Studio creates the app for me. There are many files indeed, but that's nicely solved by the IDE. Then Kotlin is great, and I really like Jetpack Compose.

You can distribute your APK manually, but if you want it on the Play Store you have to jump through loops indeed. Though I don't think it's worse than running a webserver.

> And figure out which API was deprecated yesterday and what's today's one that will be deprecated tomorrow.

That's a bit exaggerated. I have been developing for Android for 10 years, and deprecations take years. There are deprecations, but I find that they are made in a controlled fashion.

> E.g. have to buy a Mac and use MacOS. And Xcode.

Yes, I am not a big fan of that. But many people are, so...

There are plenty of e.g. scaffolding tools to handle the bundlers and deployments etc for web frameworks if you are OK with IDE doing that.

I don't use IDEs or scaffolding tools if I can do without. I use many different languages and platforms, and for that just good old vim and terminal make juggling between them a lot easier.

I do understand that using the tool you know makes things (seem) simple. But it's the same for all tech.

The deprecations were exaggarated (along the tune of your two day). I haven't done Android native in a while, but e.g. the situation with Camera/Camera2/CameraX was quite bad.

And a massive exploit capability for malware.