【Android Studio学习】第一篇、制作一个拥有登录和注册功能的简易APP

news2025/7/18 9:06:01

目录

第一部分、前言

1、目标效果

2、准备知识

第二部分、详细步骤

1、新建Empty工程

​2、添加资源文件

3、搭建注册界面

4、搭建登录界面

 5、编写注册界面和登录界面的代码

6、设置APP初始界面

7、连接手机,编译工程

第三部分、总结

1、参考资料

2、完整工程和代码


第一部分、前言

        这段时间由于导师的任务安排,我需要做一个简易的APP,来接收单片机上传的数据,并画出数据的波形。因为之前搞过那种特别简单的APP(就新建一个工程就得到的那种APP),这次为了让APP看起来还算是个APP,所以这段时间就学了一下APP的登录和注册APP的底部导航栏的实现及应用APP画简易的波形图等。为了防止自己忘记,这次做了一些简易的笔记并将其分享出来,希望能够给你带来一点小小的灵感。

        那么这一篇文章先讲一下,小白如何从零做一个拥有登录和注册功能的APP

1、目标效果

        讲了那么多,首先来看一下这篇文章实现的功能视频是怎样的吧!

2、准备知识

        首先,你的电脑需要装上Android Studio这个软件,并且能够正常工作,关于软件的下载和安装可以百度,太多了,不做介绍。

        其次,目前我电脑上装的版本是Android Studio 3.5.2这还是2019版,已经有点老了,和目前最新的版本还是有点差距,所以小伙伴如果之前一点都没接触过这个软件,那么我还是建议你装最新版本的Android Studio,因为B站的大部分教学视频都是基于最新版本的。

        最后,对于这个软件完全陌生的小白,你先按照博客的方法一步一步来,如果按照我的方式实现不了效果的,我这里推荐两个干货入门视频,第一个是正哥的视频,第二个是我这篇文章参考的视频。(注意:如果按照博客的步骤往下走,各种文件名称尽量保持一致,这样不容易出错

 第一个、【7天Java0基础速成安卓开发】Day1 Android工程代码是怎么运行的_哔哩哔哩_bilibili

第二个、1 as布局介绍和重要文件说明_哔哩哔哩_bilibili

第二部分、详细步骤

1、新建Empty工程

第一步、新建一个Empty Activity工程

 第二步、新建完成后的界面

​2、添加资源文件

第一步、去values文件下的colors.xml文件添加这行代码

<color name="colorBlack">#000000</color>
<color name="colorBlue">#78BDF1</color>

第二步、保存下面这个图标,并将其添加到工程当中,命名为box

第三步、添加Drawable Resource文件,作为登录框的背景

命名为user_background

将文件内部代码,替换成以下代码

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
    <stroke
        android:width="1dp"
        android:color="@color/colorBlack"
        android:background="#CCCCCC"/>
    <corners
        android:radius="100dp"/>
</shape>

 得到最终的效果图

3、搭建注册界面

第一步、在com.example.myapplication文件夹下,新建一个Empty Activity

 第二步、将新的Activity命名为:LoginActivity,点击确认

 第三步、重复上述的步骤新建一个Activity,命名为RegisterActivity

 第四步、编写注册界面

 第五步、更改原始代码如下,目的是改为线性布局,且布局的排序方式为垂直

 第六步、注册界面布局代码

<?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=".RegisterActivity">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
        <TextView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:text="欢迎注册账号"
            android:textSize="35sp"
            android:gravity="center"
            android:textColor="@color/colorBlack"
            android:layout_marginTop="50dp"
            ></TextView>


    </LinearLayout>
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="20dp"
        android:layout_marginLeft="10dp"
        android:layout_marginRight="10dp"

        >
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:text="请输入用户名称:"
            android:layout_marginLeft="10dp"
            android:textSize="20sp"
            ></TextView>

        <EditText
            android:id="@+id/zhuce_user_name"
            android:layout_width="match_parent"
            android:layout_height="60dp"
            android:layout_marginRight="30dp"
            android:textColor="@color/colorBlack"
            android:maxLines="1"
            ></EditText>

    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="20dp"
        android:layout_marginLeft="10dp"
        android:layout_marginRight="10dp"
        >
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:text="请输入账户密码:"
            android:layout_marginLeft="10dp"
            android:textSize="20sp"
            ></TextView>

        <EditText
            android:id="@+id/zhuce_user_password"
            android:layout_width="match_parent"
            android:layout_height="60dp"
            android:layout_marginRight="30dp"
            android:textColor="@color/colorBlack"
            android:maxLines="1"
            android:inputType="textPassword"
            ></EditText>
    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="20dp"
        android:layout_marginLeft="10dp"
        android:layout_marginRight="10dp"
        >
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:text="请再次输入密码:"
            android:layout_marginLeft="10dp"
            android:textSize="20sp"
            ></TextView>

        <EditText
            android:id="@+id/zhuce_user_password_again"
            android:layout_width="match_parent"
            android:layout_height="60dp"
            android:layout_marginRight="30dp"
            android:textColor="@color/colorBlack"
            android:maxLines="1"
            android:inputType="textPassword"
            ></EditText>
    </LinearLayout>

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="40dp"
        android:layout_gravity="center">
        <Button
            android:id="@+id/zhuce_success"
            android:layout_width="200dp"
            android:layout_height="wrap_content"

            android:text="注册完成"
            android:textSize="25dp"
            android:textColor="@color/colorBlack"
            android:background="@color/colorBlue"

            ></Button>

    </LinearLayout>

</LinearLayout>

 第七步、最终效果

4、搭建登录界面

 第一步、登录界面的布局编写方式也和上面一样,复制下方代码

  第二步、登录界面布局代码

<?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=".LoginActivity">
    
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:layout_marginTop="50dp">
        <ImageView
            android:layout_width="64dp"
            android:layout_height="64dp"
            android:background="@mipmap/box"
            ></ImageView>

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="智能药箱"
            android:textColor="@color/colorBlack"
            android:textSize="30dp"
            ></TextView>
    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="20dp"
        android:layout_marginLeft="30dp"
        android:layout_marginRight="30dp"
        android:background="@drawable/user_background">
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:text="用户名:"
            android:layout_marginLeft="10dp"
            android:textSize="25sp"
            ></TextView>

        <EditText
            android:id="@+id/user_name"
            android:layout_width="match_parent"
            android:layout_height="60dp"
            android:layout_marginRight="30dp"
            android:textColor="@color/colorBlack"
            android:maxLines="1"
            ></EditText>
    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="20dp"
        android:layout_marginLeft="30dp"
        android:layout_marginRight="30dp"
        android:background="@drawable/user_background">
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:text="密   码:"
            android:layout_marginLeft="10dp"
            android:textSize="25sp"
            ></TextView>

        <EditText
            android:id="@+id/user_password"
            android:layout_width="match_parent"
            android:layout_height="60dp"
            android:layout_marginRight="30dp"
            android:textColor="@color/colorBlack"
            android:maxLines="1"
            android:inputType="textPassword"
            ></EditText>
    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="40dp"
        android:orientation="horizontal">
        <Button
            android:id="@+id/denglu"
            android:layout_width="0dp"
            android:layout_weight="1"
            android:layout_marginLeft="25dp"
            android:layout_height="wrap_content"
            android:text="登录"
            android:textSize="25sp"
            android:layout_gravity="center"
            ></Button>

        <Button
            android:id="@+id/zhuce"
            android:layout_width="0dp"
            android:layout_weight="1"
            android:layout_marginRight="25dp"
            android:layout_marginLeft="50dp"
            android:layout_height="wrap_content"
            android:text="注册"
            android:textSize="25dp"
            ></Button>

    </LinearLayout>
</LinearLayout>

第三步、最终效果

 5、编写注册界面和登录界面的代码

第一步、在com.example.myapplication文件夹下,新建一个Java Class文件

 命名为Mysql

 将内部的代码全部替换为以下代码

package com.example.myapplication;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import androidx.annotation.Nullable;

//数据库
public class Mysql extends SQLiteOpenHelper {
    public Mysql(@Nullable Context context, @Nullable String name, @Nullable SQLiteDatabase.CursorFactory factory, int version) {
        super(context, name, factory, version);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        String sql = "create table logins(id integer primary key autoincrement,usname text,uspwd text)";
        db.execSQL(sql);
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }
}

替换后的结果

第二步、编辑RegisterActivity.java文件内部的代码,替换为以下代码

package com.example.myapplication;

import androidx.appcompat.app.AppCompatActivity;

import android.content.ContentValues;
import android.content.Intent;
import android.content.SharedPreferences;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

public class RegisterActivity extends AppCompatActivity {

    //注册界面的控件
    Button zhuce_success;//注册界面的按键
    EditText zhuce_user_name;//注册界面的用户名
    EditText zhuce_user_password; //注册界面的密码
    EditText zhuce_user_password_again; //注册界面的密

    Mysql mysql;
    SQLiteDatabase db;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_register);

        //寻找控件ID
        zhuce_success = this.findViewById(R.id.zhuce_success);
        zhuce_user_name = this.findViewById(R.id.zhuce_user_name);
        zhuce_user_password = this.findViewById(R.id.zhuce_user_password);
        zhuce_user_password_again= this.findViewById(R.id.zhuce_user_password_again);

        mysql = new Mysql(this,"Userinfo",null,1);      //建数据库
        db = mysql.getReadableDatabase();
        zhuce_success.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                //保存注册数据的字符串
                String name = zhuce_user_name.getText().toString();          //用户名
                String pwd01 = zhuce_user_password.getText().toString();      //密码
                String pwd02 = zhuce_user_password_again.getText().toString(); //二次输入的密码
                //判断注册内容
                if(name.equals("")||pwd01 .equals("")||pwd02.equals("")){
                    //显示弹窗
                    Toast.makeText(getApplicationContext(),"用户名或密码不能为空!!",Toast.LENGTH_SHORT).show();
                }
                else {
                    //如果注册时第一次输入的密码和第二次输入的密码一致
                    if(pwd01.equals(pwd02)){
                        //ContentValues是一种基本的存储类型
                        ContentValues cv = new ContentValues();
                        //放入数据
                        cv.put("usname",name);
                        cv.put("uspwd",pwd01);
                        db.insert("logins",null,cv);
                        //从当前界面跳转到登录页面
                        Intent intent = new Intent();
                        intent.setClass(RegisterActivity.this,LoginActivity.class);
                        startActivity(intent);
                        //弹窗
                        Toast.makeText(getApplicationContext(),"账号注册成功!!",Toast.LENGTH_SHORT).show();
                    }
                    else {
                        Toast.makeText(getApplicationContext(),"两次输入的密码不一致!!",Toast.LENGTH_SHORT).show();
                    }
                }
            }
        });
    }
}

