Page MenuHomePhabricator

[Cashtab] Android mobile app
AbandonedPublic

Authored by emack on Dec 2 2021, 08:57.

Details

Reviewers
bytesofman
Group Reviewers
Restricted Project
Summary

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:

  1. 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

  1. Download and install Android Studio (https://developer.android.com/studio)
  1. 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:

  1. Build the Cashtab project (outputs to the build folder)

npm run build

  1. Convert the Cashtab build into an Android project (outputs to the android folder)

ionic capacitor add android

  1. Open android app in android studio (Gradle sync may take a few minutes on first load)

npx cap open android

  1. Make any necessary adjustments to app metadata (versioning)
  1. 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'
  1. Open the build menu from Android Studio and build the APK for deployment

Select Build -> Build Bundle(s)/APK(s) -> Build APK(s)

  1. Install the APK onto a physical android mobile device
Test Plan
  • verify the eCash app icon is displayed correctly after installation
  • verify the Cashtab splash screen is displayed (less than a second) upon opening the app
  • test sending and receiving XEC
  • test import of ecash address via QR Code scan
  • test sending via USD denominations
  • test creating eTokens
  • test sending and receiving eTokens
  • test the Max send value button
  • test sending OP_RETURN message transactions
  • test importing / creating new wallets and switching between saved wallets
  • test signing messages
  • test biometric activation, minimise/login, and deactivation
  • make the mobile device low on space, verify wallet is not lost due to local storage eviction by Android OS

Diff Detail

Repository
rABC Bitcoin ABC
Branch
androidMobileApp
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 17657
Build 35140: Build Diffcashtab-tests
Build 35139: arc lint + arc unit

Event Timeline

emack requested review of this revision.Dec 2 2021, 08:57
bytesofman requested changes to this revision.Dec 2 2021, 23:36

Great idea!

I do not think we need to add the built app to to the monorepo -- looks like the code is generated by the existing source code? Is there some reason we would need to keep the built android code in?

Please refactor this diff so that

  • android/ is in the .gitignore
  • Documentation of how to build (above in this diff) is added to README.md in web/cashtab
  • New dependencies are added as dev dependencies

I'll get our dev account for the Play Store set up again.

This revision now requires changes to proceed.Dec 2 2021, 23:36
  • removed android/ build folder from monorepo and added to .gitignore
  • updated README.md in web/cashtab with environment setup and build instructions
  • dev dependencies updated in package.json to include the ionic capacitor libraries
  • app was successfully installed
  • icon on home screen appears fine, the "e" appears bigger compare to PWA

IMAGE 2021-12-03 13:58:18.jpg (1×576 px, 89 KB)

  • icon on splash screen was stretched. Happened so quick i could not capture the screen
  • the font of the domain migration message seems being stretched a little. Or maybe it's just my eyes.

IMAGE 2021-12-03 14:02:27.jpg (1×576 px, 37 KB)

  • no biometric support. Biometric works fine with PWA

IMAGE 2021-12-03 14:03:21.jpg (1×576 px, 39 KB)

  • everything else seems fine

IMAGE 2021-12-03 14:05:08.jpg (1×576 px, 66 KB)

Note that the migration message makes no sense in the context of a native mobile app

web/cashtab/.gitignore
33 ↗(On Diff #31244)

Restore the new line at end of file

emack marked an inline comment as done.
emack edited the summary of this revision. (Show Details)
  • APK attached under summary has been rebased to the latest master (2ba4b82) with the migration dialogue removed, including all the recent new features (e.g. token icons, send to all tx, reply to messages, refactored OP_RETURN parsing logic based on bytecounts)
  • @bytesofman - when creating a new token with icon, the icon server is returning a 'failed to fetch' error which I suspect is because it's not recognizing the request source being this app, since it's not coming from cashtab.com nor localhost:3000. Can the server delineate between calls from a mobile app vs a web app?
  • .gitignore updated

I'll do some testing with the api to whitelist the app. Let's also get D10687 and T2099 in before publishing this (to support scanning of prefixless but valid addresses, now used on some exchanges).

I think this is tabled for now. While it is possible to get Cashtab in the app store, I don't think we gain enough utility compared to RaiPay and AbcPay, already available in app stores and mobile native. Cashtab is designed for

  1. Interaction with web and web apps
  2. Open source showcase of eCash features

Will run into too many obstacles trying to produce and maintain this codebase on mobile. IMO the localstorage conflict is on its own too much of a hurdle, since other mobile-first wallets are available.

This revision now requires changes to proceed.Jan 24 2022, 20:32

Good proof of concept but Cashtab will stay web + extension first until better dev tools are built out

Please abandon