Firebase Remote Configuration

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:

Parameter

Description

Default

Parameter

Description

Default

device_services_to_connect

Space separated list of ServiceProviders  of the plugins to connect

.phone.PhoneSensorProvider 

.phone.PhoneLocationProvider 

.phone.PhoneLogProvider 

.phone.PhoneUsageProvider 

.application.ApplicationServiceProvider

start_at_boot

Start the pRMT app when the phone starts?

true

kafka_rest_proxy_url

URL where your instance of Kafka is running

 

schema_registry_url

URL where your schema registry is running

 

ui_refresh_rate_millis

Number of seconds between User Interface updates

250 milliseconds (4Hz)

kafka_records_send_limit

Number of records to send per batch

1000 records

kafka_upload_rate

Number of seconds between successive uploads to Kafka

60 seconds

kafka_clean_rate

Period for cleaning the cache

1 hour

sender_connection_timeout

Number of seconds after which the send request times out

20 seconds

management_portal_url

URL 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.