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