Android資料儲存和訪問之SQLite儲存

2021-07-31 02:08:45 字數 1009 閱讀 6947

sqlite資料庫簡介

acid;資料庫事物正確執行的4個基本要素:

1:原子性2:一致性3:隔離性4:永續性

資料的常用操作主要有以下:

1、建立資料庫:

2、新增資料庫

public  void adddata(view view)
3、刪除資料

public  void deletedata(view view));

}

4、更新資料

public  void querydata(view view)while(cursor.movetonext());

}

在dbhelper類中import android.content.context;

import android.database.sqlite.sqlitedatabase;

import android.database.sqlite.sqliteopenhelper;

import android.util.log;

import android.widget.toast;

public class dbhelper extends sqliteopenhelper

@override

public void oncreate(sqlitedatabase db)

@override

public void onupgrade(sqlitedatabase db, int oldversion, int newversion)

}

Android之資料儲存

概述 1.android中包含5中資料儲存方式 sharedpreferences儲存資料。contentprovider儲存 檔案儲存 sqllite資料庫儲存 網路儲存 preference file database 這三種方式分別對應的目錄是 data data package name s...

android資料儲存與訪問之使用普通檔案

很多時候我們的軟體需要對處理後的資料進行儲存或再次訪問。android為資料儲存提供了如下幾種方式 檔案sharedpreferences 引數 sqlite資料庫 內容提供者 content provider 網路 一.檔案 1.1使用檔案進行資料儲存 1.2 讀取檔案內容 如果要開啟存放在 da...

android之資料儲存之SQLite

sqlite開源輕量級資料庫,支援92 sql標準,主要用於嵌入式系統,只佔幾百k系統資源此外,sqlite 不支援一些標準的 sql 功能,特別是外來鍵約束 foreign key constrains 巢狀 transcaction 和 right outer join 和 full outer...