国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

Android studio 編寫一個(gè)登錄頁(yè)面,并且具有注冊(cè)功能

這篇具有很好參考價(jià)值的文章主要介紹了Android studio 編寫一個(gè)登錄頁(yè)面,并且具有注冊(cè)功能。希望對(duì)大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請(qǐng)大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問(wèn)。

功能要求

1、創(chuàng)建登錄界面,點(diǎn)擊注冊(cè)按鈕,彈出注冊(cè)窗口。
2、創(chuàng)建注冊(cè)窗口,輸入用戶名和密碼,在SQLite中存儲(chǔ)用戶名和密碼。
3、注冊(cè)成功,跳轉(zhuǎn)到登錄界面,進(jìn)行登錄。
4、注冊(cè)成功,把用戶名和密碼保存到SharedPreferences中,登錄時(shí)自動(dòng)填充用戶名和密碼。

具體實(shí)現(xiàn)

初步思路

??????????登錄頁(yè)面具有兩個(gè)輸入框和兩個(gè)按鍵,輸入框分別用于獲取用戶名和密碼,按鍵分為登錄按鍵和注冊(cè)按鍵,分別跳往不同的頁(yè)面。登陸成功后,進(jìn)入到歡迎界面。注冊(cè)跳轉(zhuǎn)到注冊(cè)頁(yè)面,注冊(cè)成功后,將數(shù)據(jù)存儲(chǔ)到SharedPreferences和數(shù)據(jù)中,返回登錄頁(yè)面將SharedPreferences中的數(shù)據(jù)填充到輸入框中。

涉及的代碼文件

  1. MainActivity.java :主界面
  2. Mysql.java:利用sqlite的SQLiteOpenHelper類創(chuàng)建數(shù)據(jù)庫(kù)
  3. Register.java:注冊(cè)頁(yè)面
  4. Welcome.java:登陸成功后的歡迎界面:
  5. activity_main.xml:登錄頁(yè)面的布局文件
  6. activity_register.xml:注冊(cè)頁(yè)面的布局文件
  7. activity_welcome.xml:歡迎頁(yè)面的布局文件
    一般在Android studio 中創(chuàng)建Activity都會(huì)自動(dòng)在AndroidManifest.xml中好,本次代碼中也不需要對(duì)AndroidManifest.xml做任何更改。

實(shí)現(xiàn)效果

1登錄頁(yè)面:
???????這是我之前注冊(cè)過(guò)后的賬戶,所以點(diǎn)擊進(jìn)去就自動(dòng)填充好了信息。
Android studio 編寫一個(gè)登錄頁(yè)面,并且具有注冊(cè)功能
2.注冊(cè)頁(yè)面:
???????注冊(cè)頁(yè)面寫的非常簡(jiǎn)略,如果想實(shí)現(xiàn)更多的效果可以網(wǎng)上查查,也可以參照下我上一篇文章中的注冊(cè)頁(yè)面。
編寫一個(gè)簡(jiǎn)單的andriod注冊(cè)頁(yè)面,并跳轉(zhuǎn)后顯示注冊(cè)信息
Android studio 編寫一個(gè)登錄頁(yè)面,并且具有注冊(cè)功能
3.注冊(cè)成功后:
???????注冊(cè)成功后會(huì)自動(dòng)跳轉(zhuǎn)到登錄頁(yè)面,并且填充信息。
Android studio 編寫一個(gè)登錄頁(yè)面,并且具有注冊(cè)功能
4.登錄成功后:
???????登陸成功后會(huì)將用戶名取出來(lái),并顯示歡迎。
Android studio 編寫一個(gè)登錄頁(yè)面,并且具有注冊(cè)功能

代碼文件

1.登錄界面——MainActivity.java :

???????這里登錄比對(duì)數(shù)據(jù)的時(shí)候,我采用的方法是從數(shù)據(jù)庫(kù)中查詢與輸入的用戶名、密碼相同的記錄,若記錄存在則登陸成功。不存在則提示用戶用戶名或密碼輸入錯(cuò)誤。

