Android project practice series - registration and login module based on erudite Valley

As this module has a lot of content and a long space, please read it patiently.

Registration and login module is divided into three parts

1, Welcome screen

1. Create a project named BoXueGu, and the package name is com.boxuegu.

2. Import the interface picture, Lun bg.png, into the drawable folder.

3. Create a welcome interface

(1) . implementation of welcome interface

Create an activity package under the com.boxuegu package, and create a new class under the activity package, named SplashActivity. Under res/layout, create an xml layout file named activity_splash.

(2) , activity_splash.xml file code is as follows:

<?xml version="1.0" encoding="utf-8"?>
<!-- match_parent:Occupy all mobile interface            wrap_content: Take your part-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"  
    android:layout_height="match_parent"
    android:background="@drawable/launch_bg">
    					<!-- Set welcome background picture -->
    
      <!--  The text control is used to display the project version number -->
    <TextView
        android:id="@+id/tv_version"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:textColor="@android:color/white"
        android:textSize="18sp"/>
</RelativeLayout>

(3) , modify the manifest file (AndroidManifest.xml)

Modify the icon icon as your own, and modify the icon attribute in the < Application > tab of Android manifest.xml:
 <application
     ...... ...... ......
        android:icon="@mipmap/app_icon" 
    ...... ...... ......>
    </application>
After the project is created, all interfaces need to use the title bar with custom colors. You need to modify the theme attribute in the < Application > tag of Android manifest.xml
 <application
     ...... ...... ......
        android:theme="@style/Theme.AppCompat.NoActionBar">
    ...... ...... ......
    </application>
Modify the default project startup interface as the welcome interface, and cut the < intent Filter > of Android manifest.xml and the content in the tag to the < activity > tag where SplashActivity is located
 <activity android:name=".activity.SplashActivity">
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
</activity>

4. Welcome interface logic code

package com.boxuegu.activity;

import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.TextView;
import com.boxuegu.R;
import java.util.Timer;
import java.util.TimerTask;
/*
 Reason for inheriting AppCompatActivity class:
		More ActionBar than inheriting activity class interface
				Android studio Inherit AppCompatActivity class by default
*/
public class SplashActivity extends AppCompatActivity {

    private TextView tv_version;  //New TV version member variable

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_splash);
        //Set this interface as vertical screen
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
        init();
    }

    private void init() {
    	//Assign the TV version property of the layout file to the member variable TV version
        tv_version = (TextView) findViewById(R.id.tv_version); 
        try {
            //Get package information
            PackageInfo info = getPackageManager().getPackageInfo(getPackageName(), 0);
            //Get version number: versionName in Android manifest.xml
            tv_version.setText("V" + info.versionName);
        } catch (PackageManager.NameNotFoundException e) {
        	//If the version number cannot be obtained, the console prints the error log, System.err
            e.printStackTrace();
            //Welcome back to V
            tv_version.setText("V");
        }
        //Use timer to delay the interface for 3 seconds and then jump. There is a thread in timer that continuously executes task s
        Timer timer = new Timer();
        //TimerTask implements the runnable interface, and the TimerTask class represents a task executed within a specified time
        TimerTask task = new TimerTask() {
            @Override
            public void run() {
            												//Welcome interface to main interface
                Intent intent = new Intent(SplashActivity.this, MainActivity.class);
                startActivity(intent);
                SplashActivity.this.finish();
            }
        };
        timer.schedule(task, 3000);//Set the task to execute automatically after a delay of 3 seconds
    }
}

5. Welcome interface operation effect

2, Registration interface

1. Make title block

Most interfaces in a project have a back button and a title bar. In order to facilitate code reuse, you can make a separate layout file.

(1) , create title block interface

In the res/layout folder, create main? Title? Bar.xml. The code is as follows:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:id="@+id/title_bar"
    android:layout_height="50dp"
    android:background="@android:color/transparent">
    
    <!-- Set the title block background color to go_back_selector.xml -->
    <TextView
        android:id="@+id/tv_back"
        android:layout_width="50dp"
        android:layout_height="50dp"
        android:layout_alignParentLeft="true"
        android:layout_centerVertical="true"
        android:background="@drawable/go_back_selector"/>
    
    <!-- Set title block display font style -->
    <TextView
        android:id="@+id/tv_main_title"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textColor="@android:color/white"
        android:textSize="20sp"
        android:layout_centerInParent="true"
        />
</RelativeLayout>

(2) , create background selector

