android 实时画面传输,AndroidStudio实现数据传递和数据回传

本文主要是介绍android 实时画面传输,AndroidStudio实现数据传递和数据回传,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

前提

AndroidStudio版本:3.5.2

JDK版本:1.8.0

SDK版本:Android 4.4(KitKat)

AVD类型:Pixel2 API 19

内容

《宠物小精灵》

1、设计并完成三个页面之间的跳转

(1)创建三个Activity,观察Activity与View的关联方法和配置文件中的设置;

(2)为每个Activity设计一个显示页面,用以区分不同Activity,页面上设计Button用以控制跳转过程;

(3)利用Intent控制跳转过程,传递参数给下一个页面;

2、设计登录与商店模块

(1)在设计登录页面的基础上,增加新的Activity用于显示登录信息;

(2)设计商店页面,将商店物品的内容显示到Activity控制页面中;

(3)登录成功后,进入新的页面显示进度条显示宠物属性,设计“进入商店”Button跳转到第三个页面购买装备并把数据返回。

实现步骤

第一步:编写界面

首先创建一个名为Pokemon的应用程序,然后在activity_main.xml中设计用户交互界面的初始登录界面,在…/res/drawable中存放背景图片。

android:layout_width="match_parent"

android:layout_height="match_parent"

android:padding="10dp"

android:background="@drawable/beijing2">

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:text="欢迎来到宠物小精灵"

android:layout_margin="20dp"

android:textColor="#000000"

android:textSize="25sp"

android:gravity="center"/>

android:layout_width="100dp"

android:layout_height="100dp"

android:id="@+id/image"

android:layout_marginTop="100dp"

android:background="@drawable/xiaozhi"

android:layout_centerHorizontal="true"/>

android:id="@+id/et_name"

android:layout_width="300sp"

android:layout_height="50sp"

android:hint="用户名"

android:maxLines="1"

android:textColor="#000000"

android:textSize="20sp"

android:textStyle="bold"

android:layout_below="@id/image"

android:layout_marginTop="50dp"

android:layout_centerHorizontal="true"/>

android:id="@+id/et_password"

android:layout_width="300sp"

android:layout_height="50sp"

android:hint="密码"

android:maxLines="1"

android:textColor="#000000"

android:textSize="20sp"

android:textStyle="bold"

android:layout_below="@id/et_name"

android:layout_marginTop="10dp"

android:layout_centerHorizontal="true"/>

android:id="@+id/button1"

android:layout_width="200dp"

android:layout_height="50dp"

android:text="登录"

android:textSize="20sp"

android:gravity="center"

android:layout_below="@id/et_password"

android:layout_marginTop="30dp"

android:layout_centerHorizontal="true"/>

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:text="忘记密码 | 注册账号"

android:layout_alignParentBottom="true"

android:layout_marginBottom="60dp"

android:layout_centerHorizontal="true"/>

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:text="最终解释权归作者所有"

android:textSize="10dp"

android:layout_alignParentBottom="true"

android:layout_marginBottom="15dp"

android:layout_centerHorizontal="true"/>

d48c988af48f

其次在当前包中创建一个用于展示数据的Activity类,命名ShowActivity,并将布局文件指定为activity_show;在activity_show.xml中编写数据展示界面。

android:layout_width="match_parent"

android:layout_height="match_parent"

android:padding="10dp"

android:background="@drawable/beijing2">

android:layout_width="150dp"

android:layout_height="160dp"

android:id="@+id/image"

android:background="@drawable/penhuolong"

android:layout_marginTop="50dp"

android:layout_marginLeft="20dp"/>

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:id="@+id/ds_name"

android:text="用户名:"

android:textSize="16sp"

android:layout_marginTop="90dp"

android:layout_marginLeft="200dp"/>

android:layout_width="wrap_content"

android:layout_height=

这篇关于android 实时画面传输,AndroidStudio实现数据传递和数据回传的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/454586

相关文章

Linux下删除乱码文件和目录的实现方式

《Linux下删除乱码文件和目录的实现方式》:本文主要介绍Linux下删除乱码文件和目录的实现方式,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录linux下删除乱码文件和目录方法1方法2总结Linux下删除乱码文件和目录方法1使用ls -i命令找到文件或目录

SpringBoot+EasyExcel实现自定义复杂样式导入导出

《SpringBoot+EasyExcel实现自定义复杂样式导入导出》这篇文章主要为大家详细介绍了SpringBoot如何结果EasyExcel实现自定义复杂样式导入导出功能,文中的示例代码讲解详细,... 目录安装处理自定义导出复杂场景1、列不固定,动态列2、动态下拉3、自定义锁定行/列,添加密码4、合并

mybatis执行insert返回id实现详解

《mybatis执行insert返回id实现详解》MyBatis插入操作默认返回受影响行数,需通过useGeneratedKeys+keyProperty或selectKey获取主键ID,确保主键为自... 目录 两种方式获取自增 ID:1. ​​useGeneratedKeys+keyProperty(推

Spring Boot集成Druid实现数据源管理与监控的详细步骤

《SpringBoot集成Druid实现数据源管理与监控的详细步骤》本文介绍如何在SpringBoot项目中集成Druid数据库连接池,包括环境搭建、Maven依赖配置、SpringBoot配置文件... 目录1. 引言1.1 环境准备1.2 Druid介绍2. 配置Druid连接池3. 查看Druid监控

Linux在线解压jar包的实现方式

《Linux在线解压jar包的实现方式》:本文主要介绍Linux在线解压jar包的实现方式,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录linux在线解压jar包解压 jar包的步骤总结Linux在线解压jar包在 Centos 中解压 jar 包可以使用 u

Android kotlin中 Channel 和 Flow 的区别和选择使用场景分析

《Androidkotlin中Channel和Flow的区别和选择使用场景分析》Kotlin协程中,Flow是冷数据流,按需触发,适合响应式数据处理;Channel是热数据流,持续发送,支持... 目录一、基本概念界定FlowChannel二、核心特性对比数据生产触发条件生产与消费的关系背压处理机制生命周期

Android ClassLoader加载机制详解

《AndroidClassLoader加载机制详解》Android的ClassLoader负责加载.dex文件,基于双亲委派模型,支持热修复和插件化,需注意类冲突、内存泄漏和兼容性问题,本文给大家介... 目录一、ClassLoader概述1.1 类加载的基本概念1.2 android与Java Class

c++ 类成员变量默认初始值的实现

《c++类成员变量默认初始值的实现》本文主要介绍了c++类成员变量默认初始值,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧... 目录C++类成员变量初始化c++类的变量的初始化在C++中,如果使用类成员变量时未给定其初始值,那么它将被

SQL中如何添加数据(常见方法及示例)

《SQL中如何添加数据(常见方法及示例)》SQL全称为StructuredQueryLanguage,是一种用于管理关系数据库的标准编程语言,下面给大家介绍SQL中如何添加数据,感兴趣的朋友一起看看吧... 目录在mysql中,有多种方法可以添加数据。以下是一些常见的方法及其示例。1. 使用INSERT I

Qt使用QSqlDatabase连接MySQL实现增删改查功能

《Qt使用QSqlDatabase连接MySQL实现增删改查功能》这篇文章主要为大家详细介绍了Qt如何使用QSqlDatabase连接MySQL实现增删改查功能,文中的示例代码讲解详细,感兴趣的小伙伴... 目录一、创建数据表二、连接mysql数据库三、封装成一个完整的轻量级 ORM 风格类3.1 表结构