Where can I access databases in Eclipse for Android development?

Sorry if this is a stupid question, nonetheless I need to ask. I am new to Android development and went through each tutorial and provided a link. I am doing a great job except for one stupid problem; I can not find where the databases are stored for some applications.

For example, I would like to create my own application, which includes thousands of pre-made records from an installed SQLite database. As a reference, I tried to use the "Searchable Dictionary" application from the provided programs in the Android SDK, but I can not find it.

I read that all databases are stored in / data / data // databases on the device, but I can not find this location. So, how do I access a database in Eclipse or elsewhere to set up my preconfigured database?

Many thanks!

+3
source share
2 answers

not directly in eclipse, but sqlite db browser is petty http://sqlitebrowser.sourceforge.net/

+2
source

Assuming your package for your application is com.example.androidapp and the database name is db, you can do the following:

adb shell

and then on the shell command line

cd /data/data/com.example.androidapp/databases
sqlite3 db

and then in sqlite3 interface for example.

.schema

or

SELECT * FROM tablename;

etc.

0
source

Source: https://habr.com/ru/post/1751675/


All Articles