Your app, Powered by EXI Exercise Intelligence

Our personalised physical activity prescription, your app.

Get up and running with SDKs, API keys and integration tools.

EXI® Android Sample App

Add EXI® to your applications

To assist with your app development powered by EXI®, please see below for details of our sample app which will help accelerate your development journey.

Requirements

Android StudioElectric Eel or later
Device targetAndroid phone
Minimum Android SDK SupportedAPI 23 (Marshmallow)
Dependency managementThis project is using Gradle Kotlin DSL as well as the Plugin DSL to configure the build. Dependencies are centralised inside the buildSrc folder. This provides convenient auto-completion when writing your gradle files.
Quality controlKotlin Static Analysis via ktlint

Architecture

  • The project uses Kotlin with Jetpack Compose
  • The project has 2 branches:
    • master
    • development
  • The project contains the following modules:
    • app : the main module with the UI and the entry points to the application
    • exi-android-sdk: library module for EXISDK. this module is responsible for communicating with the EXI backend and returning appropriate response to the app
  • See here for sample app architecture/flow. The diagram below shows the flow for GetHealthConditions() functionality as an example, however the architecture is the same for all functionalities.
    • EXISDK
    • Result
    • BaseRepository
    • XFunctionalityRepository
    • XFunctionalityUseCase
    • UrlProvider
    • Ktor HttpClient

Testing

The app is tested with unit tests and instrumented tests.

Steps to build the sample app

1. Clone the source code

2. You can then run it like a standard Android project, or run ./gradlew assembleDebug. Further notes can be found here Build your app from the command line  |  Android Studio  |  Android Developers

3. Add a github.properties file to the root of the project.

4. Add a github.properties file to the root of the project.

gpr.user=<your github username>
gpr.key=<your github token>

5. Add a google-services.json file

{
 "project_info": {
   "project_number": "568390304166",
   "project_id": "exiskeletonapp-92229",
   "storage_bucket": "exiskeletonapp-92229.appspot.com"
 },
 "client": [
   {
     "client_info": {
       "mobilesdk_app_id": "1:568390304166:android:8167f6293a1783c4140f67",
       "android_client_info": {
         "package_name": "com.exi.app.qa"
       }
     },
     "oauth_client": [
       {
         "client_id": "568390304166-751thtpj1dq3tpguipma09kg67enkrbh.apps.googleusercontent.com",
         "client_type": 1,
         "android_info": {
           "package_name": "com.exi.app.qa",
           "certificate_hash": "673d7a2cbc8557a21a797a30a1b702dfd3827301"
         }
       },
       {
         "client_id": "568390304166-ot5icqiarc0mgc0jrk33kupdu13k1ik2.apps.googleusercontent.com",
         "client_type": 3
       }
     ],
     "api_key": [
       {
         "current_key": "AIzaSyDqXvQiGdfsT1wUUIMTO4GEatcJ7XioM0k"
       }
     ],
     "services": {
       "appinvite_service": {
         "other_platform_oauth_client": [
           {
             "client_id": "568390304166-ot5icqiarc0mgc0jrk33kupdu13k1ik2.apps.googleusercontent.com",
             "client_type": 3
           }
         ]
       }
     }
   }
 ],
 "configuration_version": "1"
}

6. Request for a member of the EXI® team to add your SHA1 fingerprint to the EXI® Firebase instance for the target build variant. See here for instructions on how to easily obtain your SHA1

Static Analysis

This project is using ktlint to format your code. To reformat all the source code as well as the buildscript, use command:

# Run lint and display issues
./gradlew ktlintCheck

To address the issues, run:

# Run lint and try to fix issues automatically (not all issues are fixable this way)
./gradlew ktlintFormat

Notes:

This readme and associated docs will undergo periodic review to help with the continuous improvement of our development processes and workflow.

Screenshots