If your application uses an Android SQLite database, you can access this database right from IntelliJ IDEA through a data source of the type Android SQLite. For more information about IntelliJ IDEA data sources, see the section Data Sources.
- Open the Database tool window by choosing on the main menu.
- Click on the toolbar and choose Android SQLite on the drop-down menu.
In the Data Sources and Drivers Dialog that opens, specify the following:
- The name of the data source.
- The physical or virtual device where the target database of stored. Choose the relevant device from the Device drop-down list. If only the None option is available, this means that there are not running devices connected to IntelliJ IDEA. Run and connect a physical device or launch an emulator.
Specify the name of the application package the target database is associated with.
For more information about application packages, see Working with AndroidManifest
Select a package name suggested by IntelliJ IDEA or,
if none of the suggestions is suitable, type the ID.
For the database to be accessible, the corresponding application must be built as debuggable and installed on the device or the emulator.
IntelliJ IDEA run configurations, by default, build Android applications in the debug mode. Alternatively, generate the APK in the debug mode.
In the Storage area, specify where the database is located:
- Choose Internal if the database is stored in the internal memory of the device or the emulator.
- Choose External if the database is stored in the external memory of the device or the emulator.
In the Database drop-down list, specify the database name or location:
- If the database is stored in the internal memory, choose the database name. One of the names suggested by IntelliJ IDEA may do.
- If the database is stored in the external memory, specify the database location relative to the memory root. This may be something like Android/data/<application_ID>/<database_name>.
- If the necessary SQLite driver files are missing, download them by clicking the Download link in the bottom of the dialog box.
Learn more in Creating and Importing Data Sources.