Android学习笔记之SQLite

什么是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
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值