Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Note: If you previously installed a global react-native-cli, please remove it as it may cause unexpected issues: [sudo] npm remove -g react-native-cli

Development Setup

  1. Clone project to your development workspace

    Code Block
    git clone https://github.com/OpenTeleRehab/patient-service.git ~/dev/docker-projects/hiv/patient-app
  2. Navigate to project root directory

    Code Block
    cd ~/dev/docker-projects/hiv/patient-app
  3. Run yarn to install node packages

    Code Block
    yarn install
  4. Configure settings.js

    Code Block
    cp config/ansible/roles/deploy/templates/settings.js.j2 config/settings.js

    Edit file and replace/add value for:

    • isDebugMode = true // or false if you want to disable redux log print out

    • Set patient api URL apiBaseURL: 'http://your-computer-ip:8084/api'

    • Set admin api URL adminApiBaseURL: 'http://your-computer-ip:8082/api'

    • appVersion = '1.0.0-local'

  5. Start JS server with Metro Bundler

    Code Block
    yarn start
  6. Start your local emulator or plug with real mobile device

Android

  1. Configure build.gradle

    Code Block
    cp config/ansible/roles/deploy/templates/build.gradle.j2 android/build.gradle

    Edit file and replace value for:

    • majorApkVersion = 1

    • minorApkVersion = 0

    • patchApkVersion = 0

    • classifierApkVersion = "local"

  2. Start your local emulator or plug with real mobile device

  3. Deploy development app to online testing device(s): adb devices

    Code Block
    yarn android

    Note: if you have problem with missing ndk, please follow this instruction: Install NDK and check required version in file android/build.gradle

Build released app

Android (.apk)

...