| 失效鏈接處理 |
|
Android數(shù)據(jù)存儲SQLite PDF 下載
本站整理下載:
相關(guān)截圖:
![]()
主要內(nèi)容:
一、實驗?zāi)康?/div>
1. 掌握SharePreferences的使用方法;
2. 掌握Android內(nèi)部文件及SD卡存儲文件的方法。
3.掌握SQLite數(shù)據(jù)庫的使用。
二、實驗學(xué)時
2學(xué)時/次,共4學(xué)時
三、實驗環(huán)境
Android Studio;JDK1.7;PC機(jī)
四、實驗內(nèi)容和要求
1. .使用SQLite數(shù)據(jù)存儲實現(xiàn)如下功能
添加聯(lián)系人信息、并查詢信息
對Tom手機(jī)號信息修改,將后兩位11改成00,并查詢結(jié)果
SQLite數(shù)據(jù)庫信息:
SQLite數(shù)據(jù)庫存放位置:
點擊刪除,將聯(lián)系人信息全部清除:
用戶交互界面設(shè)計代碼:
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"
android:paddingBottom="16dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:paddingTop="16dp"
tools:context=".MainActivity">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:ignore="MissingConstraints"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="25sp"
android:gravity="center"
android:text="通訊錄"/>
<LinearLayout
android:id="@+id/ll_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/ll_phone"
android:layout_alignLeft="@+id/ll_btn"
android:layout_alignStart="@+id/ll_btn"
tools:ignore="MissingConstraints">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="18sp"
android:text="姓 名:" />
<EditText
android:id="@+id/et_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="16sp"
android:hint="請輸入姓名" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/ll_phone"
android:layout_marginBottom="10dp"
android:layout_above="@+id/ll_btn"
android:layout_alignLeft="@+id/ll_name"
android:layout_alignStart="@+id/ll_name"
tools:ignore="MissingConstraints">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="18sp"
|




蘇公網(wǎng)安備 32061202001004號


