IntelliJ IDEA 2016.2 Help

Accessing Android SQLite Databases from IntelliJ IDEA

If your application uses an Android SQLite database, you can access this database right from IntelliJ IDEA through a data source of the Android SQLite type. For more information about IntelliJ IDEA data sources, see Managing Data Sources.

Creating an Android SQLite data source

  1. Open the Database tool window by selecting View | Tool Windows | Database from the main menu.
  2. Click add on the toolbar and select Android SQLite from the drop-down menu.
  3. 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 is stored. If no devices are available in the drop-down list, this means that there are no 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 and Android documentation. Select a package name suggested by IntelliJ IDEA or type its 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, you can 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.
      • If the database is stored in the external memory, specify the database location relative to the memory root. For example, Android/data/<application_ID>/<database_name>.
    • If the necessary SQLite driver files are missing, download them by clicking the Download link at the bottom of the dialog box.

See also, Managing Data Sources.

See Also

Last modified: 23 November 2016