How to use the command line to view an inline database in Android Sqlite3

Source: Internet
Author: User

In Android application development, we may sometimes use embedded database sqlite3 in our system, such as when we create a database in an application, how to view the database, or how to see which tables or data are included in the database. Here's how I created a database and table in my application, and how to use the command line to see the database and table "as I created the augurcity.db database and the Sysuser table in the Com.augurit.login application." First look like:

In, except for the last red box, the other boxes are commands under the ADB shell.

"1" In Android programs, the database typically created is stored under the directory of the/data/data/[application package name]/databases.

"2" CD command: Folder Jump command. ls command: See what files are under a folder.

"3" uses the "Sqlite3 [database name]" command to perform a series of operations on a database.

"4" After the "3" step, you can use the. Tables command to see which tables are contained in a database. To query the data contained in a table, enter the query's SQL statement after the sqlite> command, but be aware that you want to use a semicolon [;] To end the input of the statement.

"5" If you enter the ADB shell on the command line, you are prompted that ADB is not an internal or external command, is not a running program, or a batch file, and this situation is caused by an environment variable that is not set properly. Workaround: In the installation of the Android SDK package directory found in the directory of ADB tools, generally in the .../android-sdk-windows/tools directory or in .../android-sdk-windows/ The Platform-tools directory. Adding the directory to the PATH environment variable is OK.

How to use the command line to view an inline database in Android Sqlite3

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.