tags:

views:

17

answers:

2

Hello In my android application when the user reinstall the app again i would like to delete the existing database and create a fresh new one.

How could i know that the user is reinstalling the app or is quering for the updates request.

How could i delete a file in raw folder?

Please share your valuable suggestions.

Thanks in advance:)

A: 

Hello In my android application when the user reinstall the app again i would like to delete the existing database and create a fresh new one.

If by "reinstall", you mean "uninstall and reinstall", your existing database will be deleted during the uninstall process, assuming it resides in the normal database location (i.e., not on external storage).

How could i know that the user is reinstalling the app

You don't.

How could i delete a file in raw folder?

In Android? You don't. Resources cannot be modified or removed at runtime.

CommonsWare
Thanks for the info.I have added comment above please let me know if any solution.
Remmyabhavan
@Remmyabhavan: No, you have not "added comment above".
CommonsWare
A: 

Reinstalling application deletes all data for the application. If you mean reinstalling is upgrading then you can observe the new version number in the SQLiteOpenHelper.onUpgrade() method.

To delete the database file, it is explained here (Database Delete Android).

caligari
I require it not in upgradation process.The issue is like if the customer has downloaded the apk file into the softwares table and have installed it.Then if he wants to reinstall the app by clicking on the apk file again then his existing DB should get deleted.
Remmyabhavan
I think the process you are commenting is not documented and it is disapproved...
caligari