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
相关文章
|
4天前
|
Linux 编译器 Android开发
FFmpeg开发笔记(九)Linux交叉编译Android的x265库
在Linux环境下,本文指导如何交叉编译x265的so库以适应Android。首先,需安装cmake和下载android-ndk-r21e。接着,下载x265源码,修改crosscompile.cmake的编译器设置。配置x265源码,使用指定的NDK路径,并在配置界面修改相关选项。随后,修改编译规则,编译并安装x265,调整pc描述文件并更新PKG_CONFIG_PATH。最后,修改FFmpeg配置脚本启用x265支持,编译安装FFmpeg,将生成的so文件导入Android工程,调整gradle配置以确保顺利运行。
24 1
FFmpeg开发笔记(九)Linux交叉编译Android的x265库
|
1天前
|
数据库 Android开发 开发者
安卓应用开发:构建高效用户界面的策略
【4月更文挑战第24天】 在竞争激烈的移动应用市场中,一个流畅且响应迅速的用户界面(UI)是吸引和保留用户的关键。针对安卓平台,开发者面临着多样化的设备和系统版本,这增加了构建高效UI的复杂性。本文将深入分析安卓平台上构建高效用户界面的最佳实践,包括布局优化、资源管理和绘制性能的考量,旨在为开发者提供实用的技术指南,帮助他们创建更流畅的用户体验。
|
2天前
|
存储 Java Android开发
Android系统 设置第三方应用为默认Launcher实现和原理分析
Android系统 设置第三方应用为默认Launcher实现和原理分析
16 0
|
18天前
|
XML 开发工具 Android开发
构建高效的安卓应用:使用Jetpack Compose优化UI开发
【4月更文挑战第7天】 随着Android开发不断进化,开发者面临着提高应用性能与简化UI构建流程的双重挑战。本文将探讨如何使用Jetpack Compose这一现代UI工具包来优化安卓应用的开发流程,并提升用户界面的流畅性与一致性。通过介绍Jetpack Compose的核心概念、与传统方法的区别以及实际集成步骤,我们旨在提供一种高效且可靠的解决方案,以帮助开发者构建响应迅速且用户体验优良的安卓应用。
|
20天前
|
监控 算法 Android开发
安卓应用开发:打造高效启动流程
【4月更文挑战第5天】 在移动应用的世界中,用户的第一印象至关重要。特别是对于安卓应用而言,启动时间是用户体验的关键指标之一。本文将深入探讨如何优化安卓应用的启动流程,从而减少启动时间,提升用户满意度。我们将从分析应用启动流程的各个阶段入手,提出一系列实用的技术策略,包括代码层面的优化、资源加载的管理以及异步初始化等,帮助开发者构建快速响应的安卓应用。
|
20天前
|
Java Android开发
Android开发之使用OpenGL实现翻书动画
本文讲述了如何使用OpenGL实现更平滑、逼真的电子书翻页动画,以解决传统贝塞尔曲线方法存在的卡顿和阴影问题。作者分享了一个改造后的外国代码示例,提供了从前往后和从后往前的翻页效果动图。文章附带了`GlTurnActivity`的Java代码片段,展示如何加载和显示书籍图片。完整工程代码可在作者的GitHub找到:https://github.com/aqi00/note/tree/master/ExmOpenGL。
22 1
Android开发之使用OpenGL实现翻书动画
|
监控
政法重点人员联防联控管理平台建设,智慧城市治安防控系统开发
政法重点人员联防联控管理平台实现了把基层人员纳入进来进行管理,整合全市现有的各领域、各部门、各条线的网格员队伍,使基层社会治理从粗放式﹑单一式向精细化、数据化转变,通过多网融合、一平台通管、“街乡吹哨,部门报到”、接诉即办、主动出击,从而推进社会治理创新、健全保障机制实现社会长效治理、提高管理和服务水平、打造更加和谐有序的小康社会。
158 1
|
安全 物联网 大数据
智慧城市建设呼唤“国家标准”
智慧城市建设呼唤“国家标准”
127 0
智慧城市建设呼唤“国家标准”
智慧城市建设正向高端发展 需循序渐进
智慧城市建设正向高端发展 需循序渐进
121 0
智慧城市建设正向高端发展 需循序渐进

相关产品

  • 物联网平台