The back button in the title bar is obviously different from the pop-up button, which can be realized through the background selector. First import the pictures: IV ﹣ bavk ﹣ selected.png (press), IV ﹣ back.png (pop up). Select the drawable folder and create a new xml file. The code is as follows:
<?xml version="1.0" encoding="utf-8"?>
<!-- Set title bar back button background selector: picture and default background color picture -->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_pressed="true" android:drawable="@drawable/iv_back_selected"></item>
    <item android:drawable="@drawable/iv_back"></item>
</selector>

2. Create registration interface

(1) . create registration interface

Create a class named RegisterActivity in the com.boxuegu.activity package. In the res/layout folder, create activity? Register.xml

(2) , import interface picture

Pictures required for registration interface: register ﹐ bg.png (background picture), default ﹐ icon.png (head picture of registration interface), user ﹐ name ﹐ icon of user name, PSW ﹐ icon.png (password icon), register ﹐ user ﹐ name ﹐ BG (enter user name), register ﹐ PSW ﹐ BG (confirm password) - - Import drawable folder

(3) , activity_register.xml interface code

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/register_bg"
    android:orientation="vertical">
    
    		<!-- Import title block—— main_title_bar.xml file -->
    <include layout="@layout/main_title_bar"></include>
    
   		 <!-- Image of registration interface—— default_icon.png -->
    <ImageView
        android:layout_width="70dp"
        android:layout_height="70dp"
        android:layout_gravity="center_horizontal"
        android:layout_marginTop="25dp"
        android:src="@drawable/default_icon" />

    	<!-- User name input box -->
    <EditText
        android:id="@+id/et_user_name"
        android:layout_width="fill_parent"
        android:layout_height="48dp"
        android:layout_marginLeft="35dp"
        android:layout_marginRight="35dp"
        android:layout_marginTop="35dp"
        android:background="@drawable/register_user_name_bg"
        android:drawableLeft="@drawable/user_name_icon"
        android:drawablePadding="10dp"
        android:gravity="center_vertical"
        android:hint="enter one user name"
        android:paddingLeft="8dp"
        android:singleLine="true"
        android:textColor="#000000"
        android:textColorHint="#a3a3a3"
        android:textSize="14sp"/>
    
    	<!-- Password input box -->
    <EditText
        android:id="@+id/et_psw"
        android:layout_width="fill_parent"
        android:layout_height="48dp"
        android:gravity="center_vertical"
        android:layout_marginLeft="35dp"
        android:layout_marginRight="35dp"
        android:background="@drawable/register_psw_bg"
        android:drawableLeft="@drawable/psw_icon"
        android:drawablePadding="10dp"
        android:hint="Please input a password"
        android:inputType="textPassword"
        android:paddingLeft="8dp"
        android:singleLine="true"
        android:textColor="#000000"
        android:textColorHint="#a3a3a3"
        android:textSize="14sp"/>

    	<!-- Confirm password input box -->
    <EditText
        android:id="@+id/et_psw_again"
        android:layout_width="fill_parent"
        android:layout_height="48dp"
        android:gravity="center_vertical"
        android:layout_marginLeft="35dp"
        android:layout_marginRight="35dp"
        android:background="@drawable/register_psw_again_bg"
        android:drawableLeft="@drawable/psw_icon"
        android:drawablePadding="10dp"
        android:hint="Please enter the password again"
        android:inputType="textPassword"
        android:paddingLeft="8dp"
        android:singleLine="true"
        android:textColor="#000000"
        android:textColorHint="#a3a3a3"
        android:textSize="14sp"/>

   	<!--  Register button - use background selector register_selector.xml -->
    <Button
        android:id="@+id/btn_register"
        android:layout_width="fill_parent"
        android:layout_height="40dp"
        android:layout_gravity="center_horizontal"
        android:layout_marginLeft="35dp"
        android:layout_marginRight="35dp"
        android:layout_marginTop="15dp"
        android:background="@drawable/register_selector"
        android:text="Registration"
        android:textColor="@android:color/white"
        android:textSize="18sp"/>
</LinearLayout>

(4) , create background selector