RegisterActivity.java文件替换后的界面

 第三步、编辑LoginActivity.java文件内部的代码,替换为以下代码

package com.example.myapplication;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

public class LoginActivity extends AppCompatActivity {
    //声明控件
    //登陆界面的控件
    EditText user_name;
    EditText user_password;

    Button denglu;
    Button zhuce;

    //声明数据库
    Mysql mysql;
    SQLiteDatabase db;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_login);
        //找到当且xml文件内的控件ID
        //数据编辑框的ID
        user_name = this.findViewById(R.id.user_name);
        user_password = this.findViewById(R.id.user_password);
        //按键属性的ID
        denglu = this.findViewById(R.id.denglu);
        zhuce = this.findViewById(R.id.zhuce);

        //取出数据库内的数据
        mysql = new Mysql(this,"Userinfo",null,1);
        db = mysql.getReadableDatabase();
        //登录按键按下之后处理的事情
        denglu.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                //需要获取的输入的用户名和密码
                String storage_username = user_name.getText().toString();//用户控件.得到数据.转换为字符串;
                String storage_userpassword = user_password.getText().toString();//用户控件.得到数据.转换为字符串;

                //查询用户名和密码相同的数据
                Cursor cursor = db.query("logins",new String[]{"usname","uspwd"}," usname=? and uspwd=?",
                        new String[]{storage_username,storage_userpassword},null,null,null);
                int flag = cursor.getCount(); //查询出来的记录项的条数,若没有该用户则为0条
                //登录成功后响应的数据
                if (flag!=0){
                    Toast.makeText(getApplicationContext(), "登录成功!", Toast.LENGTH_SHORT).show();//显示登录成功的弹窗,简单写法
                    Intent intent = null;  //这个变量初始申明为空
                    intent = new Intent(LoginActivity.this, MainActivity.class);
                    startActivity(intent);
                }
                else {
                    //假设正确的账号和密码分别是(VIP账号,没有写入数据库,无需注册账号)
                    if (storage_username.equals("DPT") && storage_userpassword.equals("123456")) {
                        //如果正确
                        Toast.makeText(getApplicationContext(), "超级VIP登录成功!", Toast.LENGTH_SHORT).show();//显示登录成功的弹窗,简单写法
                        Intent intent = null;  //这个变量初始申明为空
                        intent = new Intent(LoginActivity.this, MainActivity.class);
                        startActivity(intent);
                    }
                    else{
                        Toast.makeText(getApplicationContext(), "用户名输入错误或密码不正确,请重新登录!", Toast.LENGTH_SHORT).show();//获取显示的内容
                    }
                }

            }
        });
        //注册按键按下之后,响应的事件
        zhuce.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                //实现界面跳转,从登录界面跳转到注册界面
                Intent intent = null;  //这个变量初始申明为空
                intent = new Intent(LoginActivity.this, RegisterActivity.class);//跳转界面
                startActivity(intent);
            }
        });
    }
}

LoginActivity.java文件替换后的界面

6、设置APP初始界面

第一步、更改manifests文件夹下AndroidManifest.xml,如下

第二步、设置APP图标和名称

 第三步、AndroidManifest.xml代码

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="com.example.myapplication">

    <application
        android:allowBackup="true"
        android:icon="@mipmap/box"
        android:label="智能药箱"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme"
        tools:ignore="GoogleAppIndexingWarning">
        <activity android:name=".RegisterActivity"/>
        <activity android:name=".LoginActivity" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name=".MainActivity">

        </activity>
    </application>

</manifest>

7、连接手机,编译工程

第一步、小米手机打开开发者模式,允许USB调试,允许USB安装。

第二步、编译工程

第三部分、总结

1、参考资料

        我在实现这个功能的过程中也参考了很多篇博客,最推荐大家看的就是这一篇:

(9条消息) Android studio 编写一个登录页面,并且具有注册功能_东尃的博客-CSDN博客_android studio登录注册界面实现

        然后关于寻找手机APP图标的网址:iconfont-阿里巴巴矢量图标库

        关于Android Studio开发过程中配色:网页设计常用色彩搭配表 | 网页配色表

2、完整工程和代码

        这是博主的完整的代码,可以直接下载,但是你是不是要关注点赞收藏,然后再下载?👍👍👍我的APP工程

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2751.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

