-1

I am creating an app, which uses a database, which I created using SQLiteManager. I am trying to use the database in Android Studio 1.2 project. I put the database in res/raw directory. When I deployed the app on my phone and tried contact.fileList() it does not show my database file.

Does anyone know how to refer to it in Android Studio 1.2 and how to load it as a SQLite database?

I searched the web but most of the results are very old and do not work with my project.

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
ParekhAbhishekN
  • 245
  • 3
  • 14

1 Answers1

2

When I deployed the app on my phone and tried contact.fileList() it does not show my database file.

Resources are not files on the device.

Does anyone know how to refer to it in Android Studio 1.2 and how to load it as a SQLite database?

There is nothing built into Android for that. I recommend moving the database to your assets/ directory and using SQLiteAssetHelper. This sample project demonstrates its use in an Android Studio environment.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491