There is an obvious difference between pressing the registration button and popping up. Import the pictures register [icon] normal.png and register [icon] selected.png into the drawable folder. And create the background selector register [selected. XML file in the folder.
<?xml version="1.0" encoding="utf-8"?>
<!-- Register button background selector press as register_icon_selected.png,Bounce as register_icon_normal.png -->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:drawable="@drawable/register_icon_selected" android:state_pressed="true"/>
    <item android:drawable="@drawable/register_icon_normal"/>
</selector>

3. MD5 encryption algorithm

The full name of MD5 is message digest algorithm 5. Transform any length string into a fixed length hexadecimal string. Registration and login will use MD5 encryption algorithm to encrypt the password.
Select com.boxuegu package, create a utils package (Toolkit), and create a MD5Utils class in the utils package. The code is as follows:
package com.boxuegu.utils;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

public class MD5Utils {
	//Create md5 method to encrypt password
    public static String md5(String text){
        try {
        	//Get encrypted object digest
            MessageDigest digest = MessageDigest.getInstance("md5");
            //The digest method encrypts the password
            byte[] result = digest.digest(text.getBytes());
            StringBuilder sb = new StringBuilder();
            for (byte b : result){
                int number = b&0xff;
                String hex = Integer.toHexString(number);
                if (hex.length()==1){
                    sb.append("0"+hex);
                }else{
                    sb.append(hex);
                }
            }
            return sb.toString();
        } catch (NoSuchAlgorithmException e) {
            e.printStackTrace();
            return "";
        }
    }
}


4. Register interface logic code -- RegisterActivity.java

package com.boxuegu.activity;

import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.ActivityInfo;
import android.graphics.Color;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;

import com.boxuegu.R;
import com.boxuegu.utils.MD5Utils;


public class RegisterActivity extends AppCompatActivity {
    //Title Block
    private TextView tv_main_title;
    //Back button
    private TextView tv_back;
    //Register button
    private Button btn_register;
    //Account number, password, re-enter password control
    private EditText et_user_name,et_psw,et_psw_again;
    //Get value of account, password and re-enter password control
    private String userName,psw,pswAgain;
    //Title Layout
    private RelativeLayout rl_rirle_bar;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //Set page layout
        setContentView(R.layout.activity_register);
        //Set interface as vertical screen
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
        init();
    }

    private void init(){
    	//Main title bar.xml page layout file gets the corresponding UI control
        tv_main_title = (TextView)findViewById(R.id.tv_main_title);
        tv_main_title.setText("register");
        tv_back = (TextView)findViewById(R.id.tv_back);
        rl_rirle_bar = (RelativeLayout)findViewById(R.id.title_bar);
        rl_rirle_bar.setBackgroundColor(Color.TRANSPARENT);
      //Get the corresponding UI control from the activity ABCD register.xml page layout file
        btn_register = (Button)findViewById(R.id.btn_register);
        et_user_name = (EditText) findViewById(R.id.et_user_name);
        et_psw =(EditText) findViewById(R.id.et_psw);
        et_psw_again = (EditText)findViewById(R.id.et_psw_again);
        tv_back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                RegisterActivity.this.finish();
            }
        });
        btn_register.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
            	//Gets the string entered in the corresponding control
                getEditString();
                if (TextUtils.isEmpty(userName)){
                    Toast.makeText(RegisterActivity.this,"enter one user name",Toast.LENGTH_LONG).show();
                    return;
                }else  if (TextUtils.isEmpty(psw)){
                    Toast.makeText(RegisterActivity.this,"Please input a password",Toast.LENGTH_LONG).show();
                    return;
                }else  if (TextUtils.isEmpty(pswAgain)){
                    Toast.makeText(RegisterActivity.this,"Please enter the password again",Toast.LENGTH_LONG).show();
                    return;
                }else if (!psw.equals(pswAgain)){
                    Toast.makeText(RegisterActivity.this,"Two different passwords",Toast.LENGTH_LONG).show();
                    return;
                }else if (isExistUserName(userName)){
                    Toast.makeText(RegisterActivity.this,"The account name already exists",Toast.LENGTH_LONG).show();
                    return;
                }else {
                    Toast.makeText(RegisterActivity.this,"login was successful",Toast.LENGTH_LONG).show();
                    saveRegisterInfo(userName,psw);
                    Intent data = new Intent();
                    data.putExtra("userName",userName);
                    setResult(RESULT_OK,data);
                    RegisterActivity.this.finish();
                }
            }
        });
    }

	/**
	 *  Get string in control 
	 */
    private void getEditString() {
        userName = et_user_name.getText().toString().trim();
        psw = et_psw.getText().toString().trim();
        pswAgain = et_psw_again.getText().toString().trim();
    }

    /**
	 *  Get the user name from SharedPreferences and determine if it exists
	 */
    private boolean isExistUserName(String userName) {
        boolean has_userName = false;
        SharedPreferences sp = getSharedPreferences("loginInfo",MODE_PRIVATE);
        String spPwd = sp.getString(userName,"");
        if (!TextUtils.isEmpty(spPwd)){
            has_userName = true;
        }
        return has_userName;
    }

    
    /**
   	 *  Save user name and password to SharedPreferences
   	 */
    private void saveRegisterInfo(String userName, String psw) {
    	//Encrypt the password with MD5
        String md5Psw = MD5Utils.md5(psw); 
        //loginInfo indicates the file name
        SharedPreferences sp = getSharedPreferences("loginInfo",MODE_PRIVATE);
        SharedPreferences.Editor editor = sp.edit(); //Get editor
        //Save to SharedPreferences with username as key and password as value
        editor.putString(userName,md5Psw);
        editor.apply();  //Submit changes
    }
}

