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>
相关实践学习
钉钉群中如何接收IoT温控器数据告警通知
本实验主要介绍如何将温控器设备以MQTT协议接入IoT物联网平台,通过云产品流转到函数计算FC,调用钉钉群机器人API,实时推送温湿度消息到钉钉群。
阿里云AIoT物联网开发实战
本课程将由物联网专家带你熟悉阿里云AIoT物联网领域全套云产品,7天轻松搭建基于Arduino的端到端物联网场景应用。 开始学习前,请先开通下方两个云产品,让学习更流畅: IoT物联网平台:https://iot.console.aliyun.com/ LinkWAN物联网络管理平台:https://linkwan.console.aliyun.com/service-open
相关文章
|
13天前
|
缓存 搜索推荐 Android开发
安卓开发中的自定义控件实践
【10月更文挑战第4天】在安卓开发的海洋中,自定义控件是那片璀璨的星辰。它不仅让应用界面设计变得丰富多彩,还提升了用户体验。本文将带你探索自定义控件的核心概念、实现过程以及优化技巧,让你的应用在众多竞争者中脱颖而出。
|
13天前
|
Java Android开发 Swift
安卓与iOS开发对比:平台选择对项目成功的影响
【10月更文挑战第4天】在移动应用开发的世界中,选择合适的平台是至关重要的。本文将深入探讨安卓和iOS两大主流平台的开发环境、用户基础、市场份额和开发成本等方面的差异,并分析这些差异如何影响项目的最终成果。通过比较这两个平台的优势与挑战,开发者可以更好地决定哪个平台更适合他们的项目需求。
54 1
|
14天前
|
Web App开发 安全 程序员
FFmpeg开发笔记(五十五)寒冬里的安卓程序员可进阶修炼的几种姿势
多年的互联网寒冬在今年尤为凛冽,坚守安卓开发愈发不易。面对是否转行或学习新技术的迷茫,安卓程序员可从三个方向进阶:1)钻研谷歌新技术,如Kotlin、Flutter、Jetpack等;2)拓展新功能应用,掌握Socket、OpenGL、WebRTC等专业领域技能;3)结合其他行业,如汽车、游戏、安全等,拓宽职业道路。这三个方向各有学习难度和保饭碗指数,助你在安卓开发领域持续成长。
42 1
FFmpeg开发笔记(五十五)寒冬里的安卓程序员可进阶修炼的几种姿势
|
12天前
|
缓存 搜索推荐 Android开发
安卓开发中的自定义控件基础与进阶
【10月更文挑战第5天】在Android应用开发中,自定义控件是提升用户体验和界面个性化的重要手段。本文将通过浅显易懂的语言和实例,引导你了解自定义控件的基本概念、创建流程以及高级应用技巧,帮助你在开发过程中更好地掌握自定义控件的使用和优化。
25 10
|
4天前
|
Linux API 开发工具
FFmpeg开发笔记(五十九)Linux编译ijkplayer的Android平台so库
ijkplayer是由B站研发的移动端播放器,基于FFmpeg 3.4,支持Android和iOS。其源码托管于GitHub,截至2024年9月15日,获得了3.24万星标和0.81万分支,尽管已停止更新6年。本文档介绍了如何在Linux环境下编译ijkplayer的so库,以便在较新的开发环境中使用。首先需安装编译工具并调整/tmp分区大小,接着下载并安装Android SDK和NDK,最后下载ijkplayer源码并编译。详细步骤包括环境准备、工具安装及库编译等。更多FFmpeg开发知识可参考相关书籍。
23 0
FFmpeg开发笔记(五十九)Linux编译ijkplayer的Android平台so库
|
12天前
|
Android开发 Swift iOS开发
探索安卓与iOS开发的差异:从代码到用户体验
【10月更文挑战第5天】在移动应用开发的广阔天地中,安卓和iOS两大平台各占半壁江山。它们在技术架构、开发环境及用户体验上有着根本的不同。本文通过比较这两种平台的开发过程,揭示背后的设计理念和技术选择如何影响最终产品。我们将深入探讨各自平台的代码示例,理解开发者面临的挑战,以及这些差异如何塑造用户的日常体验。
|
13天前
|
前端开发 搜索推荐 Android开发
安卓开发中的自定义控件实践
【10月更文挑战第4天】在安卓开发的世界里,自定义控件如同画家的画笔,能够绘制出独一无二的界面。通过掌握自定义控件的绘制技巧,开发者可以突破系统提供的界面元素限制,创造出既符合品牌形象又提供卓越用户体验的应用。本文将引导你了解自定义控件的核心概念,并通过一个简单的例子展示如何实现一个基本的自定义控件,让你的安卓应用在视觉和交互上与众不同。
|
9天前
|
消息中间件 存储 前端开发
资深Android开发的5个经典面试题
本文首发于公众号“AntDream”,欢迎关注。文章详细解答了五个常见的Android面试题,涵盖内存泄漏与溢出、Binder机制、MVC/MVP/MVVM架构、Handler机制及Context对象等内容,帮助读者深入了解Android开发的核心概念。
16 0
|
9天前
|
存储 安全 Android开发
探索Android开发之旅:从新手到专家的蜕变之路
【10月更文挑战第8天】在这篇文章中,我们将共同踏上一段激动人心的旅程,深入探索Android开发的奥秘。无论你是初涉编程世界的新手,还是渴望提升技能的开发者,这里都有你需要的知识与启示。通过简洁明了的语言和实际案例,我们将一起解锁Android开发的核心概念、掌握关键技能,并最终实现从新手到专家的华丽转变。
|
10天前
|
Android开发
Android开发显示头部Bar的需求解决方案--Android应用实战
Android开发显示头部Bar的需求解决方案--Android应用实战
13 0

相关产品

  • 物联网平台