Reputation: 284
My proble is I created a device in sqlite database browser and its work fine in emulator. but when a try my application to my device it cause force close. and when I remove the database and create a new one using eclipse it works fine even in my device. But inserting a lot of data in database 1 by 1 realy freakin me out so anyone know a sqlite database browser that also work for device??!
Upvotes: 0
Views: 857
Reputation: 16393
If you want to create a pre-loaded DB outside of your app and use it in your app later, you will have to put it in your assets
directory and then copy it to your apps storage space the first time your app is started.
This is due to the fact that as a security measure, on real (unrooted) devices nothing but your own app is allowed access to that apps databases directory (and certain other ones as well).
There is a good tutorial for creating/copying your own DB outside of the app and copying it to the apps databases directory here.
Upvotes: 0
Reputation: 4489
On real device you don't have permissions to sqlite database. That's why you won't be able to browse database like you can on a emulator. See this for a work around. Tool to see android database, tables and data
Upvotes: 0
Reputation: 5203
check out this tutorial for using database file in application.
Remember one thing that it only copy you DB file in application that's it.
Upvotes: 1