Android物联网应用程序开发(智慧城市)—— 购物信息的存储界面开发

简介: Android物联网应用程序开发(智慧城市)—— 购物信息的存储界面开发

效果:

75.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="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context=".GoodsInfo">
    <RelativeLayout
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_margin="30dp"
        android:background="  #B0C4DE">
        <TextView
            android:id="@+id/text1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_alignParentRight="true"
            android:layout_marginLeft="50dp"
            android:layout_marginTop="30dp"
            android:text="订单号:201508260528"
            android:textColor="@android:color/holo_red_light"/>
        <TextView
            android:id="@+id/text2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignLeft="@id/text1"
            android:layout_below="@id/text1"
            android:layout_marginTop="8dip"
            android:text="收货人:杨明金"
            android:textColor="@android:color/holo_red_light"/>
        <TextView
            android:id="@+id/text3"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignLeft="@id/text1"
            android:layout_below="@id/text2"
            android:layout_marginTop="8dip"
            android:textColor="@android:color/holo_red_light"
            android:text="联系电话:182142XXXX"/>
        <TextView
            android:id="@+id/text4"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignLeft="@id/text1"
            android:layout_below="@id/text3"
            android:layout_marginTop="8dip"
            android:textColor="@android:color/holo_red_light"
            android:text="收货地址:云南省昆明市五华区128号"/>
        <TextView
            android:id="@+id/text5"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignLeft="@id/text1"
            android:layout_below="@id/text4"
            android:layout_marginTop="8dip"
            android:textColor="@android:color/holo_red_light"
            android:text="总金额:114"/>
        <TableLayout
            android:id="@+id/tableLayout1"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_alignLeft="@id/text1"
            android:layout_below="@id/text5"
            android:layout_centerVertical="true"
            android:layout_marginTop="5dp"
            android:layout_marginRight="8dip"
            android:background="#ffcccccc">
            <TableRow
                android:id="@+id/tableRow1"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:background="#ffffcc99"
                android:layout_margin="1dip">
                <TextView
                    android:layout_width="0.0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="2"
                    android:text="商品名称"
                    android:textColor="@android:color/holo_red_light" />
                <TextView
                    android:layout_width="0.0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="2"
                    android:text="商品数量"
                    android:textColor="@android:color/holo_red_light" />
                <TextView
                    android:layout_width="0.0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:text="单价"
                    android:textColor="@android:color/holo_red_light" />
                <TextView
                    android:layout_width="0.0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="5"
                    android:text=""
                    android:textColor="@android:color/holo_red_light" />
            </TableRow>
            <TableRow
                android:id="@+id/tableRow2"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content">
                <TextView
                    android:layout_width="0.0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="2"
                    android:text="伊利轻牛奶"
                    android:textColor="@android:color/white"/>
                <TextView
                    android:layout_width="0.0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="2"
                    android:text="50"
                    android:textColor="@android:color/white"/>
                <TextView
                    android:layout_width="0.0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:text="2"
                    android:textColor="@android:color/white"/>
                <TextView
                    android:layout_width="0.0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="5"
                    android:text="伊利轻牛奶"
                    android:textColor="@android:color/white"/>
            </TableRow>
        </TableLayout>
    </RelativeLayout>
    <Spinner
        android:id="@+id/spinner"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@id/tableLayout1"
        android:layout_marginTop="10dp"
        android:layout_alignRight="@id/tableLayout1"/>
    <Button
        android:layout_width="30dp"
        android:layout_height="30dp"
        android:layout_alignRight="@id/tableLayout1"
        android:layout_below="@id/spinner"
        android:layout_marginTop="10dp"/>
