I want to know one thing related sqlite in android.
When i install my app and run it and do my operation's save some data and read data.
but when i uninstall my app and install it again.
I tried to read data but it does not show any thing .It means database deleted on uninstall the app.
If yes ,how to prevent my database to uninstall.
I'm assuming you're creating your database on the internal storage as most apps do.
When you uninstall your app, the entire data directory of the app is deleted. This includes databases, preferences, other files, caches etc.
You could try saving the database to the SD Card instead and reading from there. However, you will now lose access to the database if the user changes the SD Card or mounts it to the computer pre honeycomb.
Another option would be to back it up to a server at regular intervals and restore the backup from there manually, or implement something like the Google BackupAgent, which will automatically backup data if the user configures his/her device to backup against the Google account to which it is registered.
If you're worried about your data being read by others, encrypt it using AES or some other encryption technique.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With