In early 2021 I developed a memory game called Kobadoo as a PWA (Progressive Web App) using ReactJS. It works pretty well as a browser game and gets decent traffic, but I wanted to reach more potential users by making it available on the official mobile app marketplaces. Since I didn't want to spend any time coding a native app, the easiest solution I found was to convert the PWA into a TWA (Trusted Web Activities) app. It barely takes 5 minutes to do it.
TWA essentially allows you to easily create an Android app (.apk file) that displays a full-screen browser view of your PWA. The user experience is almost identical to a web app and the views from the TWA will count as traffic on your web app. This means that if you have ads on your PWA, they will still work (and generate revenue) from the TWA.
Another advantage is that every update you make on the PWA will be immediately reflected on the TWA without the need to submit a new version on Google Play.
Here's how I converted Kobadoo.com into an app on Google Play:
- Install, if you don't have them already, Node (v10 or higher), Java 8 and Android SDK.
- Install Bubblewrap on your command line using this command:
npm i -g @bubblewrap/cli - Initialize Bubblewrap using a publicly-accessible URL to your manifest.json:
bubblewrap init --manifest https://www.example.com/manifest.json - Fill in the prompted form. In most cases, the default value is the right one.
- If you need to specify a minimum or target Android SDK (API level), you can do it on the newly generated file /app/build.gradle under minSdkVersion and targetSdkVersion
- Build the TWA app using this command:
bubblewrap build - Test the app on your Android device using the newly created file app-release-signed.apk
- Submit the app on Google Play by uploading the newly created file app-release-bundle.aab