Application to be run on an Android 5 (or later) device. If Bluetooth devices are to be used, the Android device should support Bluetooth Low Energy (Bluetooth 4.0 or later).
To clone this respository, use the command
git clone https://github.com/RADAR-base/radar-prmt-android.git
app/src/main/res/xml/remote_config_defaults.xml. These are the configuration defaults for the app.
- Set the
schema_registry_url. If the app should not upload any data, leave them blank.
- Set the
device_group_idstring to a suitable user ID.
Get other possible parameters from the README of radar-commons-android and those from the plugins below.
This application depends on plugins to collect information. The application currently supports plugins the following plugins:
See the link to each plugin for its installation instructions. In general, a dependency needs to be added in build.gradle, and a service needs to be aded in the
device_services_to_connect property in
Setup 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.
- Install the Firebase SDK in Android Studio.
- Login to a Google account.
- In the Firebase console, add the app (
org.radarcns.android) to a new Firebase project.
- Download the
google-services.jsonfrom the Firebase console (under Project Settings) and move the file to the
- [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
trueif 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
To add additional plugins to this application, make the following steps (see the Phone plugin as an example):
- Add the schemas of the data you intend to send to the RADAR-base Schemas repository. Your record keys should be
org.radarcns.kafka.ObservationKey. Be sure to set the
org.radarcns.mydevicetypeso that generated classes will be put in the right package. All values should have
timeReceivedfields, with type
double. These represent the time in seconds since the Unix Epoch (1 January 1970, 00:00:00 UTC). Subsecond precision is possible by using floating point decimals.
- Create a new package
org.radarcns.mydevicetype. In that package, create classes that:
org.radarcns.android.device.DeviceManagerto connect to a device and collect its data.
org.radarcns.android.DeviceStateto keep the current state of the device.
org.radarcns.android.device.DeviceServiceto run the device manager in.
- subclass a singleton
org.radarcns.android.device.DeviceTopicsthat contains all Kafka topics that the wearable will generate.
- subclass a
org.radarcns.android.device.DeviceServiceProviderthat exposes the new service.
- Add a new service element to
AndroidManifest.xml, referencing the newly created device service.
- Add the
DeviceServiceProvideryou just created to the
This plugin can remain a separate github repository, but it should be published to Bintray for easy integration.
The guide for installing Android on Raspberry Pi3 and UDOO boards is available here