5. Modify the welcome interface code to make the welcome interface jump to the registration interface (test process)

6. Test effect

3, Login interface

1. Create login interface

Create a class named LoginActivity in the com.boxuegu.activity package. Under res/layout, create an xml file named activity login.

2. Import interface picture

Import the drawable folder: login? Bg.png (background picture), login? User? Name? Bg.png (enter user name), login? PSW? Bg.png (enter password).

3. Interface code activity · login.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/login_bg"
    android:orientation="vertical">
    <!-- Import title block—— main_title_bar.xml file -->
    <include layout="@layout/main_title_bar" />
    
    <!-- Image of login interface—— default_icon.png -->
    <ImageView
        android:id="@+id/iv_head"
        android:layout_width="70dp"
        android:layout_height="70dp"
        android:layout_marginTop="25dp"
        android:layout_gravity="center_horizontal"
        android:background="@drawable/default_icon" />

    <!-- User name input box -->
    <EditText
        android:id="@+id/et_user_name"
        android:layout_width="fill_parent"
        android:layout_height="48dp"
        android:layout_marginTop="35dp"
        android:layout_marginLeft="35dp"
        android:layout_marginRight="35dp"
        android:layout_gravity="center_horizontal"
        android:background="@drawable/login_user_name_bg"
        android:drawableLeft="@drawable/user_name_icon"
        android:drawablePadding="10dp"
        android:paddingLeft="8dp"
        android:gravity="center_vertical"
        android:hint="enter one user name"
        android:singleLine="true"
        android:textColor="#000000"
        android:textColorHint="#a3a3a3"
        android:textSize="14sp" />

    <!-- Password input box -->
    <EditText
        android:id="@+id/et_psw"
        android:layout_width="fill_parent"
        android:layout_height="48dp"
        android:layout_gravity="center_horizontal"
        android:layout_marginRight="35dp"
        android:layout_marginLeft="35dp"
        android:background="@drawable/login_psw_bg"
        android:drawableLeft="@drawable/psw_icon"
        android:drawablePadding="10dp"
        android:paddingLeft="8dp"
        android:hint="Please input a password"
        android:inputType="textPassword"
        android:singleLine="true"
        android:textColor="#000000"
        android:textColorHint="#a3a3a3"
        android:textSize="14sp" />

    	<!-- Login button -->
    <Button
        android:id="@+id/btn_login"
        android:layout_width="fill_parent"
        android:layout_height="40dp"
        android:layout_marginTop="15dp"
        android:layout_marginLeft="35dp"
        android:layout_marginRight="35dp"
        android:layout_gravity="center_horizontal"
        android:background="@drawable/register_selector"
        android:text="Sign in"
        android:textColor="@android:color/white"
        android:textSize="18sp" />

    	<!-- Register and retrieve the password section now -->
    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_marginTop="8dp"
        android:layout_marginLeft="35dp"
        android:layout_marginRight="35dp"
        android:layout_gravity="center_horizontal"
        android:orientation="horizontal">

        	<!-- Jump to the registration interface button -->
        <TextView
            android:id="@+id/tv_register"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:gravity="center_horizontal"
            android:padding="8dp"
            android:text="Register now"
            android:textColor="@android:color/white"
            android:textSize="14sp" />

       	<!--  Jump to find password interface button -->
        <TextView
            android:id="@+id/tv_find_psw"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:gravity="center_horizontal"
            android:padding="8dp"
            android:text="Retrieve password"
            android:textColor="@android:color/white"
            android:textSize="14sp" />
    </LinearLayout>
    
</LinearLayout>

