Programming

Turn a website into an Android app: Capacitor

Capacitor opens the site in a WebView. Play wants an AAB, and a new account needs closed testing.

All lessons · JavaScript lessons: learn from scratch

What Capacitor does

React Native and Expo rewrite the app from scratch. Rewriting a large site takes a long time. Capacitor puts the existing site inside an Android shell, in a WebView. If it opens the site's address, the page changes together with the site. When the shell itself changes, a new AAB must be uploaded to the store. The store does not update by itself.

The commands

The project folder needs Node.js. init asks for a name and a package id. copy moves the build result into the Android folder. open starts Android Studio. There, Build, Generate Signed Bundle produces the .aab. Play does not accept the old .apk.

npm install @capacitor/core @capacitor/cli
npx cap init
npm install @capacitor/android
npx cap add android
npm run build
npx cap copy
npx cap open android

Play and closed testing

At play.google.com/console the account is opened with a one-time fee and an identity check. A new personal account cannot open the app to everyone at once. First there is closed testing: at least 20 different people, for 14 days. Create your own Google Group and add those people there. The same phone and fake accounts do not count, and the period can reset. When 14 days end, the Production button may still not open by itself. Read the condition in the Console.

Questions

The site is visible but there is no internet? Write the internet permission into AndroidManifest.xml.

Why must the AAB be signed? If you lose the keystore password, you cannot upload an update to that app. Keep the file and the password.

Why do 20 testers not count? The same device and the same account are one person. Google checks a real sign-in.

<uses-permission android:name="android.permission.INTERNET" />

Author: Nibras Code