I have a problem related to the app that I developed which runs on honeycomb. When I reinstall the apk its database gets deleted. There did not used to be this almost 1 week ago. Why this is happening now? What can cause db to be deleted and how to prevent it?
-
1Look at my edited answer, with links.. – user370305 Dec 08 '11 at 08:56
2 Answers
I think, If your database stored in application's internal storage /data/data/<package_name>/databases/
then when your application un-installed from device, all directories with your application package are removed from the device this cause your database removed.
To prevent put your database copy in application's /asset
directory so whenever your application first time runt it copy the database from asset to internal storage path. And you can access it whenever application re-installed, also you can put your database in /sdcard
but user can also delete it..
EDIT: Using your own SQLite database in Android applications and How to ship an Android application with a database?
Thanks...

- 1
- 1

- 108,599
- 23
- 164
- 151
-
firstly thank you for your comment, so how do I do this? Easy thing to do? – Mustafa Güven Dec 08 '11 at 08:21
i guess it about checking existing database in your code. but i'm not sure exactly, it can occur from many causes. Just give an idea.

- 1,810
- 2
- 28
- 52