网站大量收购独家精品文档,联系QQ:2885784924

Android 气预报简介.doc

  1. 1、本文档共21页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
Android 气预报简介

Android 谷歌天气预报 该项目是东方标准广州java培训中心为java技术开发学习人员和android技术开发班的学员共同开发研制的一款生活助手软件《》XmlPullParser等技术。 项目介绍 《》 2、功能说明 1)、【天气】功能: 显示当前天气情况。资料来自于互联网真实天气预报。 2)、【城市】功能: 显示当前所在城市。 3)、【温度】功能: 显示选择城市天气温度变化。资料来自互联网真实天气温度预告。 4)、【湿度】功能: 显示当地城市湿度 5)、【天气预测】功能:预测未来几天的天气状况。可以预测未来三天以内的天气资料。 6)、【更新日期】功能: 显示当前天气日期。 程序设计技术说明 本程序主要使用Service服务。Android开发中,当需要创建在后台运行的程序的时候,就要使用到Service。Service 可以分为有无限生命和有限生命两种。特别需要注意的是Service跟Activities是不同的(简单来说可以理解为后台与前台的区别),例如,如果需要使用Service的话,需要调用startService ,从而利用 startService 去调用Service中的OnCreate 和onStart 方法来启动一个后台的Service。XmlPullParser。同时还使用了监听器OnClickListener来进行监听动作。 程序部分主要代码1: // 更新UI线程 handler new Handler ; thread new Thread @Override public void run // 未完成ui更改 if !done // 加载完成 if WeatherService.finishLoad // 今天信息 tv_temp.setText 温度: + WeatherService.weather.getCurrent_temp_c + ℃ ; tv_city.setText 城市: + WeatherService.weather.getCity ; tv_weather .setText 天气: + WeatherService.weather .getCurrent_condition ; tv_humidity.setText WeatherService.weather .getCurrent_humidity ; tv_date.setText 更新日期: + WeatherService.weather.getForecast_date + + WeatherService.weather.getCurrent_day_of_week ; // 明天信息 tv_2ndday.setText WeatherService.weather .getForecast1_day_of_week ; tv_2ndweather.setText WeatherService.weather .getForecast1_condition ; tv_2ndtem.setText WeatherService.weather .getForecast1_low + ~ + WeatherService.weather.getForecast1_high + ℃ ; // 后天信息 tv_3rdday.setText WeatherService.weather .getForecast2_day_of_week ; tv_3rdweather.setText WeatherService.weather .getForecast2_condition ; tv_3rdtem.setText WeatherService.weather .getForecast2_low + ~ + WeatherService.weather.getForecast2_high + ℃ ; // 大后天信息 tv_4thday.setText WeatherService.weather .getForecast3_day_of_week ; tv_4thweather.setText WeatherService.weather .getForecast3_condition ; tv_4thtem.setText WeatherService.weather .getForecast3_low + ~ + WeatherService.weather.getForecast3_high + ℃ ; // 关闭服务 WeatherActivity.this.stopService intent ; Wea

文档评论(0)

ikangyme + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档