当前位置:   article > 正文

Android程序——天气预报_安卓设计天气系统

安卓设计天气系统

随着移动通信技术的发展和无线数据业务的进步,手机已被赋予了通话意外的其他许多功能。

本设计使用安卓 Android studio 设计技术开发了一种运用在 android 系统上的手机天气预报软件系统,本系统通过选择城市来获得天气,空气指数、气温等信息。基于手机的天气预报系统软件可以使用户对于各个天气预报情况的实时掌握,极大的方便了用户的出行和行程安排,避免了不必要的麻烦,具有很强的实用性。

关键词:Android studio、安卓、天气预报系统、天气预报

  • 程序设计思路APP 的主题与名称 

天气是能决定许多人一天情绪和日常关注的问题,在以前,许多因为突如其来的坏天气而让农作物被毁,以及在晴天时晾晒衣物,却被突如其来的磅礴大雨全部打湿。所以一款准确的天气预报的程序是非常需要的,“Weather Of Gu” app,是一款能够实时预知天气,以及预知未来天气的app,因本人姓氏原因,所以将软件命名为:“Weather Of Gu”。

APP 的页面设计 

根据当下年轻人的风格,程序使用相对青春的设计思路,大部分由ICON矢量图实现,界面简洁但又不能失去功能的完整性。

功能的设计

  1. 主页:用户能通过主页,知道当前的气温、湿度、天气情况、风力与风向,并且能够看见未来几天的天气情况和气温等。
  2. 关注:在当前选择的城市左上角,用户可以通过点击加号查询家人的城市,以及亲朋好友的城市方便用户能够快速进行查看。
  3. 主页列表:主页列表是用户当前城市,用户可以在这里看见当前所在城市当前的天气情况以及气温,还有湿度、生活指数还有未来七日的天气情况

编写软件:Android studio

使用技术:Java,xml,和风天气官方 API 接口,JSON

  1. 欢迎界面

XML

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3.     xmlns:app="http://schemas.android.com/apk/res-auto"
  4.     xmlns:tools="http://schemas.android.com/tools"
  5.     android:layout_width="match_parent"
  6.     android:layout_height="match_parent"
  7. android:background="@drawable/imag3"
  8.     tools:context=".activity.MainActivity">
  9.     <LinearLayout
  10.         android:orientation="vertical"
  11.         android:layout_width="match_parent"
  12.         android:layout_height="match_parent">
  13.         <TextView
  14.             android:gravity="center"
  15.             android:text="Weather Of Gu"
  16.             android:layout_width="match_parent"
  17.             android:layout_height="match_parent"/>
  18.     </LinearLayout>
  19. </FrameLayout>
  1. 主页

 

和风天气官网

 

Xml代码:

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3.     xmlns:app="http://schemas.android.com/apk/res-auto"
  4.     xmlns:tools="http://schemas.android.com/tools"
  5.     android:layout_width="match_parent"
  6.     android:layout_height="match_parent"
  7.     tools:context=".activity.WeatherActivity"
  8.     android:background="@drawable/img1">
  9.     <ImageView
  10.         android:id="@+id/bing_pic_img"
  11.         android:layout_width="match_parent"
  12.         android:layout_height="match_parent"
  13.         android:scaleType="centerCrop" />
  14.     <androidx.viewpager.widget.ViewPager
  15.         android:id="@+id/view_pager_weather"
  16.         android:layout_width="match_parent"
  17.         android:layout_height="match_parent"
  18.         android:layout_marginTop="55dp">
  19.     </androidx.viewpager.widget.ViewPager>
  20.     <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
  21.         android:id="@+id/swipe_refresh"
  22.         android:layout_width="match_parent"
  23.         android:layout_height="match_parent">
  24.         <ScrollView
  25.             android:id="@+id/weather_layout"
  26.             android:layout_width="match_parent"
  27.             android:layout_height="match_parent"
  28.             android:overScrollMode="never"
  29.             android:scrollbars="none">
  30.             <LinearLayout
  31.                 android:layout_width="match_parent"
  32.                 android:layout_height="wrap_content"
  33.                 android:fitsSystemWindows="true"
  34.                 android:orientation="vertical">
  35.                 <include layout="@layout/title" />
  36.                 <!--                    <include layout="@layout/title" />-->
  37.                 <include layout="@layout/now" />
  38.                 <include layout="@layout/aqi" />
  39.                 <include layout="@layout/forecast" />
  40.                 <include layout="@layout/suggestion" />
  41.             </LinearLayout>
  42.         </ScrollView>
  43.     </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
  44.     <LinearLayout
  45.         android:id="@+id/ll_round"
  46.         android:layout_width="match_parent"
  47.         android:layout_height="4dp"
  48.         android:layout_marginBottom="7dp"
  49.         android:orientation="horizontal"
  50.         android:
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/盐析白兔/article/detail/467987
推荐阅读
相关标签
  

闽ICP备14008679号