IntelliJ IDEA 13.1 Web Help

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.

Creating an Android SQLite data source
  1. Open the Database tool window by choosing View | Tool Windows | Database on the main menu.
  2. Click add on the toolbar and choose Android SQLite on the drop-down menu.
  3. In the Data Sources and Drivers Dialog that opens, specify the following:
    1. The name of the data source.
    2. 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.
    3. Specify the name of the application package the target database is associated with. For more information about application packages, see Working with AndroidManifest and http://developer.android.com/guide/topics/manifest/manifest-element.html#package. 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.

    4. 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.
    5. 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>.
    6. If the necessary SQLite driver files are missing, download them by clicking the Download link in the bottom of the dialog box.

See Also

Procedures:

Reference:

Web Resources: