Using SQLite from Shell in Android
	
    
    
	Where is SQLite? 
SQLite is available on the Android device itself. The executable is in the /system/bin directory of the device. You can see that this directory contains the shell commands like ls, ps, etc., as well as sqlite3, dalvikvm, and dexdump utilities. 
Code Listing 1. Contents of system/bin 
# pwd 
pwd 
/system/bin 
# ls -l 
ls -l 
-rwxr-xr-x root root 196 2008-02-29 01:09 am 
-rwxr-xr-x root root 2342 2008-02-29 01:09 dumpstate 
-rwxr-xr-x root root 208 2008-02-29 01:09 input 
-rwxr-xr-x root root 212 2008-02-29 01:09 monkey 
-rwxr-xr-x root root 196 2008-02-29 01:09 pm 
… 
lrwxr-xr-x root root 2008-02-29 01:16 mount -> toolbox 
lrwxr-xr-x root root 2008-02-29 01:16 notify -> toolbox 
-rwxr-xr-x root root 28032 2008-02-29 01:16 dexdump 
-rwxr-xr-x root root 7100 2008-02-29 01:16 dumpsys 
-rwxr-xr-x root root 7904 2008-02-29 01:16 mem_profiler 
-rwxr-xr-x root root 6480 2008-02-29 01:16 service 
-rwxr-xr-x root root 4320 2008-02-29 01:16 rild 
-rwxr-xr-x root root 4928 2008-02-29 01:16 sdutil 
-rwxr-xr-x root root 26488 2008-02-29 01:16 sqlite3 
-rwxr-xr-x root root 4148 2008-02-29 01:16 dexopt 
-rwxr-xr-x root root 4908 2008-02-29 01:16 dalvikvm 
-rwsr-sr-x root root 3200 2008-02-29 01:16 surfaceflinger 
-rwxr-xr-x root root 5420 2008-02-29 01:16 app_process 
-rwxr-xr-x root root 39408 2008-02-29 01:16 runtime 
-rwxr-xr-x root root 2920 2008-02-29 01:16 system_server 
-rwxr-xr-x root root 9168 2008-02-29 01:17 pv
Where are the SQLite databases on an Android Device? 
By default, the SQLite databases have an extension .db. For example, a NotePad application may use note_pad.db database. This might be created from code using Android SDK’s SQLite classes/methods. By default, the SQLite database for an application is in the /data/data/<app>/databases directory. As you can see from the listing below, the notepad database is in the /data/data/com.google.android.notepad/databases directory. 
Code Listing 2.
    
     
	
	
    
    
	相关文档:
        
    
    QT读写Sqlite数据库
//.h
/****************************************************************************
**
** Date    : 2010-05-08
** Author  : furtherchan
** If you have any questions , please contact me
**
****************************************************************** ......
	
    
        
    
    前一阵字做项目(嵌入式linux),由于要保存大量的数据,而且最长要保存30天的时间。本来打算保存到文件中,每次启动应用程序的时候重新解析一遍,可是当数据量很大的时候,就出现效率的问题了。所以最后还是放弃了使用文件的打算,决定使用数据库存取数据。
linux下的数据库也很多,有开源的,也有收费的。对于我们来说,肯 ......
	
    
        
    
    1. 下载最新版 SQLite (sqlite-3_6_23_1), copy到C:\下.
2. 新建数据库: 
C:\>sqlite3.exe "d:\testdb.db"
3.进入了sqlite3之后,会看到以下文字:
SQLite version 3.1.3
Enter ".help" for instructions
sqlite>
4.建一个名叫film的数据库表
create table film(title, length, year, starring);
5.插入记录 ......
	
    
        
    
    1:定义表的结构和名字,我使用以下方法:
public interface Constatnts extends BaseColumns {
   public static final String TABLE_NAME = "test";
   
   public static final String TIME = "time";
   public static final String TITLE = "title";
}
在这里,我继承 ......