Android開(kāi)發(fā)筆記之Android中數(shù)據(jù)的存儲(chǔ)方式(一)
對(duì)于開(kāi)發(fā)平臺(tái)來(lái)講,如果對(duì)數(shù)據(jù)的存儲(chǔ)有良好的支持,那么對(duì)應(yīng)用程序的開(kāi)發(fā)將會(huì)有很大的促進(jìn)作用。
總體的來(lái)講,數(shù)據(jù)存儲(chǔ)方式有三種:一個(gè)是文件,一個(gè)是數(shù)據(jù)庫(kù),另一個(gè)則是網(wǎng)絡(luò)。其中文件和數(shù)據(jù)庫(kù)可能用的稍多一些,文件用起來(lái)較為方便,程序可以自己定義格式;數(shù)據(jù)庫(kù)用起稍煩鎖一些,但它有它的優(yōu)點(diǎn),比如在海量數(shù)據(jù)時(shí)性能優(yōu)越,有查詢功能,可以加密,可以加鎖,可以跨應(yīng)用,跨平臺(tái)等等;網(wǎng)絡(luò),則用于比較重要的事情,比如科研,勘探,航空等實(shí)時(shí)采集到的數(shù)據(jù)需要馬上通過(guò)網(wǎng)絡(luò)傳輸?shù)綌?shù)據(jù)處理中心進(jìn)行存儲(chǔ)并進(jìn)行處理,有實(shí)時(shí)性的需求等。
對(duì)于Android平臺(tái)來(lái)講,它的存儲(chǔ)方式也不外乎這幾種,按方式總體來(lái)分,也是文件,數(shù)據(jù)庫(kù)和網(wǎng)絡(luò)。但我認(rèn)為從儲(chǔ)存標(biāo)的來(lái)講它可以細(xì)分為以下五種方式:
1.1 方式
1.Shared Preferences:主要用于保存程序的系統(tǒng)配置信息。用來(lái)存儲(chǔ)“key-values paires”。一般用于保存程序啟動(dòng)時(shí)設(shè)定的信息,以便在程序下一次啟動(dòng)時(shí)繼續(xù)保留前一次設(shè)定的信息。
2.xml:保存復(fù)雜數(shù)據(jù),比如短信備份。
3.Files:用文件的形式保存信息。可以通過(guò)對(duì)文件的讀寫來(lái)獲取或保存相關(guān)信息。
4.SQLite:用數(shù)據(jù)庫(kù)的形式保存信息。SQLite是一個(gè)開(kāi)源的數(shù)據(jù)庫(kù) 系統(tǒng)。
5.NetWork:將數(shù)據(jù)保存于網(wǎng)絡(luò)。
1.2 區(qū)別
1. Shared Preferences:
Android提供用來(lái)存儲(chǔ)一些簡(jiǎn)單的配置信息的一種機(jī)制,例如,一些默認(rèn)歡迎語(yǔ)、登錄的用戶名和密碼等。其以鍵值對(duì)的方式存儲(chǔ)。
SharedPreferences是以XML的格式以文件的方式自動(dòng)保存的,在DDMS中的File Explorer中展開(kāi)到/data/data/<packagename>/shared_prefs下,以自己的項(xiàng)目為例,可以看到一個(gè)叫做SETTING_Infos.xml的文件
2. Files
在Android中,其提供了openFileInput 和 openFileOuput 方法讀取設(shè)備上的文件,下面看個(gè)例子代碼,具體如下所示:
String FILE_NAME = "tempfile.tmp"; //確定要操作文件的文件名 FileOutputStream fos = openFileOutput(FILE_NAME, Context.MODE_PRIVATE); //初始化 FileInputStream fis = openFileInput(FILE_NAME); //創(chuàng)建寫入流
上述代碼中兩個(gè)方法只支持讀取該應(yīng)用目錄下的文件,讀取非其自身目錄下的文件將會(huì)拋出異常。需要提醒的是,如果調(diào)用FileOutputStream 時(shí)指定的文件不存在,Android 會(huì)自動(dòng)創(chuàng)建它,所以不需要判斷文件是否存在。另外,在默認(rèn)情況下,寫入的時(shí)候會(huì)覆蓋原文件內(nèi)容,如果想把新寫入的內(nèi)容附加到原文件內(nèi)容后,則可以指定其模式為Context.MODE_APPEND,這里涉及到openFileOutput()的四種模式,下文我會(huì)詳細(xì)解釋和案例。
3. SQLite
SQLite是Android所帶的一個(gè)標(biāo)準(zhǔn)的數(shù)據(jù)庫(kù),它支持SQL語(yǔ)句,它是一個(gè)輕量級(jí)的嵌入式數(shù)據(jù)庫(kù)
4. NetWork:
將數(shù)據(jù)上傳到網(wǎng)絡(luò)
補(bǔ)充:
1.Shared Preferences底層使用xml,xml也可以保存數(shù)據(jù),但是Shared Preferences只能保存鍵值對(duì)方式,xml能保存復(fù)雜數(shù)據(jù)
2.Content provider底部還是使用了Sqlite數(shù)據(jù)庫(kù),也是算一種方式。
1.3 例子
1. Shared Preferences:
小案例:用戶輸入賬號(hào)密碼,點(diǎn)擊登錄按鈕,登錄的同時(shí)持久化保存賬號(hào)和密碼
用SharedPreference存儲(chǔ)賬號(hào)密碼
•往SharedPreference里寫數(shù)據(jù)
//拿到一個(gè)SharedPreference對(duì)象
SharedPreferences sp = getSharedPreferences("config", MODE_PRIVATE);
//拿到編輯器
Editor ed = sp.edit();
//寫數(shù)據(jù)
ed.putString("name", name);
ed.commit();
注:這里記住put完后,必須commit一下。
•從SharedPreference里取數(shù)據(jù)
SharedPreferences sp = getSharedPreferences("config", MODE_PRIVATE);
//從SharedPreference里取數(shù)據(jù)
String name = sp.getBoolean("name", "");
•代碼:
•布局文件
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" tools:context=".MainActivity" android:orientation="vertical" > <EditText android:id="@+id/et_name" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="請(qǐng)輸入用戶名" /> <EditText android:id="@+id/et_pass" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="請(qǐng)輸入密碼" android:inputType="textPassword" /> <RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content" > <CheckBox android:id="@+id/cb" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="記住用戶名和密碼" android:layout_centerVertical="true" /> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="登錄" android:layout_alignParentRight="true" android:onClick="login" /> </RelativeLayout> </LinearLayout>
•java代碼
package com.bokeyuan.sharedpreference;
import android.os.Bundle;
import android.app.Activity;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.view.Menu;
import android.view.View;
import android.widget.EditText;
public class MainActivity extends Activity {
private EditText et_name;
private EditText et_pass;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
et_name = (EditText) findViewById(R.id.et_name);
et_pass = (EditText) findViewById(R.id.et_pass);
//拿到SharedPreferences對(duì)象
SharedPreferences sp = getSharedPreferences("info", MODE_PRIVATE);
//從SharedPreferences中取出數(shù)據(jù)
String name = sp.getString("name", "");
String pass = sp.getString("pass", "");
et_name.setText(name);
et_pass.setText(pass);
}
public void login(View v){
String name = et_name.getText().toString();
String pass = et_pass.getText().toString();
//拿到SharedPreferences對(duì)象
SharedPreferences sp = getSharedPreferences("info", MODE_PRIVATE);
//把數(shù)據(jù)存入SharedPreferences
Editor ed = sp.edit();
ed.putString("name", name);
ed.putString("pass", pass);
//提交
ed.commit();
}
}
2. Files
小案例:用戶輸入賬號(hào)密碼,勾選“記住賬號(hào)密碼”,點(diǎn)擊登錄按鈕,登錄的同時(shí)持久化保存賬號(hào)和密碼
•在內(nèi)部存儲(chǔ)空間中讀寫文件(RAM)
•布局文件:同上面的布局
•java代碼:
package com.bokeyuan.rwinrom;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import android.os.Bundle;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Context;
import android.view.Menu;
import android.view.View;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.Toast;
public class MainActivity extends Activity {
private EditText et_name;
private EditText et_pass;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
et_name = (EditText) findViewById(R.id.et_name);
et_pass = (EditText) findViewById(R.id.et_pass);
readAccount();
}
@SuppressLint("ShowToast") public void login(View v){
String name = et_name.getText().toString();
String pass = et_pass.getText().toString();
CheckBox cb = (CheckBox) findViewById(R.id.cb);
if(cb.isChecked()){
//指定Android的內(nèi)部存儲(chǔ)空間的路徑
// File file = new File("data/data/com.bokeyuan.rwinrom/info.txt");
//返回一個(gè)File對(duì)象,它的路徑是:data/data/com.bokeyuan.rwinrom/files/
// File file = new File(getFilesDir(), "info.txt");
//返回一個(gè)File對(duì)象,它的路徑是:data/data/com.bokeyuan.rwinrom/cache/
File file = new File(getCacheDir(), "info.txt");
try {
FileOutputStream fos = new FileOutputStream(file);
fos.write((name + "##" + pass).getBytes());
fos.close();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
//彈出提示框,提示用戶登錄成功
Toast.makeText(this, "登陸成功", 0).show();
}
public void readAccount(){
//指定Android的內(nèi)部存儲(chǔ)空間的路徑
// File file = new File("data/data/com.bokeyuan.rwinrom/info.txt");
// File file = new File(getFilesDir(), "info.txt");
File file = new File(getCacheDir(), "info.txt");
if(file.exists()){
try {
FileInputStream fis = new FileInputStream(file);
//把字節(jié)流轉(zhuǎn)換成字符流
BufferedReader br = new BufferedReader(new InputStreamReader(fis));
String text = br.readLine();
String[] s = text.split("##");
et_name.setText(s[0]);
et_pass.setText(s[1]);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
}
•在外部存儲(chǔ)空間中讀寫文件(SD卡)
•布局文件:同上面的布局
•java代碼:
package com.bokeyuan.rwinsd;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import com.bokeyuan.rwinsd.R;
import android.os.Bundle;
import android.os.Environment;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Context;
import android.view.Menu;
import android.view.View;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.Toast;
public class MainActivity extends Activity {
private EditText et_name;
private EditText et_pass;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
et_name = (EditText) findViewById(R.id.et_name);
et_pass = (EditText) findViewById(R.id.et_pass);
readAccount();
}
public void login(View v){
String name = et_name.getText().toString();
String pass = et_pass.getText().toString();
CheckBox cb = (CheckBox) findViewById(R.id.cb);
if(cb.isChecked()){
//檢測(cè)sd卡當(dāng)前是否可用
if(Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)){
// File file = new File("sdcard/info.txt");
//返回一個(gè)file對(duì)象,包含的路徑就是sd卡的真實(shí)路徑
File file = new File(Environment.getExternalStorageDirectory(), "info.txt");
try {
FileOutputStream fos = new FileOutputStream(file);
fos.write((name + "##" + pass).getBytes());
fos.close();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
else{
Toast.makeText(this, "sd卡不可用喲親", 0).show();
}
}
//彈出提示框,提示用戶登錄成功
Toast.makeText(this, "登陸成功", 0).show();
}
public void readAccount(){
// File file = new File("sdcard/info.txt");
File file = new File(Environment.getExternalStorageDirectory(), "info.txt");
if(file.exists()){
try {
FileInputStream fis = new FileInputStream(file);
//把字節(jié)流轉(zhuǎn)換成字符流
BufferedReader br = new BufferedReader(new InputStreamReader(fis));
String text = br.readLine();
String[] s = text.split("##");
et_name.setText(s[0]);
et_pass.setText(s[1]);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
}
注:
•//此api會(huì)把文件寫到data/data/com.itheima.permission/files/文件夾下
•FileOutputStream fos = openFileOutput("info1.txt", MODE_PRIVATE) ;
•//此api會(huì)把文件讀到data/data/com.itheima.permission/files/文件夾下
•FileOutputStream fos = openFileOutput("info1.txt", MODE_PRIVATE) ;
•所以,以后用Android 自帶的API??梢钥聪旅鎜penFileOutput四種模式的小例子:
•openFileOutput的四種模式
•MODE_PRIVATE = 0: -rw-rw---- •MODE_APPEND = 32768: -rw-rw---- •MODEWORLDREADABLE = 1: -rw-rw-r-- •MODEWORLDWRITEABLE = 2: -rw-rw--w-
Context.MODE_PRIVATE:為默認(rèn)操作模式,代表該文件是私有數(shù)據(jù),只能被應(yīng)用本身訪問(wèn),在該模式下,寫入的內(nèi)容會(huì)覆蓋原文件的內(nèi)容,如果想把新寫入的內(nèi)容追加到原文件中,可以使用Context.MODE_APPEND。
Context.MODE_APPEND:模式會(huì)檢查文件是否存在,存在就往文件追加內(nèi)容,否則就創(chuàng)建新文件。
Context.MODE_WORLD_READABLE和Context.MODE_WORLD_WRITEABLE用來(lái)控制其他應(yīng)用是否有權(quán)限讀寫該文件。
MODE_WORLD_READABLE:表示當(dāng)前文件可以被其他應(yīng)用讀??;MODE_WORLD_WRITEABLE:表示當(dāng)前文件可以被其他應(yīng)用寫入。
• 注:
•在Android中,每一個(gè)應(yīng)用是一個(gè)獨(dú)立的用戶
•drwxrwxrwx
•第1位:d表示文件夾,-表示文件
•第2-4位:rwx,表示這個(gè)文件的擁有者用戶(owner)對(duì)該文件的權(quán)限 •r:讀
•w:寫
•x:執(zhí)行
•第5-7位:rwx,表示跟文件擁有者用戶同組的用戶(grouper)對(duì)該文件的權(quán)限
•第8-10位:rwx,表示其他用戶組的用戶(other)對(duì)該文件的權(quán)限
•布局文件:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" tools:context=".MainActivity" android:orientation="vertical" > <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="創(chuàng)建文件1" android:onClick="click1" /> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="創(chuàng)建文件2" android:onClick="click2" /> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="創(chuàng)建文件3" android:onClick="click3" /> </LinearLayout>
•代碼:
package com.bokeyuan.permission;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import android.os.Bundle;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
@SuppressLint("WorldReadableFiles")
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
public void click1(View v){
//此api會(huì)把文件寫到data/data/com.bokeyuan.permission/files/文件夾下
try {
FileOutputStream fos = openFileOutput("info1.txt", MODE_PRIVATE) ;
fos.write("該文件是私有數(shù)據(jù),只能被應(yīng)用本身訪問(wèn)".getBytes());
fos.close();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public void click2(View v){
//此api會(huì)把文件寫到data/data/com.bokeyuan.permission/files/文件夾下
try {
@SuppressWarnings("deprecation")
FileOutputStream fos = openFileOutput("info2.txt", MODE_WORLD_READABLE | MODE_WORLD_WRITEABLE) ;
fos.write("當(dāng)前文件可以被其他應(yīng)用讀取或?qū)懭?.getBytes());
fos.close();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public void click3(View v){
//此api會(huì)把文件寫到data/data/com.bokeyuan.permission/files/文件夾下
try {
@SuppressWarnings("deprecation")
FileOutputStream fos = openFileOutput("info3.txt", MODE_WORLD_WRITEABLE) ;
fos.write("當(dāng)前文件可以被其他應(yīng)用寫入".getBytes());
fos.close();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
•獲取SD卡剩余容量:
•有時(shí)候讀寫文件的時(shí)候,需要判斷SD卡的剩余容量,再進(jìn)行寫入操作。下面小例子,引用Android系統(tǒng)底層的API,獲取SD卡的剩余容量。
•布局文件:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" tools:context=".MainActivity" > <TextView android:id="@+id/tv" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/hello_world" /> </RelativeLayout>
•Java代碼:
package com.bokeyuan.getsdavail;
import java.io.File;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.os.StatFs;
import android.app.Activity;
import android.text.format.Formatter;
import android.view.Menu;
import android.widget.TextView;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
File path = Environment.getExternalStorageDirectory();
StatFs stat = new StatFs(path.getPath());
long blockSize;
long totalBlocks;
long availableBlocks;
//檢測(cè)系統(tǒng)當(dāng)前版本號(hào)
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2){
blockSize = stat.getBlockSizeLong();
totalBlocks = stat.getBlockCountLong();
availableBlocks = stat.getAvailableBlocksLong();
}
else{
blockSize = stat.getBlockSize();
totalBlocks = stat.getBlockCount();
availableBlocks = stat.getAvailableBlocks();
}
TextView tv = (TextView) findViewById(R.id.tv);
tv.setText(formatSize(availableBlocks * blockSize));
}
private String formatSize(long size) {
return Formatter.formatFileSize(this, size);
}
}
以上所述給大家介紹了Android開(kāi)發(fā)筆記之Android中數(shù)據(jù)的存儲(chǔ)方式(一)的相關(guān)知識(shí),希望本文分享能夠幫助到大家。下篇給android開(kāi)發(fā)筆記之a(chǎn)ndroid中數(shù)據(jù)的存儲(chǔ)方式(二),感興趣的朋友點(diǎn)擊了解詳情。
- Android sdcard實(shí)現(xiàn)圖片存儲(chǔ) 、聯(lián)網(wǎng)下載
- Android持久化技術(shù)之SharedPreferences存儲(chǔ)實(shí)例詳解
- 詳解Android文件存儲(chǔ)
- 實(shí)例詳解Android文件存儲(chǔ)數(shù)據(jù)方式
- Android開(kāi)發(fā)筆記之Android中數(shù)據(jù)的存儲(chǔ)方式(二)
- Android數(shù)據(jù)存儲(chǔ)之SQLite使用
- Android編程使用內(nèi)容提供者方式(ContentProvider)進(jìn)行存儲(chǔ)的方法
- 詳解Android四種存儲(chǔ)方式
- Android編程中的5種數(shù)據(jù)存儲(chǔ)方式
- Android使用文件進(jìn)行數(shù)據(jù)存儲(chǔ)的方法
- Android編程之SharedPreferences文件存儲(chǔ)操作實(shí)例分析
- android中使用SharedPreferences進(jìn)行數(shù)據(jù)存儲(chǔ)的操作方法
- Android應(yīng)用開(kāi)發(fā)SharedPreferences存儲(chǔ)數(shù)據(jù)的使用方法
- 簡(jiǎn)介Android應(yīng)用中sharedPreferences類存儲(chǔ)數(shù)據(jù)的用法
相關(guān)文章
Android10 分區(qū)存儲(chǔ)的適配規(guī)則
Android設(shè)備 在Sdk29己以上推出了分區(qū)存儲(chǔ),類似iOS沙箱。應(yīng)用App 目標(biāo)版本號(hào)為29或以上則需要適配分區(qū)存儲(chǔ),本文將具體的講解適配規(guī)則2021-05-05
android ViewPager實(shí)現(xiàn)自動(dòng)無(wú)限輪播和下方向?qū)A點(diǎn)
本篇文章主要介紹了android ViewPager實(shí)現(xiàn)自動(dòng)輪播和下方向?qū)A點(diǎn),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下。2017-02-02
Android仿QQ好友列表實(shí)現(xiàn)列表收縮與展開(kāi)
這篇文章主要介紹了Android仿QQ好友列表實(shí)現(xiàn)列表收縮與展開(kāi),感興趣的小伙伴們可以參考一下2015-12-12
Android中標(biāo)簽容器控件的實(shí)例詳解
在Android開(kāi)發(fā)過(guò)程中,常常會(huì)遇到這樣的場(chǎng)景:我們展示一種物品或者為某一事物添加一些標(biāo)簽。比如說(shuō),我們買一件衣服,可以有以下幾種標(biāo)簽:杰克瓊斯,男士,運(yùn)動(dòng)等等。本文將實(shí)例介紹Android中標(biāo)簽容器控件的實(shí)現(xiàn)過(guò)程。2016-07-07
Android編程實(shí)現(xiàn)在底端顯示選項(xiàng)卡的方法
這篇文章主要介紹了Android編程實(shí)現(xiàn)在底端顯示選項(xiàng)卡的方法,涉及Android界面線性布局、相對(duì)布局及選項(xiàng)卡設(shè)置相關(guān)操作技巧,需要的朋友可以參考下2017-02-02
Android 8.1 Launcher3實(shí)現(xiàn)動(dòng)態(tài)指針時(shí)鐘功能
這篇文章主要介紹了Android 8.1 Launcher3實(shí)現(xiàn)動(dòng)態(tài)指針時(shí)鐘功能,本文通過(guò)實(shí)例代碼給大家介紹的非常詳細(xì),具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2018-07-07
Android仿QQ空間動(dòng)態(tài)界面分享功能
這篇文章主要介紹了Android仿QQ空間動(dòng)態(tài)界面分享功能,本文圖文并茂給大家介紹的非常詳細(xì),需要的朋友可以參考下2017-04-04
android之json數(shù)據(jù)過(guò)長(zhǎng)打印不全問(wèn)題的解決
這篇文章主要介紹了android之json數(shù)據(jù)過(guò)長(zhǎng)打印不全問(wèn)題的解決,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧2020-04-04
詳解Android如何實(shí)現(xiàn)好的彈層體驗(yàn)效果
當(dāng)前?App?的設(shè)計(jì)趨勢(shì)越來(lái)越希望給用戶沉浸式體驗(yàn),這種設(shè)計(jì)會(huì)讓用戶盡量停留在當(dāng)前的界面,而不需要太多的跳轉(zhuǎn),這就需要引入彈層。本篇我們就來(lái)講講彈層這塊需要注意哪些用戶體驗(yàn)2022-11-11

