Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Clear Application's Data Programatically from another Android Application

Tags:

android

I have an android application HELLOWORLD I am trying to create another android application HELLOWORLDCLEANER which can clear my HELLOWORLD application's data in one click

Application's data is like databases, shared preference files, and other files created within the application

I can clear data in the mobile through Settings->Applications-> ManageApplications-> My_application->Clear Data

But I don't want go every time to Settings page and clear the HELLOWWORLD app data. Does android provide such facility to do if I know the package name of HELLOWORLD application?

I have gone through solutions provided in Stackoverflow but it tells how to clear app data of itself not about other apps..

like image 916
Venkatesh Avatar asked Jan 24 '26 19:01

Venkatesh


1 Answers

Each Android application lives in its own security sandbox.

By default, the system assigns each application a unique Linux user ID (the ID is used only by the system and is unknown to the application). The system sets permissions for all the files in an application so that only the user ID assigned to that application can access them.

Which means you can't access another app's resources.

The only way you could achieve that would be by executing su commands, but that would require root access.

like image 122
Benito Bertoli Avatar answered Jan 27 '26 09:01

Benito Bertoli



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!