Giter Site home page Giter Site logo

packages_services_omnijaws's Introduction

About

OmniJaws "Just another weather service" is a minimized service to fetch weather data from OpenWeatherMap or Yahoo.

OpenWeatherMap API http://openweathermap.org/current

IMPORTANT: please request your own API key from OpenWeatherMap at https://openweathermap.org/appid#get and enter it here https://github.com/omnirom/android_packages_services_OmniJaws/blob/android-8.1/res/values/config.xml

Yahoo weather API https://developer.yahoo.com/weather/

Thanks to the original creators and contributors of the LockClock app https://github.com/CyanogenMod/android_packages_apps_LockClock

It provided a lot of insights and knowledge how to do this Some parts of the code like the provider access have been taken from it with minor modificatioons. Please check the file copyright headers for the origins of the files.

If you already include LockClock with your ROM you should consider if you really need this. The provider API is similiar and you dont need two different providers.

The default condition icon pack has also been extracted from LockClock

Client access

Here is a client code example using the content provider to access weather data https://github.com/omnirom/android_packages_services_OmniJaws/blob/android-8.1/src/org/omnirom/omnijaws/client/OmniJawsClient.java

Broadcasts and content observers

There are two ways to register for changes on weather data

Using ContentObserver on URI

content://org.omnirom.omnijaws.provider/weather

Using broadcasts

private static final String ACTION_BROADCAST = "org.omnirom.omnijaws.WEATHER_UPDATE";
private static final String ACTION_ERROR = "org.omnirom.omnijaws.WEATHER_ERROR";

Units

Depending on the value of the metric setting the following units are used to display the weather

Temperature:
metric = "C"
imperial = "F"

Wind speed:
metric = "km/h"
imperial = "mph"

Condition icon packs support

add activity with action "org.omnirom.WeatherIconPack" the name is used to defined the prefix for the image names default should be .weather.

		<activity
			android:name=".weather_vclouds"
			android:label="LockClock (vclouds)" >
			<intent-filter>
				<action android:name="org.omnirom.WeatherIconPack" />

				<category android:name="android.intent.category.DEFAULT" />
			</intent-filter>
		</activity>

An example can be found here https://github.com/maxwen/WeatherIconSample

Icons: Outline weather icon set is used with permission from http://emske.com/25-outline-weather-icons/

packages_services_omnijaws's People

Contributors

maxwen avatar andi34 avatar mracar07 avatar darkobas avatar eyosen avatar mydongistiny avatar

Watchers

James Cloos avatar  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.