基于反馈技术的宽带低噪声放大器的设计

低噪声放大器是通信、雷达、电子对抗及遥控遥测系统中的必不可少的重要部件&#xff0c;它位于射频接收系统的前端&#xff0c;主要功能是对天线接收到的微弱射频信号进行线性放大&#xff0c;同时抑制各种噪声干扰&#xff0c;提高系统的灵敏度。特别是随着通信、电子对抗、微…

基于Java+Vue+uniapp微信小程序实现餐厅校园订餐平台

博主介绍&#xff1a;✌全网粉丝20W,csdn特邀作者、博客专家、CSDN新星计划导师、java领域优质创作者,博客之星、掘金/华为云/阿里云/InfoQ等平台优质作者、专注于Java技术领域和毕业项目实战✌ &#x1f345;文末获取联系&#x1f345;精彩专栏推荐订阅&#x1f447;&#x1f…

springboot二手车交易系统

功能介绍 目 录 第一章 绪论 5 1.1研究背景 5 1.2平台现状分析 5 1.3系统实现的功能 5 1.4二手车交易管理信息系统的特点 6 1.5本文的组织结构 6 第二章开发技术与环境配置 7 2.1 SpringBoot框架 7 2.2Java语言简介 7 2.3 MySQL环境配置 8 2.4 MyEclipse环境配置 8 2.5 mysql数…

