毕业论文 Android平台天气预报widget的设计与实现 摘要 本文对基于Android平台的widget开发技术进行了分析和研究。先简要介绍了Android开发必备基础知识,再切入软件的具体实现过程。 软件的实现是利用网络接口和Google API获取网络xml文件,然后通过xml文件解析取得城市天气预报信息。最终使用widget制作方法,利用RemoteViews等技术完成桌面部件。 关键词: Android;桌面小部件;天气预报 the design and implementation of weather forecasting widget on Android platform ABSTRACT This paper analyses and researches the development technique on the Android first introduce the basic knowledge that is necessary for Android then it introduce the concrete implementation of the software. The software work interface and Google API to get xml it parse the document to get the weather information of the I use technique such as RemotViews to implement the widget. Keywords: Android; widget; weather forecast 目录 第1章绪论 1 项目背景 1 研究现状 1 论文组织 2 第2章 ANDROID开发环境 3 Android开发环境搭建流程 3 安装Eclipse ADT Plugin插件 3 安装Android SDK 4 更新Adroid SDK 5 配置Android模拟器 6 开发工具Eclipse介绍 7 第3章 ANDROID程序设计基础 9 系统结构 9 应用程序 9 应用程序框架 10 库和运行环境 11 Android应用程序组成 11 Avtivity介绍 11 Broadcast Intent Receiver介绍 12 Service介绍 13 Content Provider介绍 13 Intent介绍 14 Android应用程序工程文件 16 第4章天气预报WIDGET的设计 18 网络功能实现 18 标准Java接口 18 Apache接口 19 使用Java接口连接网络 22 xml解析的实现 22 制作widget应用程序 26 源文件组织 28 类之间的协作 28 CurrentWeather类的实现 29 edit类的实现 30 WeatherHandle类的实现 30 第5章相关实现技术与体会 32 添加widget 32 RemoteViews的局限 33 在widget中显示图片 34 34 为widget中的按钮设置Onclick事件 35 利用Bundle实现消息的传递 36 在AppWidgetProvider类中获取Intent的附加信息 36 软件使用 37 结论 40 致谢 41 参考文献 42 绪论 项目背景 2009年1月7日,工业和信息化部为中国移动、中国电信和中国联通发放3张第三代移动通信牌照,此举标志着我国正式进入3G时代。中国3G正式商用和规模建网,决定了中国基于Android的应用程序开发将会处于一个蓬勃发展时期 Android是Google于07年11月5日宣布的基于Linux平台开源手机操作系统名称,号称是首个为移动终端打造的真正开放和完整的移动软件。它包括操作系统、用户界面和应用程序——移动电话工作所需的全部软件,而且不存在任何以往阻碍移动产业创新