Android物联网应用程序开发(智慧城市)—— 环境状态值范围设置界面开发

简介: Android物联网应用程序开发(智慧城市)—— 环境状态值范围设置界面开发

效果图:

74.png


代码:


布局:


<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="fill_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">
    <!--设置界面-->
   <LinearLayout
       android:layout_width="match_parent"
       android:layout_height="48dip"
       android:gravity="center"
       android:orientation="horizontal"
       android:background="@color/titleColor">
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textColor="@android:color/white"
        android:textSize="20sp"
        android:text="设置"/>
   </LinearLayout>
    <!--温度范围-->
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="5dip">
        <TextView
            android:layout_width="0.0dp"
            android:layout_height="wrap_content"
            android:layout_weight="4"
            android:gravity="center"
            android:text="温度范围"/>
        <EditText
            android:layout_width="0.0dp"
            android:layout_height="wrap_content"
            android:layout_weight="6"
            android:ems="10" />
        <TextView
            android:layout_width="0.0dp"
            android:layout_height="wrap_content"
            android:layout_weight="4"
            android:gravity="center"
            android:text="至" />
        <EditText
            android:layout_width="0.0dp"
            android:layout_height="wrap_content"
            android:layout_weight="6"
            android:layout_marginRight="50dip"
            android:ems="10"/>
    </LinearLayout>
    <!--湿度范围-->
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="5dp">
        <TextView
            android:layout_width="0.0dp"
            android:layout_height="wrap_content"
            android:layout_weight="4"
            android:layout_gravity="center"
            android:text="湿度范围"/>
        <EditText
            android:layout_width="0.0dp"
            android:layout_height="wrap_content"
            android:layout_weight="6"
            android:ems="10"/>
        <LinearLayout
            android:layout_width="0.0dp"
            android:layout_height="wrap_content"
            android:layout_weight="10"
            android:layout_marginRight="50dip">
        </LinearLayout>
    </LinearLayout>
    <!--光照范围-->
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="5dp">
        <TextView
            android:layout_width="0.0dp"
            android:layout_height="wrap_content"
            android:layout_weight="4"
            android:layout_gravity="center"
            android:text="光照范围"/>
        <EditText
            android:layout_width="0.0dp"
            android:layout_height="wrap_content"
            android:layout_weight="6"
            android:ems="10"/>
        <LinearLayout
            android:layout_width="0.0dp"
            android:layout_height="wrap_content"
            android:layout_weight="10"
            android:layout_marginRight="50dip">
        </LinearLayout>
    </LinearLayout>
    <!--CO:-->
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="5dip">
        <TextView
            android:layout_width="0.0dp"
            android:layout_height="wrap_content"
            android:layout_weight="4"
            android:layout_gravity="center"
            android:text="CO:"/>
        <EditText
            android:layout_width="0.0dp"
            android:layout_height="wrap_content"
            android:layout_weight="6"
            android:ems="10"/>
        <LinearLayout
            android:layout_width="0.0dp"
            android:layout_height="wrap_content"
            android:layout_weight="10"
            android:layout_marginRight="50dip">
        </LinearLayout>
    </LinearLayout>
        <!--按钮-->
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="48dip">
        <Button
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:text="保存"/>
        <Button
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:text="重置"/>
        <Button
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:text="取消"/>
    </LinearLayout>
</LinearLayout>
相关实践学习
钉钉群中如何接收IoT温控器数据告警通知
本实验主要介绍如何将温控器设备以MQTT协议接入IoT物联网平台,通过云产品流转到函数计算FC,调用钉钉群机器人API,实时推送温湿度消息到钉钉群。
阿里云AIoT物联网开发实战
本课程将由物联网专家带你熟悉阿里云AIoT物联网领域全套云产品,7天轻松搭建基于Arduino的端到端物联网场景应用。 开始学习前,请先开通下方两个云产品,让学习更流畅: IoT物联网平台:https://iot.console.aliyun.com/ LinkWAN物联网络管理平台:https://linkwan.console.aliyun.com/service-open
相关文章
|
2月前
|
监控 安全 Android开发
【新手必读】Airtest测试Android手机常见的设置问题
【新手必读】Airtest测试Android手机常见的设置问题
|
4月前
|
物联网
STC51单片机-实验开发装置仿真-物联网应用系统设计
STC51单片机-实验开发装置仿真-物联网应用系统设计
53 0
|
4月前
|
存储 物联网 大数据
助力工业物联网,工业大数据之脚本开发【五】
助力工业物联网,工业大数据之脚本开发【五】
40 0
|
4天前
|
存储 Java Android开发
Android系统 设置第三方应用为默认Launcher实现和原理分析
Android系统 设置第三方应用为默认Launcher实现和原理分析
18 0
|
3月前
|
存储 安全 数据管理
构建智慧家庭的未来:物联网平台与智能家居系统的开发
在数字化时代,物联网平台和智能家居系统的开发日益受到关注。本文将探讨物联网平台和智能家居系统的定义、优势以及开发过程中的挑战与解决方案。通过对智能家居系统的构建和物联网平台的应用,我们可以实现更加智能、高效和安全的生活环境。
|
3月前
|
网络安全 Android开发
2023安卓逆向 -- 抓包环境设置(Charles+Postern)
2023安卓逆向 -- 抓包环境设置(Charles+Postern)
33 0
|
4月前
|
XML 数据库 数据安全/隐私保护
Android App规范处理中版本设置、发布模式、给数据集SQLite加密的讲解及使用(附源码 超详细必看)
Android App规范处理中版本设置、发布模式、给数据集SQLite加密的讲解及使用(附源码 超详细必看)
43 0
|
4月前
|
XML Java Android开发
Android Studio App开发之通知渠道NotificationChannel及给华为、小米手机桌面应用添加消息数量角标实战(包括消息重要级别的设置 附源码)
Android Studio App开发之通知渠道NotificationChannel及给华为、小米手机桌面应用添加消息数量角标实战(包括消息重要级别的设置 附源码)
90 0
|
4月前
|
XML Java Android开发
Android Studio中视图基础之设置视图的宽高、间距、对齐方式的讲解与实战(附源码 超详细必看)
Android Studio中视图基础之设置视图的宽高、间距、对齐方式的讲解与实战(附源码 超详细必看)
74 0
|
5月前
|
边缘计算 供应链 安全

相关产品

  • 物联网平台