黑马程序员C++类和对象【5】 —— 运算符重载(蓝桥杯必备知识)万字超详解

目录 &#x1f921;加号运算符重载 &#x1f921;左移运算符重载 &#x1f921;递增运算符重载 &#x1f921;递减运算符重载 &#x1f921;赋值运算符重载 &#x1f921;关系运算符重载 &#x1f921;函数调用运算符重载&#xff08;仿函数&#xff09; &#x1f921;加…

牛客竞赛每日俩题 - 动态规划1

目录 DP入门&#xff08;存储之前状态以简化&#xff09; DP解决最短路问题 DP入门&#xff08;存储之前状态以简化&#xff09; 拆分词句_牛客题霸_牛客网 思路&#xff1a; 方法&#xff1a;动态规划 状态&#xff1a; 子状态&#xff1a;前1&#xff0c;2&#xff0c;3&a…

蓝桥杯国奖一等奖,经历回顾

文章目录1. 自我介绍2. 参赛经历3. 我的一些经验4. 结语本篇内容为一位粉丝的投稿内容&#xff0c;希望对大家有所帮助。 1. 自我介绍 我是来自一所普通双非的大三学生&#xff0c;以下为主要成绩: 2022蓝桥杯Java组&#xff0c;全国一等奖2022高教社杯全国大学生数学建模竞赛…

windows一键部署java项目

前言 前段时间老大看我很闲...然后给我下达了一项很重要的任务&#xff1a;windows一键部署&#xff0c;需要把服务&#xff08;jdk、tomcat、mysql、jar包、前端压缩包&#xff09;打成一个exe应用程序&#xff0c;点击安装会启动所有服务&#xff0c;打开浏览器http://localh…

Java 程序设计报告[对接java的迭代器接口]

1&#xff1a;程序的功能设计与分析 -&#xff1a;将实现deque与stack -&#xff1a;采用继承与内部类来提高程序的拓展性、安全性、简洁性 -&#xff1a;对接到java.util.iterator中的iterator接口与iterable接口 2&#xff1a;程序的特点分析 -&#xff1a;观察到队列、栈都…

二战华为成功上岸,准备了小半年,要个27k应该也算不上很高吧~

先说下我基本情况&#xff0c;本科不是计算机专业&#xff0c;现在是学通信&#xff0c;然后做图像处理&#xff0c;可能面试官看我不是科班出身没有问太多计算机相关的问题&#xff0c;因为第一次找工作&#xff0c;华为的游戏专场又是最早开始的&#xff0c;就投递了&#xf…

二、肺癌检测-LUNA数据集下载和介绍

LUNA数据集是一个肺部肿瘤CT扫描结果的数据集&#xff0c;可用于作为肺癌检测的模型训练。 一、数据集下载 step1&#xff1a;登陆LUNA16官网&#xff0c;链接为&#xff1a;Home - Grand Challenge step2&#xff1a;点击网站左侧【download】&#xff0c;进入下载页面。 s…

图形学-着色频率与渲染管线

