Data, Data, Everywhere

 

If you are used to developing for other databases, you are also probably used to having tools to inspect and manipulate the contents of the database, beyond merely the database’s API. With Android’s emulator, you have two main options for this.

First, the emulator is supposed to bundle in the console program and makes it available from the command. Once you are in the emulator’s shell, just execute , providing it the path to your database file. Your database file can be found at the following location:

 

Here is the Java package for your application (e.g., ) and is the name of your database, as supplied to .

Note, however, that the Android 0.9 SDK appears to be missing the command, though it has returned in Android 1.0.

The program works, and if you are used to poking around your tables using a console interface, you are welcome to use it. If you prefer something a little bit friendlier, you can always copy the SQLite database off the device onto your development machine, then use a SQLite‑aware client program to putter around. Note, though, that you are working off a copy of the database; if you want your changes to go back to the device, you will need to transfer the database back over to the device.

To get the database off the device, you can use the command (or the equivalent in your IDE), which takes the path to the on‑device database and the local destination as parameters. To store a modified database on the device, use adb push, which takes the local path to the database and the on‑device destination as parameters.

One of the most accessible SQLite clients is the SQLite Manager[19]extension for Firefox (Figure 20‑1), as it works across all platforms.

Figure 20‑1. The SQLite Manager Firefox extension

You can find other client tools[20]on the SQLite Web site.[21]

 

 








Дата добавления: 2015-05-16; просмотров: 902;


Поиск по сайту:

При помощи поиска вы сможете найти нужную вам информацию.

Поделитесь с друзьями:

Если вам перенёс пользу информационный материал, или помог в учебе – поделитесь этим сайтом с друзьями и знакомыми.
helpiks.org - Хелпикс.Орг - 2014-2024 год. Материал сайта представляется для ознакомительного и учебного использования. | Поддержка
Генерация страницы за: 0.004 сек.