This directory contains all the code necessary to build the FDA MyStudies Android application for study participants. Customization of the build.gradle
, api.properties
and strings.xml
files will enable your Android application to interact with the other components of your FDA MyStudies deployment. Further customization of app branding can be accomplished by replacing the default application images with your own. All configuration related to the creation and operation of studies is done using the Study builder
without need for code changes or redeployment of the mobile application.
The FDA MyStudies Android application requires Android Studio and can be run on Android versions starting from Kitkat.
The FDA MyStudies mobile application fetches all study, schedule, activity, eligibility, consent and notification information from the Study datastore
and posts pseudonymized participant response data to the Response datastore
. Consent forms and any other identifiable data is posted to the Participant datastore
. Email and password authentication is handled by the MyStudies Auth server
using OAuth 2.0 and Hydra
.
- Set the
applicationId
inAndroid/app/build.gradle
to your Application ID - Modify
Android/api.properties
to match the configuration of your backend services - Update the following in the
Android/app/src/fda/res/values/strings.xml
file:- Set
deeplink_host
to redirect to the app from theHydra
auth server (for example,app://mystudies.<your-domain>/mystudies
- more information about deep links within Android applications is located here) - Set
google_maps_key
to the API key obtained following the instructions located here - Set
package_name
andapp_name
to correspond to a value you define forapplicationId
inAndroid/app/build.gradle
(details) - Customize user-facing text strings as necessary
- Set
- Configure push notifications
- Go to the Firebase console and select the project you configured for Cloud Firestore during
Response datastore
deployment - Register your Android app in the Cloud Messaging section of the Firebase console (the
Android package name
is theapplicationID
value in theAndroid/app/build.gradle
file) - Download the
google-services.json
file from the Firebase project settings page and replaceAndroid/app/src/fda/google-services.json
- Go to the Firebase console and select the project you configured for Cloud Firestore during
- Configure your
Participant datastore
instance to interface with your mobile application- Make a copy of the
participant-datastore/sqlscript/mystudies_app_info_update_db_script.sql
and update the values to match your Android configuration - Optionally, configure the iOS fields to match your iOS configuration (not necessary if you are not configuring an iOS application)
- Run your updated
mystudies_app_info_update_db_script.sql
script on themystudies_participant_datastore
database that you created duringParticipant datastore
deployment (instructions)
- Make a copy of the
- Optional. Customize images and text
- Replace images at the appropriate resolution in the
Android/app/src/fda/res/
directories:mipmap-hdpi
,mipmap-mdpi
,mipmap-xhdpi
,mipmap-xxhdpi
,mipmap-xxxhdpi
,drawable-560dpi
,drawable-xhdpi
,drawable-xxhdpi
,drawable-xxxhdpi
- Customize user-facing text in the
Android/app/src/main/res/values/strings.xml
file
- Replace images at the appropriate resolution in the
- Open the
Android/
directory that contains your modifications as an existing project in Android Studio - If necessary, install the Android 10 SDK using Tools → SDK Manager, then File → Sync Project with Gradle Files (do not update Gradle plugin)
To build and run your FDA MyStudies application, follow the instructions here.
To distribute your application to users, review the options here.
Copyright 2020 Google LLC