The Potential of Device Web Browser APIs

Saturday, December 18, 2021

Recently I have been thinking about the potential of device web browser APIs. These are exciting APIs that would democratize app development if they gain traction and support. In this post I want to highlight some reasons why I think these APIs have so much potential. I would like to start with describing how I think these APIs democratize app development.

Currently if you have an idea for an app you are immediately pressed to make some difficult decisions. One of the first choices you need to make is, what platform are you going to build your application for? Are you going to create a mobile app or will you create a web application? Of course this choice depends on what your app requires. Does your app need access to a gyroscope or a magnetometer? Or maybe more commonly, do you want people to be able to access your app on their phone?

One of the immediate trade-offs that happens when making this choice is that if you choose to make a web application, you automatically make your life harder if people are going to be using a web browser from their mobile device to access your application. I personally make a lot of use of web applications from my mobile web browser, and I feel that support is a mixed bag; github works pretty well but it has its issues. Most of the issues are around accessibility of the web application in a smaller screen and there are some javascript compatibility issues depending on your phone and which type and version of web browser you use.

The other part of the trade-off of choosing your platform is if you take the native mobile route. If you're going to make a mobile app, how are you going to support both the Android and iOS platforms? Is it OK for you to only support one of the platforms? To the best of my knowledge this is still not an easy problem to solve. Of course there is the promise of Facebook's React Native using Javascript and Google's Flutter framework using the Dart programming language.

Additionally if you take the path creating a mobile application you will eventually need to deal with verification, upload to and mafia style payments for keeping your app in the Google/Apple app stores. Any profits that you might be lucky enough to generate in your app will have a significant cut going to Google/Apple. For more information on all of the fees/cuts I'll refer you to this article called "A guide to platform fees".

Another option that is available is to buy your own hardware and build your own platform. This is interesting and is in its own right an important avenue to be able to pursue. I'm grateful that the DIY ecosystem is healthy and thriving and I can only hope that it continues to grow and expand for the sake of innovation. However this is obviously not a scalable choice, even if by "scale" you mean sharing an app with a handful of friends. You have to rebuild and install everything in a given project for your friends or show them how.

So how could these device web APIs democratize app development? First I would like to say that while I was bashing a little bit on the state of building a web application compatible with mobile browsers, I think that this is a good path forward. The experience now may be less than stellar but it still works pretty well. A major benefit of choosing to develop a mobile friendly web application is that it's available across all devices. In practice, this doesn't quite live up to the theory, but that doesn't mean it can't in the future.

One reason these device web browser APIs matter is because they open up the doors to create apps that can actually interact with the various pieces of hardware in your phone. Traditionally you can only gain access to these devices through Android and iOS app programming interfaces. Here is one example called the DeviceOrientationEvent. There are also the Sensor APIs which are similar but can provide access to different sensors and follow a different set of permission rules that enable asking users for access to these sensors.

The major barriers towards making these APIs well-supported and widely available is probably due to the fact that this would democratize app development. You would no longer need to go through the "*le" store mafias and have them take significant cuts of the revenue that your app generates. For that reason those who develop the devices probably won't care about compliance to these standards. They have huge financial incentive to not democratize the process. But I believe this is something we should strive for. As such I plan to research these standards more and in particular find out more about the working groups for these standards. The devices in our pockets are without a doubt powerful tools, and I would like to see them be more customizable and easier to build apps for.

Asides: