1

is there any way, when uninstalling application, that I also remove some data, which was used by that application? I mean some sort of onUninstall method?

Thanks

1
  • See my updated answer. See how it helps. Commented Nov 2, 2012 at 7:27

3 Answers 3

1

That kind of data you have to store in /data/data/ so that when the application is uninstalled the data of your app also removed. Your can use Activity.getDir() to get that folder.

Sign up to request clarification or add additional context in comments.

Comments

1

Sorry, Android (as of now) does NOT have any method like onUninstall. So there's no way you can run any code while uninstalling. Have a look at this thread for more information.

However, you can use createExternalStoragePrivateFile and getExternalFilesDir methods to create an external file. Which will be deleted when your app is uninstalled.

Take a look at docs and sample code from Android dev site.

Comments

0

No,That will always remove data which stored in APK.

if you will store in sd card then it may be possible that you can get back but developer can also remove that data from any other location for security reason.

some time developer did not remove form sd card . so that you can get back and reuse again by your coding.

so,now its depends on you that where you are storing your data and how you will use them.

3 Comments

Thanks. I need to remove data from certain folder on SD card, when uninstalling my app. How?
when you storing your data @ that time you had write code as same you have to write code for remove data from their.
which type of data you want to store ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.