RADAR-base/radar-android-weather

Name: radar-android-weather

Owner: RADAR-CNS

Owner: RADAR-CNS

Description: Module for the Android Application to retrieve weather details for the phone's current location

Created: 2017-09-06 14:56:07.0

Updated: 2017-10-09 14:29:03.0

Pushed: 2018-02-05 16:25:13.0

Homepage: null

Size: 121

Language: Java

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Weather API

Application to be run on an Android 4.4 (or later) device.

This module requests current weather data from an external API and sends this to the backend. By default, the data is requested every three hours. In addition to basic weather metrics (temperature, pressure, humidity, precipitation), the module also sends the time of day of sunrise and sunset.

All data is based on the last known location of the phone. This location could be outdated. In order to prevent this, use this module in combination with the PhoneLocationProvider of the org.radarcns:radar_android-phone package.

The following weather API is implemented:

Installation

First, add the plugin code to your application:

sitories {
maven { url 'http://dl.bintray.com/radar-cns/org.radarcns' }


ndencies {
compile 'org.radarcns:radar-android-weatherapi:0.1-alpha.1'

Api Key

A valid api key for the external Weather API needs to be supplied. This key can be given through the remote config settings (weather_api_key) in the main Android Application or by adding a default in WeaterhApiProvider.WEATHER_API_KEY_DEFAULT.

The api key for access to OpenWeatherMap can be retrieved by signing up for free. Note that the free plan is subject to a maximum number of calls per minute and has a limited data update frequency.

Contributing

To add a new weather source, implement the WeatherApi interface and add its instantiation in the WeatherApiManager constructor.

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.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.