##

As the web continues to evolve, Progressive Web Apps (PWAs) have become increasingly popular for their ability to provide an app-like experience without the need for native development. But what exactly are PWAs, and how can you bring them to the masses by publishing them in the Google Play Store?

Progressive Web Apps are web-based applications that meet specific criteria, such as being responsive, app-like, and offline-capable. With a single code base, PWAs run on any modern browser, desktop operating system, or mobile OS. Developers can deploy PWAs by uploading their source files to a server, no approval process required.

Users open a PWA by entering its URL in the browser, which then downloads the application's source files. The PWA uses a Service Worker to store a copy of the source files in a local cache, allowing it to continue working offline. PWAs typically follow the Single-Page Application (SPA) pattern, making them performant and native-app-like.

But why would developers want to publish their PWAs in app stores? For one, they may have existing apps with a large user base or expect users to search for their applications in the store. Alternatively, their competitors may already have a store app, making it essential to keep up.

Trusted Web Activities to the Rescue

Thanks to Trusted Web Activities (TWAs), developers can reuse their PWA deployment and create a Play Store package without writing native code. This is achieved by uploading an almost empty APK to the app store, which contains only a link to the website that should be shown. Backed by the android-browser-helper library, TWAs open a compatible browser and create a Custom Tab in which the PWA is hosted.

Bubblewrap: Simplifying TWA Generation

To simplify the process of generating a TWA, Bubblewrap is an open-source command-line tool that requires Node.js 10 or above, the Java Development Kit (JDK) 8, and the Android SDK installed on the system. Developers can install the CLI by calling npm i -g @bubblewrap/cli on the command line.

To create a new Bubblewrap project in the current directory, developers call bubblewrap init --manifest https://example.com/manifest.webmanifest, where --manifest points to the Web App Manifest of the PWA. Bubblewrap then downloads the manifest and launches an interactive assistant, asking for different properties the resulting Android application should have.

Compiling the APK

To compile an APK from the project, developers run the bubblewrap build command. As part of this process, Bubblewrap also validates the Progressive Web App by running it against the audit tool Lighthouse, which checks the correct usage of PWA features and other best practices. Additionally, Bubblewrap creates the assetlinks.json file that must be uploaded to the PWA's origin.

Conclusion

In conclusion, PWAs offer a seamless way for developers to create app-like experiences without the need for native development. By leveraging TWAs and tools like Bubblewrap, developers can simplify the process of publishing their PWAs in the Google Play Store. With the ability to update automatically and separately from the TWA, there's no reason not to give your PWA a shot at success!