Clone wiki

MobileCoach demonstration (Virtual Box) / Home

Demonstration of MobileCoach WebApp and Mobile Client apps for iOS and Android

Setting up the MobileCoach WebApp with our VirtualBox VM image

Requirements

  • Get Virtual box here.
  • Please use the Polybox link here to download a zip file that contains the VirtualBox image. Unzip the file to get the folder "MobileCoach_Server_VM".

Setting up the server

  • Start the VirtualBox and load the downloaded image into it. Start the machine.
  • Run ./ssh.sh in the terminal from the MobileCoach_Server_VM folder in the host machine to connect to the VM (password: pathmate). Troubleshooting: see below.
  • Run ./start.sh from the home folder. It will start tomcat, deepstream, and mongodb.
  • The server should then be available at http://localhost:8080/MC/admin and it opens the MC webapp. For logging in the webapp, the username is admin and the password is admin.
  • Run ./stop.sh to stop tomcat, deepstream, and mongodb.
  • Run ./shutdown.sh to stop tomcat, deepstream, and mongodb and shut down the VM.

Using the MobileCoach client

Requirements

Running the App

  • In the directory of the cloned repository, run rm -rf node_modules && npm install and react-native link.
  • In a separate terminal in the same folder, run react-native start.

For the iOS app

  • For iOS App, you need the latest version of XCode and the latest macOS.
  • Run react-native run-ios and it should start the ios simulator automatically if it is not open already.
  • Troubleshooting: See below.

For the Android app

  • For the Android App, you need the latest version of Android Studio including some target SDKs (currently we recommend: compileSdkVersion 26, buildToolsVersion 26.0.1, minSdkVersion 16, targetSdkVersion 22 in the Gradle file) and the Android SDK tools.
  • Then an Android virtual device (e.g. a Pixel with Android 7) should be created and started.
  • Switch to the mobile client folder and run ./android-reverse-ports.sh in the terminal.
  • Run react-native run-android.

Editing the configuration file (./App/AppConfig.js) of the MobileCoach client

  • Set useLocalServer as true to connect to local server (Eg. when connected through virtual box running locally).
  • Set interventionPattern to the name of the intervention. (Eg. interventionPattern = ‘TestIntervention’).
  • Set interventionPassword same as the deepstream password set in the MC webapp.

Additional information

  • You can find workshop slides and more information on MobileCoach 2.0 here.
  • The setup in this document is ideal for testing and getting familiar with the MobileCoach server and the Mobile Client app. It has some limitations, for example, embedding pictures or videos does not work because this needs https access to the server.
  • We are currently working on a docker setup for MobileCoach installation and use.

Troubleshooting

For the MobileCoach webapp setup

  • If mongo shows Failed global initialization: BadValue Invalid or no user locale set., then please set user locale by running export LC_ALL=C after logging into the server through the terminal.

For the iOS app

  • If you get an error with the package react-native-vector-icons,
    Run rm ./node_modules/react-native/local-cli/core/__fixtures__/files/package.json and
    re-run react-native start and react-native run-ios.

Updated