如何申请KEY自行百度,注意SHA1和包名一定要对上.
高德SDK包下载地址:http://download.csdn.net/detail/switch2010/8264611
1.实现AMapLocalWeatherListener接口,并重写onWeatherLiveSearched,onWeatherForecaseSearched方法
public class WeatherExecutor implements AMapLocalWeatherListener{
public WeatherExecutor() {
//在初始化时,执行定位并获取天气
LocationManagerProxy mLocationManagerProxy = LocationManagerProxy.getInstance(mContext);
mLocationManagerProxy.requestWeatherUpdates(LocationManagerProxy.WEATHER_TYPE_LIVE, this);
}