0

How can I view the DB in IntelliJ to view its content and perform operations on it. Now I have created my tables etc but i have no idea what data is on the DB and I do not want to create queries in java to check it. seems like a slow workflow so ill wait til I know how to access the db that resides on the Android emulator im using.

Is it possible?

1

3 Answers 3

2

You can also use Stetho. A nice debugging tool from Facebook.

Just simple to use, initialize it in your Application class and access your sqlite and even shared preferences from Google Chrome's developer console.

Sign up to request clarification or add additional context in comments.

2 Comments

BTW, don't use it in production see this question regarding that.
Right! You should use it with flavors or Dagger. Enabling it for example only on debug flavor.
0

You can create a database file outside of Android and use any tool to create and read it.

Then, you place it in the assets folder and setup your code to read the database from there instead of private app data. Caveat here is that a copy will be made from the assets folder to the app data, so any updates within the app won't be mirrored to the database file in the assets folder.

I believe you can access the DDMS window in Intellij/Android Studio and there is a Database Explorer there

6 Comments

Do you mean the app->intermediaries->assets folder? and just drag and drop it there? What path should I use in that case?
Nope, an assets folder is either inside of or next to the res folder, can't remember
in the project structure IntelliJ created its no assets folder in res or rs its inside the "intermediaries" folder
You have to do File > New > Assets
do u mean create the assets folder inside the res or rs folder?
|
0

see @alexsimo's answer.

Without root you cannot access your database on your device, unless the file is created with a+r permissions.

Since that is something that is unrelated to the issue, you can just search in plugin.jetbrains.com for sqlite and get a variety of plugins.

2 Comments

Most of those plugins are only for ultimate edition, though
alternative is to use an outside editor something like, github.com/sunnygoyal/jade and work on getting the database from the device.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.