Everyone keeps asking for this even though Add to Home works fine for mobile devices. In any case let's just do it and ship it off to the google play store. iOS version will follow in a subsequent diff.
- As per T1867 - this diff converts the Cashtab react codebase into an android mobile app using the Ionic Capacitor, which is a cross-platform app runtime that builds web apps that run natively in Android, iOS and the web.
- The integration of capacitor's android build workflow into the existing Cashtab build/deployment process will be looked at in a separate diff.
- The generated apk corresponding to this attached for reference
Android Prerequisites:
- Running npm install will now also install ionic cli and capacitor core / cli modules
Alternatively you can just manually install them:
npm install -g @ionic/cli
npm install @capacitor/core @capacitor/cli --save
- Download and install Android Studio (https://developer.android.com/studio)
- Update the CAPACITOR_ANDROID_STUDIO_PATH environment variable to point to the location of studio.sh in your installed android studio directory
echo export CAPACITOR_ANDROID_STUDIO_PATH="/home/[username]/[android studio installation]/bin/studio.sh" >> ~/.bashrc
Android Build:
- Build the Cashtab project (outputs to the build folder)
npm run build
- Convert the Cashtab build into an Android project (outputs to the android folder)
ionic capacitor add android
- Open android app in android studio (Gradle sync may take a few minutes on first load)
npx cap open android
- Make any necessary adjustments to app metadata (versioning)
- If you ever need to delete and rebuild the android folder, initialize Cashtab icon and splash screen branding by overwriting the default contents in '/web/cashtab/android/app/src/main/res/' with the contents of '/android/Cashtab-mobile-branding.zip'
- Open the build menu from Android Studio and build the APK for deployment
Select Build -> Build Bundle(s)/APK(s) -> Build APK(s)
- Install the APK onto a physical android mobile device