Documentation Index
Fetch the complete documentation index at: https://docs.solanamobile.com/llms.txt
Use this file to discover all available pages before exploring further.
PWAs on the dApp Store
Progressive Web Apps (PWAs) are web applications that use modern web capabilities to deliver an app-like experience to users. PWAs can be published on the dApp Store, as an Android app wrapped within a Trusted Web Activity (TWA).Trusted Web Activities (TWAs)
Trusted Web Activities (TWAs) allow you to package your PWA into an Android app. TWAs use Chrome to render the web app, providing a full screen, native-like experience without any browser UI. Once you create a TWA, you will have an Android APK file and you can follow the dApp publishing guide to submit the app. Follow the guide below to get your PWA ready for the dApp Store.Tutorial: Converting a PWA to an Android App
This guide shows you how to:- Install the Bubblewrap CLI tool
- Build the TWA and output an APK
- Generate the Digital Asset Link for the APK
Prerequisite
- A PWA web manifest hosted at
https://your-pwa-url.com/manifest.json
Template: Web Manifest
At minimum, a typical manifest file includes:- The app’s name
- The icons the app should use
- The URL that should be opened when the app launches
manifest.json on your website.
1. Installing Bubblewrap CLI
Bubblewrap CLI is a tool that simplifies the process of converting your PWA into an Android app using TWA. Requires Node 14.15.0 and above2. Initializing Your Project
In a new directory, run theinit command and supply the URL to your web manifest.
Bubblewrap will download the existing manifest and use it to help fill in metadata for the TWA’s manifest.
- See the Bubblewrap official documentation.
- If it asks to install additional tooling (e.g Android SDK, JDK, or build tools), it is necessary and you should allow it to install.
Manifest Configuration
It will also prompt a series of questions regarding configurations for:- Domain and URL path
- Ensure this points directly to where your PWA is hosted.
- Display mode and Status Bar settings
- See the Android documentation to see how Status Bar and Navigation Bars appear and decide what configuration is appropriate for your app.
- Splash Screen and Icons
- Create a cohesive splash screen by providing a splash screen color and an icon that displays over it.
- Keystore location and Password
- See Caution below.
- A
twa-manifest.jsonconfigured with the options from above. - TWA Android project files generated from
twa-manifest.json.
NOTE:The Android project is entirely generated from the
twa-manifest.json, so you only need to include
twa-manifest.json in source control. The Android project files are unncessary to track as they are generated.Any changes to the Android project will be deleted or overwritten by the update command (explained in the Updating your TWA section).3. Building the Android APK
Add supported langauges
Before running the build command, you need to specify the languages your app supports. In the generated Android project, edit thebuild.gradle and add:
Build the APK
The next step is to build initialized Android project and output a signed release APK. This APK is what you will submit for publishing on the dApp Store. In the same directory, run:- If it asks to install additional tooling (e.g Android SDK, JDK, or build tools), you should allow it to install.
4. Publish Digital Asset Links
The last step is to declare your app’s Digital Asset Links (DAL). DALs establish a secure connection between your website and the Android app. Declare the connection by adding the SHA256 fingerprints of your app’s signing certificate athttps://your-domain.com/.well-known/assetlinks.json.
Generate the DAL It should generate a file named
assetlinks.json file:assetlinks.json configured with the SHA256 fingerprint.Testing Your App
If you have an emulator or testing device ready, you can install the APK with:Updating your TWA
If you want to release a new version of the app with changes to the TWA manifest (e.g Updating the icon), you can make edits totwa-manifest.json and run the command:
twa-manifest.json and bumps the app version. The manifest is preserved, while any manual changes to the previous Android project are deleted or overwritten.
After this you can run bubblewrap build again to generate the signed release APK.