</LinearLayout>
相关实践学习
阿里云AIoT物联网开发实战
本课程将由物联网专家带你熟悉阿里云AIoT物联网领域全套云产品,7天轻松搭建基于Arduino的端到端物联网场景应用。 开始学习前,请先开通下方两个云产品,让学习更流畅: IoT物联网平台:https://iot.console.aliyun.com/ LinkWAN物联网络管理平台:https://linkwan.console.aliyun.com/service-open
相关文章
|
存储 API 文件存储
47. 【Android教程】SharedPreferences 存储
47. 【Android教程】SharedPreferences 存储
312 2
|
传感器 监控 安全
创新无限:物联网技术在智慧城市构建中的前沿探索
【10月更文挑战第29天】在这个信息爆炸的时代,物联网(IoT)技术正重塑我们对城市的认知。智慧城市已从科幻走向现实,物联网通过连接各种设备和传感器,收集、分析数据,提升城市运行效率和居民生活质量。从智慧城管、智能交通、智慧水务到智能电网,物联网的应用正逐步实现城市的智能化、互联化和可持续发展。
456 1
|
传感器 物联网 人机交互
物联网:物联网,作为新一代信息技术的重要组成部分,通过智能感知、识别技术与普适计算等通信感知技术,将各种信息传感设备与互联网结合起来而形成的一个巨大网络,实现了物物相连、人物相连,开启了万物互联的新时代。
在21世纪,物联网(IoT)作为新一代信息技术的核心,正以前所未有的速度重塑生活、工作和社会结构。本文首先介绍了物联网的概念及其在各领域的广泛应用,强调其技术融合性、广泛的应用范围以及数据驱动的特点。接着,详细阐述了物联网行业的现状和发展趋势,包括政策支持、关键技术突破和应用场景深化。此外,还探讨了物联网面临的挑战与机遇,并展望了其未来在技术创新和模式创新方面的潜力。物联网行业正以其独特魅力引领科技发展潮流,有望成为推动全球经济发展的新引擎。
|
传感器 自动驾驶 物联网
5G+物联网:构建智慧城市的新基石
【9月更文挑战第4天】5G+物联网作为构建智慧城市的新基石,正引领着城市管理的智能化变革。随着技术的不断成熟和应用场景的不断拓展,智慧城市将变得更加智能、高效和可持续。然而,我们也应看到,智慧城市的建设还面临着数据安全、隐私保护等挑战。未来,我们需要加强技术创新和法规建设,确保智慧城市在快速发展的同时,也能够保障人民的安全和权益。
|
存储 安全 API
Android经典实战之存储方案对比:SharedPreferences vs MMKV vs DataStore
本文介绍了 Android 开发中常用的键值对存储方案,包括 SharedPreferences、MMKV 和 DataStore,并对比了它们在性能、并发处理、易用性和稳定性上的特点。通过实际代码示例,帮助开发者根据项目需求选择最适合的存储方案,提升应用性能和用户体验。
1274 1
|
机器学习/深度学习 人工智能 算法
在这个智能设备云集的时代,物联网就像一场盛大的派对,设备们交流信息,共舞一曲
在这个智能设备云集的时代,物联网就像一场盛大的派对,设备们交流信息,共舞一曲。机器学习与人工智能则是派对上的指挥家,让设备学会理解用户习惯,如智能空调调节温度;赋予设备自主决策力,如智能安防识别异常;并拓展至农业、交通等更多领域,创造更智能的世界。通过简单的温度预测代码示例,我们得以窥见机器学习在物联网中的无限可能。
139 2
|
传感器 物联网 数据挖掘
物联网在智慧城市交通管理系统中的应用
物联网在智慧城市交通管理系统中的应用
736 1
|
机器学习/深度学习 人工智能 算法
物联网(IoT)就像是一个大型派对,无数的设备都在欢快地交流着信息
【9月更文挑战第4天】在这个万物互联的时代,物联网(IoT)犹如一场盛大的派对,各类设备欢聚一堂。然而,如何让这些设备互相理解并协同工作呢?这就需要机器学习与人工智能的助力。例如,智能空调通过学习你的使用习惯来调节温度,使你更加舒适;智能安防系统则能识别异常行为并及时报警,保障家庭安全。此外,智能农业、交通等领域也因机器学习和人工智能的应用变得更加高效。下面通过一个简单的温度预测代码示例,展示机器学习在物联网中的实际应用,让我们一起感受其强大潜力。
310 0
|
传感器 物联网 数据安全/隐私保护
智慧城市中的环境监测:物联网的角色
【6月更文挑战第6天】智慧城市中的物联网技术在环境监测中发挥关键作用,如路灯上的传感器实时监测空气质量和气候,智能垃圾桶自动检测垃圾容量。物联网使环境监测更全面、精准,但需解决数据安全、设备可靠性和标准统一等问题。随着科技发展,未来智慧城市将因物联网变得更加绿色宜居,环境监测将与城市各领域深度融合。我们期待科技带来的惊喜变革,为建设美好城市努力。
422 2
|
存储 监控 Java
Android Service之设备存储空间监控 DeviceStorageMonitorService
Android Service之设备存储空间监控 DeviceStorageMonitorService
507 2

相关产品

  • 物联网平台