Android Tools-SQLITE3

Source: Internet
Author: User

Original articles, if reproduced, please specify the source: http://blog.csdn.net/yihui823/article/details/6689922

Prerequisites for this article: Eclipse and ADT are already installed. The Android SDK is also downloaded. The previous ID SDK for this article has been set up in Eclipse Andro.

This article will systematically introduce the various tools for Android debugging. The talk will be relatively thin, I hope to be helpful to everyone.

SQLITE3

SQLite is a very popular embedded database, it provides a crisp SQL interface, a fairly small memory footprint and high-speed response. It is important that it is free, there will be no patent traps, and will not be used because of how much money each Android phone makes to the rogue competitor of Android. ^_^

SQLite3 is a simplified database, much less than a traditional database, such as foreign keys and left and right connections. However, this does not affect our use, after all, it is processing embedded data, not massive data.

The Android SDK has been brought with the Sqlite3 command line. However, we usually go into the ADB shell first, directly using the sqlite3 on the phone to view/manipulate the database. The code inside how to write the code of the database, I will open another chapter description, here just write how to use the command line.

First use the ADB shell to enter the mobile phone terminal. The generic database file ends in. db and is placed in the/data/data/[application's package]/databases directory. Let's go to the alarm directory:

>>ADB Shell

#cd/data/data/com.android.alarmclock/databases

#sqlite3 alarms.db

The command line mode that will enter Sqlite3:

# sqlite3 Alarms.db

Sqlite3 alarms.db

SQLite version 3.6.22

Enter '. Help ' for instructions

Enter SQL statements terminated with a ";"

Sqlite>

1, you need to see how many tables you currently have, enter:

Sqlite>.table

2, you can enter the SQL command directly. For example, enter

Sqlite>select * from alarms;

Remember to be sure to ";" End Oh.

3, exit, enter:

Sqlite>.quit

4, view Help, enter:

5, Sqlite>.help

Of course, you can also use the ADB pull command, the db file from the phone down to the PC side, directly using the Android SDK with the Sqlite3 command to operate the db file. Once adjusted, upload the db file to the phone using ADB push.

It is recommended to use some visual Sqlite3 tools. Tools for Linux and win: Sqlitebrowser.

Android Tools-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.