4. Login interface logic code -- LoginActivity.java

package com.boxuegu.activity;

import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.ActivityInfo;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

import com.boxuegu.R;
import com.boxuegu.utils.MD5Utils;


public class LoginActivity extends AppCompatActivity {

    private TextView tv_main_title;
    private TextView tv_back,tv_register,tv_find_psw;
    private Button btn_login;
    private String userName,psw,spPsw;
    private EditText et_user_name,et_psw;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
      //Set page layout
        setContentView(R.layout.activity_login);
      //Set interface as vertical screen
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
        init();
    }

	/** 
	 * Get interface control 
	 */
    private void init() {
        tv_main_title = (TextView)findViewById(R.id.tv_main_title);
        tv_main_title.setText("Sign in");
        tv_back = (TextView)findViewById(R.id.tv_back);
        tv_register = (TextView)findViewById(R.id.tv_register);
        tv_find_psw = (TextView)findViewById(R.id.tv_find_psw);
        btn_login = (Button) findViewById(R.id.btn_login);
        et_user_name = (EditText)findViewById(R.id.et_user_name);
        et_psw = (EditText)findViewById(R.id.et_psw);
        //Return button click event
        tv_back.setOnClickListener(new View.OnClickListener(){
            @Override
            public void onClick(View view) {
                LoginActivity.this.finish();
            }
        });
        
        //Register control click events now
        tv_register.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
            												//Jump to the registration interface
                Intent intent = new Intent(LoginActivity.this,RegisterActivity.class);
                startActivityForResult(intent,1);
            }
        });
        
        //Click event to retrieve password control
        tv_find_psw.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
            	//Jump to the retrieve password interface (not created yet)
            }
        });
        
        //Click event of login button
        btn_login.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                userName = et_user_name.getText().toString().trim();
                psw = et_psw.getText().toString().trim();
                String md5Psw = MD5Utils.md5(psw);
                spPsw = readPsw(userName);
                //If the user name is empty
                if (TextUtils.isEmpty(userName)){
                    Toast.makeText(LoginActivity.this,"enter one user name",Toast.LENGTH_LONG).show();
                    return;
                }else  if (TextUtils.isEmpty(psw)){  //If the password is empty
                    Toast.makeText(LoginActivity.this,"Please input a password",Toast.LENGTH_LONG).show();
                    return;
                }else if (md5Psw.equals(spPsw)){
                    Toast.makeText(LoginActivity.this,"Login successful",Toast.LENGTH_LONG).show();
                    //Save login status and login user name
                    saveLoginStatus(true,userName);
                    //Pass the login success status to MainActivity
                    Intent data = new Intent();
                    data.putExtra("isLogin",true);
                    data.putExtra("userName",userName);
                    setResult(RESULT_OK,data);
                    LoginActivity.this.finish();
                    return;
                }else if (!TextUtils.isEmpty(spPsw) && !md5Psw.equals(spPsw)){
                    Toast.makeText(LoginActivity.this,"The user name and password entered are inconsistent",Toast.LENGTH_LONG).show();
                }else {
                    Toast.makeText(LoginActivity.this,"This user name does not exist",Toast.LENGTH_LONG).show();
                }
            }
        });
    }

	/* 
	 * Get password from SharedPreferences based on user name 
	*/
    private String readPsw(String userName){
        SharedPreferences sp = getSharedPreferences("loginInfo",MODE_PRIVATE);
        return  sp.getString(userName,"");
    }
    
    /* 
	 * Save login status and login user name to SharedPreferences
	*/
    private void saveLoginStatus(boolean status, String userName) {
        SharedPreferences sp = getSharedPreferences("loginInfo",MODE_PRIVATE);
        SharedPreferences.Editor editor = sp.edit(); //Get editor
        editor.putBoolean("isLogin",status);
        editor.putString("loginUserName",userName);  //Save login user name
        editor.commit(); //Submit changes
    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        if (data!=null){
        	//User name passed from registration interface
            String userName = data.getStringExtra("userName");
            if (!TextUtils.isEmpty(userName)){
                et_user_name.setText(userName);
                //Set cursor position
                et_user_name.setSelection(userName.length());
            }
        }
    }
}

5. Modify the welcome interface code to make the welcome interface jump to the login interface (test)

6. Effect display

Android project practice series - based on the open source address of erudite Valley

               

Tags: Mobile Android xml encoding Java

Posted on Sun, 26 Apr 2020 17:58:34 -0700 by jdorma0