Giter Site home page Giter Site logo

tcchriszhao / radar-android-phone Goto Github PK

View Code? Open in Web Editor NEW

This project forked from radar-base/radar-android-phone

0.0 1.0 0.0 2.64 MB

Basic phone sensor plugin for RADAR passive remote monitoring app

License: Apache License 2.0

Java 100.00%

radar-android-phone's Introduction

DEPRECATION NOTICE

All plugin development has moved to https://github.com/RADAR-base/radar-commons-android in the plugins directory. Please view that directory for examples of a plugin.

Basic phone sensors RADAR-pRMT

A plugin for the RADAR pRMT app. The plugin can be used on an Android 5.0 (or later) device. This collects many types of data from an Android device.

Installation

First, add the plugin code to your application:

repositories {
    jcenter()
}

dependencies {
    runtimeOnly 'org.radarcns:radar-android-phone:0.2.0'
    runtimeOnly 'org.radarcns:radar-android-phone-usage:0.2.0'
    runtimeOnly 'org.radarcns:radar-android-phone-telephony:0.2.0'
}

Configuration

This plugin contains six services, to enable them add their provider to the device_services_to_connect property of the configuration:

In radar-android-phone:

  • .phone.PhoneSensorProvider provides a service that monitors Android hardware sensors.
  • .phone.PhoneLocationProvider provides a service that monitors current GPS and/or network location. Location data is gathered in a relative manner, adding a random reference offset to all locations. The reference offset is not transmitted. Because the GPS sensor is generally battery-heavy, there are separate parameters for location update frequency for low battery levels and higher battery levels.
  • .phone.PhoneBluetoothProvider provides a service that monitors bluetooth usage.
  • .phone.PhoneContactListProvider provides a service that monitors contact list size. Phone contacts themselves are not transmitted.

In radar-android-phone-usage:

  • .phone.PhoneUsageProvider provides a service that monitors application usage. Application usage events are only gathered for Android 5.1 and later. This package requires a package usage stats permission. For possible future permission restrictions by Google Play, only include this package if usage stats are actually required.

In radar-android-phone-telephony:

  • .phone.PhoneLogProvider provides a service that periodically reads the metadata of phone logs of SMSes and calls made. Phone numbers are irreversibly hashed before transmission. This package requires call log and SMS permissions. To prevent restrictions by Google Play, only include this package if call and SMS logs are actually required.

Sensors

The following Firebase parameters are available:

Parameter Type Default Description
PhoneSensorProvider
phone_sensor_default_interval int (ms) 200 Default interval between phone sensor polls. Set to 0 to disable sensors by default.
phone_sensor_gyroscope_interval int (ms) 200 Interval between phone gyroscope sensor polls. Set to 0 to disable.
phone_sensor_magneticfield_interval int (ms) 200 Interval between phone magnetic field sensor polls. Set to 0 to disable.
phone_sensor_steps_interval int (ms) 200 Interval between phone step counter polls. Set to 0 to disable.
phone_sensor_acceleration_interval int (ms) 200 Interval between phone acceleration sensor polls. Set to 0 to disable.
phone_sensor_light_interval int (ms) - Set to 0 to disable. Note that the light sensor registers every change of illuminance and can't be set to record in a specific interval
phone_sensor_battery_interval_seconds int (s) 600 (= 10 minutes) Interval between phone battery level polls.
PhoneLocationProvider
phone_location_gps_interval int (s) 3600 (= 1 hour) Interval for gathering location using the GPS sensor. Set this parameter and the next to 0 to disable GPS data gathering.
phone_location_gps_interval_reduced int (s) 18000 (= 5 hours) Interval for gathering location using the GPS sensor when the battery level is low.
phone_location_network_interval int (s) 600 (= 10 minutes) Interval for gathering location using network triangulation. Set this parameter and the next to 0 to disable network location gathering.
phone_location_network_interval_reduced int (s) 3000 (= 50 minutes) Interval for gathering location using network triangulation when the battery level is low.
phone_location_battery_level_reduced float (0-1) 0.3 (= 30%) Battery level threshold, below which to use the reduced interval configuration.
phone_location_battery_level_minimum float (0-1) 0.15 (= 15%) Battery level threshold, below which to stop gathering location data altogether.
PhoneContactListProvider
phone_contacts_list_interval_seconds int (s) 86400 (= 1 day) Interval for scanning contact list for changes.
PhoneBluetoothProvider
bluetooth_devices_scan_interval_seconds int (s) 3600 (= 1 hour) Interval for scanning Bluetooth devices.
PhoneUsageProvider
phone_usage_interval_seconds int (s) 3600 (= 1 hour) Interval for gathering Android usage stats.
PhoneLogProvider
call_sms_log_interval_seconds int (s) 86400 (= 1 day) Interval for gathering Android call/sms logs.

This produces data to the following Kafka topics (all types are prefixed with the org.radarcns.passive.phone package).

Topic Type
PhoneSensorProvider
android_phone_gyroscope PhoneGyroscope
android_phone_magnetic_field PhoneMagneticField
android_phone_step_count PhoneStepCount
android_phone_acceleration PhoneAcceleration
android_phone_light PhoneLight
android_phone_battery_level PhoneBatteryLevel
PhoneLocationProvider
android_phone_relative_location PhoneRelativeLocation
PhoneContactListProvider
android_phone_contacts PhoneContactList
PhoneBluetoothProvider
android_phone_bluetooth_devices PhoneBluetoothDevices
PhoneUsageProvider
android_phone_user_interaction PhoneUserInteraction
android_phone_usage_event PhoneUsageEvent
PhoneLogProvider
android_phone_call PhoneCall
android_phone_sms PhoneSms
android_phone_sms_unread PhoneSmsUnread

Contributing

Code should be formatted using the Google Java Code Style Guide, except using 4 spaces as indentation. Make a pull request once the code is working.

radar-android-phone's People

Contributors

blootsvoets avatar nivemaham avatar fnobilia avatar dependabot-support avatar faustoempatica avatar sboettcher avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.