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
相关文章
|
15天前
|
XML API Android开发
码农之重学安卓:利用androidx.preference 快速创建一、二级设置菜单(demo)
本文介绍了如何使用androidx.preference库快速创建具有一级和二级菜单的Android设置界面的步骤和示例代码。
45 1
码农之重学安卓:利用androidx.preference 快速创建一、二级设置菜单(demo)
|
13天前
|
物联网 区块链 vr&ar
未来已来:探索区块链、物联网与虚拟现实技术的融合与应用安卓与iOS开发中的跨平台框架选择
【8月更文挑战第30天】在科技的巨轮下,新技术不断涌现,引领着社会进步。本文将聚焦于当前最前沿的技术——区块链、物联网和虚拟现实,探讨它们各自的发展趋势及其在未来可能的应用场景。我们将从这些技术的基本定义出发,逐步深入到它们的相互作用和集成应用,最后展望它们如何共同塑造一个全新的数字生态系统。
|
8天前
|
Android开发
Android经典实战之Textview文字设置不同颜色、下划线、加粗、超链接等效果
本文介绍了 `SpannableString` 在 Android 开发中的强大功能,包括如何在单个字符串中应用多种样式,如颜色、字体大小、风格等,并提供了详细代码示例,展示如何设置文本颜色、添加点击事件等,助你实现丰富文本效果。
43 3
|
29天前
|
Java 网络安全 开发工具
UNITY与安卓⭐一、Android Studio初始设置
UNITY与安卓⭐一、Android Studio初始设置
|
11天前
|
图形学 iOS开发 Android开发
从Unity开发到移动平台制胜攻略:全面解析iOS与Android应用发布流程,助你轻松掌握跨平台发布技巧,打造爆款手游不是梦——性能优化、广告集成与内购设置全包含
【8月更文挑战第31天】本书详细介绍了如何在Unity中设置项目以适应移动设备,涵盖性能优化、集成广告及内购功能等关键步骤。通过具体示例和代码片段,指导读者完成iOS和Android应用的打包与发布,确保应用顺利上线并获得成功。无论是性能调整还是平台特定的操作,本书均提供了全面的解决方案。
61 0
|
21天前
|
开发工具 Android开发
Android项目架构设计问题之外部客户方便地设置回调如何解决
Android项目架构设计问题之外部客户方便地设置回调如何解决
15 0
|
21天前
|
数据可视化 Java 数据挖掘
Android项目架构设计问题之设置RecyclerView的LayoutManager如何解决
Android项目架构设计问题之设置RecyclerView的LayoutManager如何解决
23 0
|
3天前
|
运维 供应链 物联网
未来已来:区块链、物联网和虚拟现实技术的融合与创新
在科技日新月异的今天,新兴技术如区块链、物联网(IoT)和虚拟现实(VR)正引领着一场前所未有的技术革命。本文将深入探讨这些技术的独特发展趋势和它们在未来社会中的潜在应用场景,揭示它们如何相互交织,共同塑造我们的工作和生活方式。通过分析具体案例,我们将看到这些技术如何超越传统界限,开启全新的创新之路。
|
11天前
|
安全 物联网 区块链
探索未来:区块链、物联网与虚拟现实技术的融合趋势
随着科技的不断进步,新兴技术如区块链、物联网和虚拟现实正逐渐融入我们的生活。本文将探讨这些技术的发展趋势和应用场景,以及它们如何相互融合,为我们的生活带来前所未有的便利和体验。让我们一起踏上这场科技之旅,感受新技术带来的无限可能!
|
6天前
|
供应链 安全 物联网
未来已来:区块链技术、物联网与虚拟现实的融合趋势
【9月更文挑战第4天】在科技的浪潮中,区块链、物联网(IoT)和虚拟现实(VR)作为三大前沿技术,正逐步从概念走向现实应用。本文将深入探讨这些技术的发展趋势,以及它们如何相互交织,形成全新的应用场景。我们将通过实际案例,揭示这些技术如何影响我们的工作、生活和社会结构,并展望它们未来的发展潜力。

相关产品

  • 物联网平台