Android Development two ways to operate a database using the Sqlite3 tool

Source: Internet
Author: User

two ways to manipulate a database using the Sqlite3 tool Please respect other people's labor results, reproduced please specify the Source:Android Development using the Sqlite3 tool to operate the database two ways
http://blog.csdn.net/fengyuzhengfan/article/details/40193123

A "Sqlite3.exe tool" is provided under the Tools directory of the Android SDK, which is a simple SQLite database management tool, similar to the command-line window provided by MySQL. In some cases, developers use the tool to inquire and manage databases.

Two ways are described below:

The first way:

1. Add the tools path under the SDK directory to the PATH environment variable.

2 . Import the. db3 database into your computer such as (D:/MY.DB3)

3. cmd run sqlite3 d:/my.db3

4. You can open the MY.DB3 database.

The second way:

Open the SQLite database for the application in the virtual machine:

1. Under DOS, enter the ADB shell into the virtual machine's Android system


Tips: 1. because android is based on The Linux kernel, Linux can be used here command to perform some operations.

2. If you are prompted for "adb not " internal or external commands, you need the SDK ... sdk\ The Platform-tools is added to the system path variable.

2. Then enter sqlite3 data/data/ Your application package name /databases/ your database name . Can be opened, such as:


hint: sqlite Span style= "color:red" > allows you to save various types of data to any type of field, and developers can not care about the type of data used to declare the field. For example, a program can store the value of a string type in a field of type integer But there is one case integerprimary KEY 64 sqlite

because SQLite allowing data to be stored ignores the actual data type of the underlying data column, so when you write a table statement, you can The type declaration following the Collo data column, such as the following SQL Statement for SQLite is also correct.

Android Development two ways to operate a database using the Sqlite3 tool

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.