YWeatherGetter4a

Additional

Language
Java
Version
N/A
Created
Sep 14, 2012
Updated
Jan 15, 2019
Owner
Zhenghong Wang (zh-wang)
Contributors
Zhenghong Wang (zh-wang)
gokussjx
zhengzhou
Stane1983
4
Activity
Badge
Generate
Download
Source code

Announcement

  • Get a instance of YahooWeather class.

    ```java
    YahooWeather mYahooWeather = YahooWeather.getInstance();
    ```
    
  • Query by place's name. You can replace cityAreaOrLocation to what you want. For example, "Tokyo Japan", "Acaraù Brazil", "Shanghai China", etc.

    ```java
    public void queryYahooWeatherByPlaceName(final Context context, final String cityAreaOrLocation, final YahooWeatherInfoListener result)
    ```
    
  • Query by latitude and longitude

    ```java
    public void queryYahooWeatherByLatLon(final Context context, final String lat, final String lon, final YahooWeatherInfoListener result)
    ```
    
  • Or use device's gps to detect current location. ACCESS_FINE_LOCATION or ACCESS_COARSE_LOCATION is required.

    ```java
    public void queryYahooWeatherByGPS(final Context context, final YahooWeatherInfoListener result)
    ```
    
  • Other settings

    • You can set connect timeout and socket timeout by setConnectTimeout and setSocketTimeout. Or get the instance by getInstance(int connectTimeout, int socketTimeout).

    • If you use GPS position for query, the result WeatherInfo will contains an Address object, which is the detail address object return from Geocoder. It contains a lot of information but this lib only use locality, adminArea, and countryName by default. See YahooWeather.addressToPlaceName and Geocoder for details.

  • What kind of weather information can I get? You can get

  • Developed By

    Zhenghong Wang - viennakanon@gmail.com

    License

    Copyright 2017 Zhenghong Wang
    
    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.