什么是SQLite
SQLite 是一种开源的无需安装和管理配置的数据库引擎。它不需要服务器的支持,并且有事务处理的功能。SQLite不占用太大的空间,数据库支持强大的数据存储在移动以及嵌入式应用程序中。
什么是adb
Android Debug Bridge (adb) is a versatile command line tool that lets you communicate with an emulator instance or connected Android-powered device. It is a client-server program that includes three components:
Android Debug Bridge(adb)是一个可以与模拟器实例或者安卓设备通信的通用命令行工具。它是一个包含三个一下组件的客户-服务器程序。
· A client, which runs on your development machine. You can invoke a client from a shell by issuing an adb command. Other Android tools such as the ADT plugin and DDMS also create adb clients.
组件一:运行在开发机器上的客户端,你可以发出adb命令来从shell 中调用客户端。其他安卓工具比如ADT插件还有DDMS 同样能够创建adb客户端.
· A server, which runs as a background process on your development machine. The server manages communication between the client and the adb daemon running on an emulator or device.
组件二:作为后台进程运行在开发机器上的服务器。这个服务器管理运行在模拟器与设备之上的客户机以及adb守护进程之间的通信.
· A daemon, which runs as a background process on each emulator or device instance.(daemon : is a computer program that runs as a background process, rather than being under the direct control of an interactive user)
组件三:一个守护运行在每个模拟器或者设备实例上的后台进程(守护进程运行在计算机上的后台进程,而不受交互用户控制).
怎么找到adb tool
adb tool 在你安装SDK位置下的/platform-tools/下
创建并且链接到数据库中
首先导入android.database.sqlite.SQLiteDatabase 到工程中。然后调用openOrCreateDatabase() 函数来创建并连接到数据库。
package higherpass.TestingData;
import android.app.Activity;
import android.os.Bundle;
import android.database.sqlite.SQLiteDatabase;
public class TestingData extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate