How to Use the command line in Android to view the embedded database sqlite3

Source: Internet
Author: User

In Android Application Development, we may sometimes use the built-in database sqlite3 in the system. For example, we have created a database in an application, how to view the database or the tables or data contained in the database. The following describes how to create a database and a table in an application and view the database and table using the command line. augurit. the login application creates augurcity. DB database and sysuser table ]. For example:

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

[1] In Android, data inventory is usually stored in the/data/[application package name]/databases directory.

[2] cd command: folder jump command. LS command: view the files in a folder.

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

[4] After step 3, you can run the. Tables command to view the tables contained in a database. To query the data contained in a table, run the SQLite> command and enter the SQL statement to query the data. However, you must use the semicolon [;] to end the input of the statement.

[5] If you enter the ADB shell in the command line, the prompt is: ADB is not an internal or external command, or a program that can be run, or a batch file, this problem occurs because the environment variables are not set properly. Solution: Find the directory where the ADB tool is located under the installed Android SDK package, which is generally in... /Android-SDK-Windows/tools directory or... /Android-SDK-Windows/platform-tools directory. Add the directory to the PATH environment variable.

Related Article

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.