package com.example.test06;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.content.SharedPreferences;
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 MainActivity extends AppCompatActivity {
    EditText name,pwd;
    Button btnlogin,btnreg;
    Mysql mysql;
    SQLiteDatabase db;
    SharedPreferences sp1,sp2;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        name = this.findViewById(R.id.name);            //用戶名輸入框
        pwd = this.findViewById(R.id.pwd);              //密碼輸入框
        btnlogin = this.findViewById(R.id.login);         //登錄按鈕
        btnreg = this.findViewById(R.id.reg);               //注冊(cè)按鈕
        sp1 =  this.getSharedPreferences("useinfo",this.MODE_PRIVATE);
        sp2 = this.getSharedPreferences("username",this.MODE_PRIVATE);

        name.setText(sp1.getString("usname",null));
        pwd.setText(sp1.getString("uspwd",null));
        mysql = new Mysql(this,"Userinfo",null,1);      //建數(shù)據(jù)庫(kù)或者取數(shù)據(jù)庫(kù)
        db = mysql.getReadableDatabase();
        btnlogin.setOnClickListener(new View.OnClickListener() {                //登錄事件
            @Override
            public void onClick(View v) {
                String username = name.getText().toString();
                String password = pwd.getText().toString();                 //獲取用戶輸入的用戶名和密碼
                //查詢用戶名和密碼相同的數(shù)據(jù)
                Cursor cursor = db.query("logins",new String[]{"usname","uspwd"}," usname=? and uspwd=?",new String[]{username,password},null,null,null);

                int flag = cursor.getCount();                            //查詢出來(lái)的記錄項(xiàng)的條數(shù),若沒(méi)有該用戶則為0條
                if(flag!=0){                                            //若查詢出的記錄不為0,則進(jìn)行跳轉(zhuǎn)操作
                    Intent intent = new Intent();
                    intent.setClass(MainActivity.this,Welcome.class);            //設(shè)置頁(yè)面跳轉(zhuǎn)
                    SharedPreferences.Editor editor = sp2.edit();
                    cursor.moveToFirst();                                   //將光標(biāo)移動(dòng)到position為0的位置,默認(rèn)位置為-1
                    String loginname = cursor.getString(0);
                    editor.putString("Loginname",loginname);
                    editor.commit();                                        //將用戶名存到SharedPreferences中
                    startActivity(intent);
                }
                else{
                    Toast.makeText(MainActivity.this,"用戶名或密碼錯(cuò)誤!",Toast.LENGTH_LONG).show();             //提示用戶信息錯(cuò)誤或沒(méi)有賬號(hào)
                }

            }
        });

        btnreg.setOnClickListener(new View.OnClickListener() {                  //注冊(cè)事件
            @Override
            public void onClick(View v) {

                Intent intent = new Intent();
                intent.setClass(MainActivity.this,Register.class);          //跳轉(zhuǎn)到注冊(cè)頁(yè)面
                startActivity(intent);
                Toast.makeText(MainActivity.this,"前往注冊(cè)!",Toast.LENGTH_SHORT).show();
            }
        });
    }
}

這是對(duì)應(yīng)的布局文件activity_main.xml

<?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">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="10dp"
            android:orientation="horizontal">
            <TextView
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="0.3"
                android:gravity="center"
                android:textSize="18dp"
                android:text="用戶名:"/>
            <EditText
                android:id="@+id/name"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:layout_marginRight="20dp"/>
        </LinearLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="10dp"
            android:orientation="horizontal">
            <TextView
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:gravity="center"
                android:textSize="18dp"
                android:layout_weight="0.3"
                android:text="密    碼:"/>
            <EditText
                android:id="@+id/pwd"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:inputType="textPassword"
                android:layout_weight="1"
                android:layout_marginRight="20dp"
                />
        </LinearLayout>
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal">
            <Button
                android:id="@+id/login"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:layout_margin="5dp"
                android:text="登錄"
                />
            <Button
                android:id="@+id/reg"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:layout_margin="5dp"
                android:text="注冊(cè)"
                />
        </LinearLayout>
    </LinearLayout>


</androidx.constraintlayout.widget.ConstraintLayout>

2.注冊(cè)界面——Register.java

???????注冊(cè)時(shí),會(huì)先對(duì)用戶名進(jìn)行比對(duì),若用戶名存在則提醒用戶名已存在。設(shè)置密碼會(huì)比對(duì)兩次輸入的密碼是否相同,不相同則發(fā)出提醒。

package com.example.test06;

import androidx.appcompat.app.AppCompatActivity;

