Android studio入门到精通实例实验

这篇博客介绍了如何使用Android Studio进行简单的考试程序开发。首先,博主引导读者新建Android Studio项目,然后详细讲解了编写代码的过程,包括布局和活动类的设置。实验中涉及到的组件包括ConstraintLayout、TextView、RadioButton、CheckBox和Spinner等。最后,展示了程序运行的不同状态,如启动界面、错误反馈和考试通过的界面。
摘要由CSDN通过智能技术生成

Android studio入门到精通实例实验

实验内容:

----------------- 简单的考试程序----------------

实验步骤:

一、打开Android studio,新建一个项目;
在这里插入图片描述
在这里插入图片描述
二、写入代码;
在这里插入图片描述

<?xml version="1.0" encoding="utf-8"?>

<androidx.constraintlayout.widget.ConstraintLayout 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”
tools:context=".MainActivity">

<TextView
    android:id="@+id/textView2"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Android基础知识测评"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintHorizontal_bias="0.498"
    app:layout_constraintLeft_toLeftOf="parent"
    app:layout_constraintRight_toRightOf="parent"
    app:layout_constraintTop_toTopOf="parent"
    app:layout_constraintVertical_bias="0.058" />

<EditText
    android:id="@+id/et_on"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginStart="16dp"
    android:ems="3"
    android:inputType="textPersonName"
    app:layout_constraintBottom_toBottomOf="@+id/textView"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="@+id/textView"
    app:layout_constraintVertical_bias="0.615"
    android:layout_marginLeft="16dp" />

<TextView
    android:id="@+id/textView"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginTop="20dp"
    android:text="@string/di1ti"
    app:layout_constraintStart_toEndOf="@+id/et_on"
    app:layout_constraintTop_toBottomOf="@+id/textView2" />

<TextView
    android:id="@+id/textView3"
    android:layout_width="wra
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值