登录

  • 登录
  • 忘记密码?点击找回

注册

  • 获取手机验证码 60
  • 注册

找回密码

  • 获取手机验证码60
  • 找回
毕业论文网 > 毕业论文 > 计算机类 > 软件工程 > 正文

基于Android平台的天气预报软件设计与实现毕业论文

 2021-04-29 09:04  

摘 要

随着智能手机的快速发展,手机的功能已经不再仅限于打电话和发短信,越来越多的安卓应用出现在用户手机上,天气预报软件作为一款功能强大,占内存较小的软件亦吸引了大量的用户。传统的电视广播媒体在信息传播上具有很大的局限性,往往不能及时将天气信息传递给百姓,而手机则刚好弥补了这一缺点,因此,研究一款基于安卓平台的天气预报软件意义重大。
本文将对天气预报接口技术进行研究,包括天气预报信息的获取,对返回的字符串进行解析并存储。本设计是在安卓平台上开发一款手机天气预报软件,所有天气预报的内容均是来自于中国天气网,所以获取的信息需要向网站提供的接口发送请求。在使用接口的时候我们不必了解接口内的详细功能,只需要知道接口的功能即可,在这里我用到了两个接口,一个是全国城市查询接口,另一个是全国天气信息查询接口。第一个接口的功能是通过向网站发送请求可以依据请求里的code从网站获得全国省市县的数据,第二个接口的功能是:在找到需要查询的城市代码之后,通过向中国天气网发送包含城市代码的请求,可以从网站获得一个返回的字符串,这个字符串里就包含了该城市的各种天气情况。第二个需要应用到的技术就是解析字符串,由于字符串里的信息是以逗号分开的,所以通过预先了解字符串里各种信息的相对顺序,然后将分开的天气信息一次存储在文件中。在解析完成之后就可以将存入的数据以textview的形式显示到界面从而查询到天气信息。

这篇论文在上述技术的支持上成功完成了本课题的基本功能,而且对软件进行了试用,用户可以通过选择城镇查询到该地方的气象情况,温度等基本信息。基于android平台天气预报软件可以给用户提供实时天气情况信息,作为出行的参考,给用户的生产生活带来很大的便利,是一款实用性很强的软件。

关键字:安卓,天气预报,手机软件,天气查询,接口

ABSTRACT

With the rapid development of smart phones,mobile phones are no longer limited to the function of calling and send message,more and more android app appear on the user’s phone,weather forecast as a powerful software,software of small memory also attracted a large number of users.Traditional television media in the dissemination of information has great limitations, often can not be timely weather information to the people, but the phone is just to make this shortcoming. Therefore, the study of a based on the Android platform weather forecast software significance major.

In this paper, the weather forecast interface technology is studied, including the acquisition of weather forecast information, analyze and storage the return string . The design is the development of a mobile phone weather forecast software on Android platform, all the weather forecast is from the Chinese weather network, so the information needed to obtain the interface to send a request to the website. When using the interface we don't need to understand the detailed function within the interface, only need to know the function of the interface can be, here I use the two interfaces, a is national urban query interface, another is the weather information query interface. The first interface function is through to the site to send requests can be according to the request of code obtained from a site in provincial cities and counties nationwide data, the function of the second interface is: after finding the need to query the city code, through to China Weather Network to send contains city code request, can return a string from the site, the string contains the city for various weather conditions. The second one needs to be applied to the technology is to parse the string, because the string information is separated by commas, so by prior knowledge of the string in all kinds of information relative order, separately then weather information once stored in the file. After the completion of the analysis we can display the stored data to textview to query weather information.

This paper successfully achieve the implementation of the weather forecasting software design and Implementation based on android on the basis of technology in last paragraph, and the software was tested, the user can query city's weather by choosing a city, the temperature and other basic information. This software can provide users with real-time weather information, as a reference to travel, to bring great convenience to the user's production and life, is a very practical software.

KEY WORDS:Android, Weather Forecast, Mobile Phone Software, Weather Query, Interface

目 录

第1章 绪论 1

1.1 研究背景 1

1.2 目的和意义 1

1.3 国内外发展现状 1

第2章 Android概况 3

2.1 Android操作系统 3

2.2 Android发展史 3

2.3 系统架构 4

2.4 组件 4

2.5 布局管理器 5

2.5.1线性布局(LinearLayout) 5

2.5.2表格布局(TableLayout) 5

2.5.3帧布局(FrameLayout) 5

2.5.4相对布局(RelativeLayout) 5

2.6 Android数据存储 5

2.7 Android开发环境配置 6

2.7.1下载JDK并安装 6

2.7.2下载Android SDK并安装 6

2.7.3下载Eclipse和ADT并安装 7

2.7.4开发环境测试 7

第3章 需求分析 8

3.1 可行性分析 8

3.1.1经济可行性分析 8

3.1.2技术可行性分析 8

3.2 模块划分 8

第4章 系统设计及编码 10

4.1 模块分析 10

4.2 UI界面实现 10

4.3 城市信息获取 11

4.4 天气信息获取 15

4.5 天气信息显示 15

第5章 测试 17

5.1 地点选择页面 17

5.2 天气信息显示界面 17

结束语 19

参考文献 20

致谢 21

绪论

研究背景

随着科学的日益发展,手机价格逐年降低,而用途却是愈发的广泛,手机已经进入千家万户,并且给人们生产生活带来极大的便利,近年来智能手机发展迅猛,功能强大,手机的功能不再仅限于打电话和发短信,手机不再只有固定的功能,用户可以在手机上安装自己喜欢的软件来满足不同人的需求,其中安卓手机操作系统在现在的市场中独占鳌头。其中各种智能手机平台都有提供不同的天气预报软件,安卓系统作为主流手机操作体统自然也有提供手机天气预报软件的条件。

目的和意义

天气预报是把以往的大气中各种数据和最后的天气情况进行总结并得出规律,然后依照现在的天气信息推算出未来的天气情况。

在智能手机大规模推广之前,人们获取天气信息的方式大多是来自于电视和广播。这会有很大的局限性,人们很多时候并不能及时获得信息,如果错过了电视和广播,就无法得知第二天的天气信息了。相比较之下,在网络进入千家万户之后,天气预报软件优势马上体现出来了,这是一个十分有用的信息服务,用户只要有手机并连接网络就可以随时查看一个地区或者城市在接下来几天内阴晴雨雪、最高温最低温、风向和风速天气。科学的进步使天气预报的正确率愈发的高,人们对天气预报的可信赖度也是逐步提高。因此,研究设计出一款随时向用户提供实用信息,使人们生活更加方便,又尽量给用户节省流量的天气预报软件会更受用户的青睐。虽然国内外天气预报技术已经到了很高的水平,但是通过这次开发天气预报软件可以让我更好的学习安卓程序开发的流程和安卓中的工作原理。

国内外发展现状

天气预报的发展历史最早可以追溯到19世纪中叶英法两军与沙皇之间爆发的一场战争,这场海战导致了天气预报的出现。后来经过天气学家的努力,随着计算机和航天应用技术的发展,天气预报准确度越来越高,天气预报逐渐发展到现在的水平。

您需要先支付 80元 才能查看全部内容!立即支付

企业微信

Copyright © 2010-2022 毕业论文网 站点地图