1.着色频率 根据不同的着色方式&#xff0c;有不同的着色频率&#xff0c;主要的着色频率分为三种——面着色&#xff0c;顶点着色和像素着色。主要的不同之处在于法线的选择方式不同。 面着色 Flat Shading指的是计算每一个三角形平面的法线后对一个平面整体进行着色&#x…

Redo日志和Undo日志

Redo日志和Undo日志Redo日志和Undo日志1 Redo日志和Undo日志概述2 Redo日志2.1 为什么需要Redo日志2.2 Redo日志的好处、特点3 Undo日志3.1 如何理解Undo日志3.2 Undo日志的作用Redo日志和Undo日志 1 Redo日志和Undo日志概述 事务有4种特性&#xff1a;原子性、一致性、隔离性…

C++类和对象(中)【万字详解】

这一篇就是C中的类和对象的核心内容了. 目录 类的6个默认成员函数 构造函数 概念 特性 析构函数 概念 特性 拷贝构造函数 概念 特性 赋值运算符重载 运算符重载 赋值运算符重载 const成员 const修饰的类成员函数 8.取地址及const取地址操作符重载 类的6个默认成员函数 如果一个…

洛谷千题详解 | P1004 [NOIP2000 提高组] 方格取数【C++、Java、Pascal语言】

博主主页&#xff1a;Yu仙笙 专栏地址&#xff1a;洛谷千题详解 目录 题目描述 输入格式 输出格式 输入输出样例 解析&#xff1a; C源码&#xff1a; Java源码&#xff1a; Pascal源码&#xff1a; ---------------------------------------------------------------------…

KMP算法模式匹配——手工求解next和nextval数组值

本文需要了解KMP算法基本流程和相关概念&#xff0c;如有问题&#xff0c;请先进行基础学习&#xff1a;链接: 天勤-KMP算法易懂版 求解next数组值 给定模式串&#xff1a;“ababaaab”&#xff0c;求解其next数组值。 例子里面的ababaaab&#xff0c;我们定义一个 i 为模式串的…

【微服务】Nacos Discovery--服务治理

Nacos Discovery--服务治理前言服务治理常见的注册中心ZookeeperEurekaConsulNacosNacos 入门搭建nacos环境将商品微服务注册到nacos将订单微服务注册到nacos总结前言 上一章中&#xff0c;我们利用用户–订单–商品&#xff0c;实现了三个简单的微服务&#xff0c;实现了微服…

如何寻找计算机领域的英文文献?

大家一定或多或少都有文献检索的经验吧&#xff0c;中文文献还好&#xff0c;我们总归是对自己的的母语比较熟悉&#xff0c;通过关键词或其他检索条件&#xff0c;总能得心应手地找到自己需要的文献。相较于中文文献&#xff0c;对外文文献的检索就显得难度增加了不少&#xf…

pthread_create创建线程失败问题排查

一些基础概念的了解 Android中线程&#xff08;Thread&#xff09;的创建及内存分配过程分析 pthread_create创建线程失败的OOM详解 不可思议的OOM 通过上面的文章&#xff0c;我们知道为什么会报pthread_create错误 在创建线程的时候&#xff0c;报的下面这些错误&#xff0…

SAP采购订单中的净价是单价还是总价?

在采购订单中习惯上我们把订单项目的的净价理解为什么&#xff1f;单价还是总价&#xff1f; 先不着急回答。看看以下两个采购订单的对比截图就能了解&#xff0c; 在4050004000这笔采购订单中&#xff0c;采购10件黄色箱子&#xff0c;每10件500元。所以&#xff0c;净价500…

《JavaSE-第十七章》之LinkedList

前言 在你立足处深挖下去,就会有泉水涌出!别管蒙昧者们叫嚷:“下边永远是地狱!” 博客主页&#xff1a;KC老衲爱尼姑的博客主页 博主的github&#xff0c;平常所写代码皆在于此 刷题求职神器 共勉&#xff1a;talk is cheap, show me the code 作者是爪哇岛的新手&#xff0c;水…