MCPcopy Create free account
hub / github.com/code-crusher/EasyWeather

github.com/code-crusher/EasyWeather @v1.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.2 ↗ · + Follow
170 symbols 252 edges 19 files 19 documented · 11% updated 7y agov1.2 · 2017-01-19★ 746 open issues

Browse by type

Functions 151 Types & classes 19
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

hero

Easy and quick weather fetching from OpenWeatherMap API for Android.


Specs

Bintray Twitter

Featured in

Concept Art

Concept Art

Screenshot

Screenshot

Integration


  • EasyWeather is available in the MavenCentral, so getting it as simple as adding it in dependencies of your build.gradle:
compile 'github.vatsal.easyweather:library:1.0.0'

Usage

First you would need API_KEY from OpenWeatherMap and place it in your build.gradle

buildTypes.each {
        it.buildConfigField 'String', 'OWM_API_KEY', "\"API_KEY\""
    }

First create WeatherMap object:

 WeatherMap weatherMap = new WeatherMap(this, OWM_API_KEY);

To get Current Weather use this in Activity:

By City Name:

weatherMap.getCityWeather(city, new WeatherCallback() {
            @Override
            public void success(WeatherResponseModel response) {
                Weather weather[] = response.getWeather();
                String weatherMain = weather[0].getMain();
            }

To get temperature in specific units you can use:

Double temperature = TempUnitConverter.convertToCelsius(response.getMain().getTemp());

To get other details you can use:

String location = response.getName();
String humidity= response.getMain().getHumidity();
String pressure = response.getMain().getPressure();
String windSpeed = response.getWind().getSpeed();
String iconLink = weather[0].getIconLink();
 ```
**By Location Coordinates**:
```Java
weatherMap.getLocationWeather(latitude, longitude, new WeatherCallback() {
            @Override
            public void success(WeatherResponseModel response) {

            }

            @Override
            public void failure(String message) {

            }
        });

To get Forecast use this in Activity also you need specify index to get the specific hour of 3 hour Forecast:

By City Name:

weatherMap.getCityForecast(city, new ForecastCallback() {
            @Override
            public void success(ForecastResponseModel response) {
                Weather weather[] = response.getList()[index].getWeather();
            }

            @Override
            public void failure(String message) {

            }
        });

By Location Coordinates:

weatherMap.getLocationForecast(latitude, longitude, new ForecastCallback() {
            @Override
            public void success(ForecastResponseModel response) {

            }

            @Override
            public void failure(String message) {

            }
        });
Variable Type
city String
index int
latitude String
longitude String

Issues

Feel free to submit issues and enhancement requests.

Contributing

I would love to welcome contributions and support from other developers. Please refer to each project's style guidelines and guidelines for submitting patches and additions. In general, i follow the "fork-and-pull" Git workflow.

  1. Fork the repo on GitHub.
  2. Clone the project to your own machine.
  3. Commit changes to development branch.
  4. Push your work back up to your fork.
  5. Submit a Pull request so that i can review your changes NOTE: Be sure to merge the latest from "upstream" before making a pull request!

License

Copyright 2016 Vatsal Bajpai

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Extension points exported contracts — how you extend this code

browse all types & interfaces →

Core symbols most depended-on inside this repo

browse all functions →

Shape

Method 151
Class 18
Interface 1

Languages

Java100%

Modules by API surface

library/src/main/java/github/vatsal/easyweather/retrofit/models/WeatherResponseModel.java26 symbols
library/src/main/java/github/vatsal/easyweather/retrofit/models/List.java18 symbols
library/src/main/java/github/vatsal/easyweather/retrofit/models/Sys.java14 symbols
library/src/main/java/github/vatsal/easyweather/retrofit/models/City.java14 symbols
library/src/main/java/github/vatsal/easyweather/retrofit/models/Main.java12 symbols
library/src/main/java/github/vatsal/easyweather/retrofit/models/ForecastResponseModel.java12 symbols
library/src/main/java/github/vatsal/easyweather/retrofit/models/Weather.java11 symbols
library/src/main/java/github/vatsal/easyweather/WeatherMap.java10 symbols
app/src/main/java/github/vatsal/easyweatherdemo/MainActivity.java8 symbols
library/src/main/java/github/vatsal/easyweather/retrofit/api/WeatherRetrofitCallback.java7 symbols
library/src/main/java/github/vatsal/easyweather/retrofit/models/Wind.java6 symbols
library/src/main/java/github/vatsal/easyweather/retrofit/models/Coord.java6 symbols

For agents

$ claude mcp add EasyWeather \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page