1

I have a question regarding creating an android application for travel guide. I am creating it offline. I am familiar with the problem that we access the database on the real device. I want an external database file in which the data is already filled. I just want to include this database in my apk and just want to access that database in my phone offline. I am using SLQite database. I had imported db file from assets folder. It works on emulator but not on a real device due to no access to system files.

Bill the Lizard
  • 398,270
  • 210
  • 566
  • 880
Nikhil Jain
  • 198
  • 2
  • 10
  • Try to install your application in external storage of the device to access the files from the real device. Write in your manifest file `` tag. This will install your application in external storage so that you will get access of db file. – GrIsHu Oct 08 '13 at 05:19

2 Answers2

0

I think this blog post does what you want to do. I am using this approach in my applications for a while and I am satisfied with it.

It is fast and relatively easy. http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/

tasomaniac
  • 10,234
  • 6
  • 52
  • 84
0

I have included the db in assets folder and the db file is copied in the path sdcard/Android/data/packagename/test.db on a real device..now I am accessing the db, it works fine on emulator but when I used it on a real device it get crashed.the db is still not working on real device.

Nikhil Jain
  • 198
  • 2
  • 10