import android.content.ContentValues;
import android.content.Intent;
import android.content.SharedPreferences;
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 Register extends AppCompatActivity {
    EditText usename,usepwd,usepwd2;
    Button submit;
    Mysql mysql;
    SQLiteDatabase db;
    SharedPreferences sp;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_register);
        usename = this.findViewById(R.id.usename);			    //用戶名編輯框
        usepwd =  this.findViewById(R.id.usepwd);				//設(shè)置初始密碼編輯框
        usepwd2 = this.findViewById(R.id.usepwd2);			    //二次輸入密碼編輯框
        submit =   this.findViewById(R.id.submit);				//注冊(cè)按鈕
        mysql = new Mysql(this,"Userinfo",null,1);      //建數(shù)據(jù)庫(kù)
        db = mysql.getReadableDatabase();
        sp = this.getSharedPreferences("useinfo",this.MODE_PRIVATE);


        submit.setOnClickListener(new View.OnClickListener() {
            boolean flag = true;            //判斷用戶是否已存在的標(biāo)志位
            @Override
            public void onClick(View v) {
                String name = usename.getText().toString();				//用戶名
                String pwd01 = usepwd.getText().toString();				//密碼
                String pwd02 = usepwd2.getText().toString();			//二次輸入的密碼
                String sex = "";										//性別
                if(name.equals("")||pwd01 .equals("")||pwd02.equals("")){
                    Toast.makeText(Register.this, "用戶名或密碼不能為空!!", Toast.LENGTH_LONG).show();
                }
                else{
                    Cursor cursor = db.query("logins",new String[]{"usname"},null,null,null,null,null);

                    while (cursor.moveToNext()){
                        if(cursor.getString(0).equals(name)){
                            flag = false;
                            break;
                        }
                    }
                    if(flag==true){                                             //判斷用戶是否已存在
                        if (pwd01.equals(pwd02)) {								//判斷兩次輸入的密碼是否一致,若一致則繼續(xù),不一致則提醒密碼不一致
                            ContentValues cv = new ContentValues();
                            cv.put("usname",name);
                            cv.put("uspwd",pwd01);
                            db.insert("logins",null,cv);
                            SharedPreferences.Editor editor = sp.edit();
                            editor.putString("usname",name);
                            editor.putString("uspwd",pwd01);
                            editor.commit();
                            Intent intent = new Intent();
                            intent.setClass(Register.this,MainActivity.class);      //跳轉(zhuǎn)到登錄頁(yè)面
                            startActivity(intent);
                            Toast.makeText(Register.this, "注冊(cè)成功!", Toast.LENGTH_LONG).show();
                        }
                        else {
                            Toast.makeText(Register.this, "密碼不一致!", Toast.LENGTH_LONG).show();			//提示密碼不一致
                        }
                    }
                    else{
                        Toast.makeText(Register.this, "用戶已存在!", Toast.LENGTH_LONG).show();			//提示密碼不一致
                    }

                }
            }


        });
    }
}

這是對(duì)應(yīng)的布局文件activity_register.xml

<?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=".Register">
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">
    <!-- 用戶名部分 -->
    <TextView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="用戶名:" />

    <EditText
        android:id="@+id/usename"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text=""
        />
    <!-- 密碼部分 -->
    <TextView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="密 碼:"
        />

    <EditText
        android:id="@+id/usepwd"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:inputType="textPassword"

        />
    <!-- 確認(rèn)密碼部分 -->
    <TextView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="確認(rèn)密碼:"
        />

    <EditText
        android:id="@+id/usepwd2"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:inputType="textPassword"
        />
        <Button
            android:id="@+id/submit"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:text="注冊(cè)" />
    </LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

3.歡迎界面——Welcome.java

package com.example.test06;

import androidx.appcompat.app.AppCompatActivity;

import android.content.SharedPreferences;
import android.os.Bundle;
import android.widget.TextView;

public class Welcome extends AppCompatActivity {
    SharedPreferences sp;
    TextView showhello;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_welcome);
        sp = this.getSharedPreferences("username", this.MODE_PRIVATE);  //獲取sharepreferences
        showhello = this.findViewById(R.id.mainword);           //顯示歡迎

        showhello.setText("歡迎你!"+sp.getString("Loginname",""));     //獲取用戶名
    }
}

這是對(duì)應(yīng)的布局文件activity_welcome.xml

<?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=".Welcome">
    <TextView
        android:id="@+id/mainword"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:gravity="center"
        android:textSize="22dp"
        tools:ignore="MissingConstraints" />
</androidx.constraintlayout.widget.ConstraintLayout>

4.數(shù)據(jù)庫(kù)——Mysql.java

package com.example.test06;

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) {

    }
}

???????代碼可能有些簡(jiǎn)陋,考慮也可能沒(méi)那么全面,但基本的功能還是可以的。暫時(shí)沒(méi)發(fā)現(xiàn)什么大的問(wèn)題。文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-400578.html

到了這里,關(guān)于Android studio 編寫一個(gè)登錄頁(yè)面,并且具有注冊(cè)功能的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來(lái)自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場(chǎng)。本站僅提供信息存儲(chǔ)空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請(qǐng)注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請(qǐng)點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • Android Studio|使用SqLite實(shí)現(xiàn)一個(gè)簡(jiǎn)單的登錄注冊(cè)功能

    Android Studio|使用SqLite實(shí)現(xiàn)一個(gè)簡(jiǎn)單的登錄注冊(cè)功能

    本學(xué)期學(xué)習(xí)了Android Studio這門課程,本次使用Android Studio自帶的sqlite數(shù)據(jù)庫(kù)實(shí)現(xiàn)一個(gè)簡(jiǎn)單的登錄注冊(cè)功能。 目錄 一、了解什么是Android Studio? 二、了解什么是sqlite? 三、創(chuàng)建項(xiàng)目文件 ?四、創(chuàng)建活動(dòng)文件和布局文件。 五、創(chuàng)建數(shù)據(jù)庫(kù),連接數(shù)據(jù)庫(kù) ?六、創(chuàng)建實(shí)體類,實(shí)現(xiàn)注

    2024年02月06日
    瀏覽(51)
  • 使用Android Studio創(chuàng)建第一個(gè)小項(xiàng)目(登錄頁(yè)面)

    使用Android Studio創(chuàng)建第一個(gè)小項(xiàng)目(登錄頁(yè)面)

    僅供參考,學(xué)習(xí)使用 我這里了就直接創(chuàng)建一個(gè)模塊了 然后選擇Empty Activity 接下來(lái)直接點(diǎn)finish 我沒(méi)有藝術(shù)細(xì)胞,所以畫的比較差,大家不要介意 點(diǎn)擊下面我圖片的箭頭處 然后點(diǎn)擊split ####刪掉我圖片中的內(nèi)容 然后點(diǎn)回design 點(diǎn)擊旁邊的TextView,拖動(dòng)到方框中來(lái) 接著我們讓這個(gè)

    2024年02月07日
    瀏覽(30)
  • uniapp-含有后端的登錄注冊(cè)頁(yè)面編寫

    uniapp-含有后端的登錄注冊(cè)頁(yè)面編寫

    數(shù)據(jù)庫(kù)結(jié)構(gòu) 表名:user 列名 數(shù)據(jù)類型 描述 id int 自增ID username varchar 用戶名 password varchar 密碼 nickname varchar 昵稱 這個(gè)方案只保留了id、username、password和nickname四個(gè)字段,以最簡(jiǎn)單的方式存儲(chǔ)用戶基本信息。需要注意的是,密碼應(yīng)該進(jìn)行安全處理(如加密),避免泄露敏感信息

    2024年02月06日
    瀏覽(15)
  • 使用javaweb實(shí)現(xiàn)登錄注冊(cè)頁(yè)面,并且對(duì)功能和業(yè)務(wù)進(jìn)行分層 用戶登錄成功跳轉(zhuǎn)到主頁(yè)并展示數(shù)據(jù)庫(kù)的商品的信息

    使用javaweb實(shí)現(xiàn)登錄注冊(cè)頁(yè)面,并且對(duì)功能和業(yè)務(wù)進(jìn)行分層 用戶登錄成功跳轉(zhuǎn)到主頁(yè)并展示數(shù)據(jù)庫(kù)的商品的信息

    一、Servlet+JSP+JavaBean開(kāi)發(fā)模式(MVC)介紹 Servlet+JSP+JavaBean模式(MVC)適合開(kāi)發(fā)復(fù)雜的web應(yīng)用,在這種模式下,servlet負(fù)責(zé)處理用戶請(qǐng)求,jsp負(fù)責(zé)數(shù)據(jù)顯示,javabean負(fù)責(zé)封裝數(shù)據(jù)。 Servlet+JSP+JavaBean模式程序各個(gè)模塊之間層次清晰,web開(kāi)發(fā)推薦采用此種模式。 這里以一個(gè)最常用的用戶登錄

    2024年02月03日
    瀏覽(109)
  • Android Studio心得-創(chuàng)建登錄注冊(cè)項(xiàng)目

    ? ? ? ? 首先先了解AndroidStudio是什么:Android Studio是一個(gè)由谷歌開(kāi)發(fā)的Android應(yīng)用程序開(kāi)發(fā)環(huán)境,用于開(kāi)發(fā)Android應(yīng)用程序。它基于JetBrains IntelliJIDEA軟件,并包含了許多定制化功能,包括易于使用的分析工具、內(nèi)存分析工具和代碼編輯器等,支持Java、Kotlin等多種編程語(yǔ)言。An

    2024年02月05日
    瀏覽(19)
  • Android開(kāi)發(fā)實(shí)戰(zhàn)——登錄注冊(cè)頁(yè)面(附源碼)

    Android開(kāi)發(fā)實(shí)戰(zhàn)——登錄注冊(cè)頁(yè)面(附源碼)

    效果圖: 這段代碼是一個(gè)簡(jiǎn)單的Android應(yīng)用中的登錄功能代碼,下面逐行解釋其功能和作用: 導(dǎo)入相關(guān)的類和包: 這些導(dǎo)入語(yǔ)句引入了用于構(gòu)建Android應(yīng)用界面、處理用戶交互和數(shù)據(jù)存儲(chǔ)的必要類和包。 定義一個(gè)名為 LoginActivity 的類,它繼承自 AppCompatActivity ,表示這是一個(gè)用

    2024年02月11日
    瀏覽(27)
  • 使用原生js寫一個(gè)簡(jiǎn)單的注冊(cè)登錄頁(yè)面

    使用原生js寫一個(gè)簡(jiǎn)單的注冊(cè)登錄頁(yè)面

    目錄 1.注冊(cè)頁(yè)面 2.登錄頁(yè)面 1.首先是我們的注冊(cè)頁(yè)面 這是我們的html骨架? 這是css樣式 下面就是我們注冊(cè)的js封裝了 ? ? ? ? 這里的函數(shù)調(diào)用直接寫到了html里面的button事件上面了 這就是我的注冊(cè)頁(yè)面 ,當(dāng)然各位要是覺(jué)得不好看也可以換成自己喜歡的圖片; 2.登陸頁(yè)面 ? ? ?

    2024年02月11日
    瀏覽(31)
  • 用JSP簡(jiǎn)單的寫一個(gè)登錄注冊(cè)頁(yè)面

    編寫頁(yè)面時(shí)先創(chuàng)建一個(gè)Dynamic web project,所有的jsp文件都放在WebContent文件夾下,java文件放在java Resource文件的src文件 因?yàn)橹饕胘sp因此這里用map數(shù)組暫替數(shù)據(jù)庫(kù)對(duì)用戶信息進(jìn)行存儲(chǔ)

    2023年04月17日
    瀏覽(24)
  • Android Studio —— Activity組件(課后作業(yè):登錄和注冊(cè)App)

    Android Studio —— Activity組件(課后作業(yè):登錄和注冊(cè)App)

    運(yùn)行效果圖 ? 主界面(初始),注冊(cè)界面,登錄界面,主界面(注冊(cè)和登錄之后) 實(shí)現(xiàn)步驟 1.設(shè)計(jì)主界面,編寫activity_main.xml 注:(1) 按鈕的格式是自己設(shè)計(jì)的,如下 注:(2)需編寫strings.xml 2.創(chuàng)建兩個(gè)activity(會(huì)自動(dòng)創(chuàng)建對(duì)應(yīng)的layout布局文件) ? 3.設(shè)計(jì)登錄和注冊(cè)界面,編寫

    2024年02月05日
    瀏覽(30)
  • Android studio連接MySQL并完成簡(jiǎn)單的登錄注冊(cè)功能

    Android studio連接MySQL并完成簡(jiǎn)單的登錄注冊(cè)功能

    近期需要完成一個(gè)Android項(xiàng)目,那先從與數(shù)據(jù)庫(kù)交互最簡(jiǎn)單的登陸注冊(cè)開(kāi)始吧,現(xiàn)記錄過(guò)程如下: 此篇文章的小demo主要涉及數(shù)據(jù)庫(kù)的連接,以及相應(yīng)信息的查找與插入。 我已將源碼上傳至GitHub: https://github.com/changyan-maker/LoginApp 首先展示一下完成效果。 數(shù)據(jù)庫(kù)設(shè)計(jì): 數(shù)據(jù)庫(kù)

    2024年01月17日
    瀏覽(26)

覺(jué)得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請(qǐng)作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包