What permission do I need? Folder appDir.exists() but not appDir.canRead().
Asked
Active
Viewed 2,145 times
2
-
Seems like this would be a security issue. – Jake1164 Jul 02 '12 at 11:46
-
"no application, by default, has permission to perform any operations that would adversely impact other applications" it says "by default". – Ruslanas Balčiūnas Jul 02 '12 at 13:00
-
Might help: http://stackoverflow.com/questions/17313721/how-to-delete-other-applications-cache-from-our-android-app – Zohar Sep 06 '16 at 08:40
2 Answers
0
I think you need to define in both manifests a common userid(android:sharedUserId="com.xxx.xxx"
):
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.your.package"
android:sharedUserId="com.xxx.xxx"
android:versionCode="1"
android:versionName="1.0" >
However you cannot do this if the other app is a 3rd party app. In that case you need a rooted phone. Let me know if this is the case.

Caner
- 57,267
- 35
- 174
- 180
-
Thanks for the hint, however I need to clear cache of 3rd party apps. There are several cache clearing apps available on Google Play, that means it's possible. All I need is the answer how it is done. Do I need sertificate from vendors or something like that? – Ruslanas Balčiūnas Jul 02 '12 at 12:34
-
If there are apps on google play that means there must be a way without need for a rooted phone. I don't know how to do it :( – Caner Jul 02 '12 at 12:36
-
-
what happens if you try to get the parent folder of your apps own cache folder? Are all cache folders under same parent folder? – Caner Jul 02 '12 at 12:48
-
Cache files are stored in /data/data/com.some.package/cache. My application can't read it's contents or write to it. – Ruslanas Balčiūnas Jul 02 '12 at 12:56
0
You can't, it would be a massive security flaw in Android if one application could clear another. If you're involved in the development of the other app that you're trying to clear, your best bet is to send an Intent and have the other app listen for that intent and clear its own cache when it received it.

Cathal Comerford
- 1,020
- 1
- 9
- 12