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
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
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:
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'
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.
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.