Weather Warning

Get severe weathe warning in China, including typhoon, heat wave, cold wave, gale, heavy air pollution, wildfire, dust storms, droughts, lightning, hail, frost, heavy fog, etc.

Weather Warning #

Interface Code Interface Class
getWarning Weather Warning WarningBean

Parameter #

location

The city to be queried, support LocationID or comma-separated longitude and latitude, LocationID can be obtained by GeoAPI.

lang

Multi-language setting, default Chinese, only support Chinese and English for this data. Language parameter please refer to Language

Sample Code #

QWeather.getWarning(Context context, String location, final QWeather.OnResultWarningListener listener);

QWeather.getWarning(Context context, String location, Lang lang, final QWeather.OnResultWarningListener listener);

Properties #

Properties of WarningBean

Property Description Example
getCode Status code, please refer to Status Code 200
getBeanBaseList Disaster Warning List<WarningBeanBase>
getRefer Reference data, includes data source, statements and license Refer
getBasic Basic Information Basic

Refer

Property Description Example
getSourcesList Data source and other statements Weather China
getLicenseList Data license commercial license

Basic

Property Description Example
getUpdateTime Last updated time 2017-10-25 04:34
getFxLink Responsive web page of this location, easy to embed in your website or APP http://hfx.link/ae45

WarningBeanBase Warning Information

Property Description Example
getId The unique identifier of this warning, which can be used to determine whether this warning already exists.  
getPubTime Warning release time 2017-10-25 12:03
getTitle Title of warning information Shenzhen Meteorological Observatory of Guangdong Province issues yellow lightning warning
getStartTime Warning start time, may be null 2017-10-25 12:03
getEndTime End time of warning, may be null 2017-10-25 12:03
getStatus Warning status, may be null
active Early warning or first warning
update Warning information update
cancel cancel warning
active
getLevel Warning level yellow
getType Warning type Raiden
getText Detailed description of the warning Shenzhen Meteorological Bureau distributed a yellow warning signal for mine-laying electricity at 12:59 on October 04. Please pay attention to defense.

Warning City List #

Interface Code Interface Class
getWarningList Weather warning city list WarningListBean

Parameter #

range

Select the specified country, for now only supports range=cn

Sample Code #

/**
 * @param context context
 * @param listener network access callback interface
 */
QWeather.getWarningList(Context context, final QWeather.OnResultWarningListListener listener);

Properties #

Properties of WarningListBean

Property Description Example
getCode Status code, please refer to Status Code 200
getUpdateTime Last updated time 2017-10-25 12:34
getWarningBean Weather warning List<WarningListBean>

WarningListBeanBase Warning Information

Property Description Example
getLocationId Location ID 101280601