Firebase Remote Configuration

Firebase can be used to remotely configure some device and system parameters, e.g. the E4 API key, kafka server address and upload rate. The default parameters are also stored locally in app/src/main/res/xml/remote_config_defaults.xml, which will be used if the remote parameters cannot be accessed.

Setup

  1. Install the Firebase SDK in Android Studio.
  2. Login to a Google account.
  3. In the Firebase console, add the app (org.radarcns.android) to a new Firebase project.
  4. Download the google-services.json from the Firebase console (under Project Settings) and move the file to the common-android/ folder.
  5. [Optional] Set the parameter values on the server. The avaiable parameters can be found in app/src/main/res/xml/remote_config_defaults.xml. Note - Set the unsafe_kafka_connectionparameter to true if the server with kafka and schema-registry is using a self-signed certificate over SSL. If the certificate is issued by a valid CA then leave it to false. In production, do NOT set this value to true.

Full Firebase guide

Global app parameters

The configurable parameters can be found in remote_config_defaults.xml and are:

ParameterDescriptionDefault
device_services_to_connectSpace separated list of ServiceProviders  of the plugins to connect

.phone.PhoneSensorProvider 

.phone.PhoneLocationProvider 

.phone.PhoneLogProvider 

.phone.PhoneUsageProvider 

.application.ApplicationServiceProvider

start_at_bootStart the pRMT app when the phone starts?true
kafka_rest_proxy_urlURL where your instance of Kafka is running
schema_registry_urlURL where your schema registry is running
ui_refresh_rate_millisNumber of seconds between User Interface updates250 milliseconds (4Hz)
kafka_records_send_limitNumber of records to send per batch1000 records
kafka_upload_rateNumber of seconds between successive uploads to Kafka60 seconds
kafka_clean_ratePeriod for cleaning the cache1 hour
sender_connection_timeoutNumber of seconds after which the send request times out20 seconds
management_portal_urlURL where your instance of the Management Portal is running

Plugin parameters

Each plugin also has a separate set of parameters. For an overview of these parameters, please check the Readme of the plugin repository.