Android development: Using sqlite3 to operate databases
You can use the sqlite3 tool to operate databases in two ways, so that you can respect others' labor results. For more information, see the source: Android development uses the sqlite3 tool to operate databases.
Http://blog.csdn.net/fengyuzhengfan/article/details/40193123
The "sqlite3.exe" tool is provided in the tools directory of the Android SDK. It is a simple SQLite database management tool, similar to the command line window provided by MySQL. Sometimes, developers use this tool to query and manage databases.
The following two methods are described:
Method 1:
1. Add the tools path under the sdk directory to the path environment variable.
2. Import the. db3 database to a computer (D:/my. db3)
3. Run sqlite3 d:/my. db3 in Cmd.
4. You can open the my. db3 database.
Method 2:
Open the sqlite database of the application in the virtual machine:
1. Enter adb shell in dos to enter the android system of the VM.
Tip: 1. Because android is based on the linux kernel, you can use linux commands to perform some operations here.
2. If the system prompts "adb not" internal or external commands, you need to use the sdk... Add sdk \ platform-tools to the system path variable.
2. Then enter sqlite3 data/your application package name/databases/your database name. To open, such:
Tip: SQLite allows you to save various types of data to any type field. Developers do not need to declare the data type used by this field. For example, a program can store string-type values in INTEGER fields, or store numeric values in Boolean fields ...... One exception is that fields defined as integerprimary key can only store 64-bit integers. SQLite produces errors when saving data of other types than Integers to such fields.
Since SQLite allows you to ignore the actual data type of the underlying data column when storing data, you can use the type declaration following the data column when writing the table creation statement, for example, the following SQL statement is correct for SQLite.