2

What permission do I need? Folder appDir.exists() but not appDir.canRead().

Ruslanas Balčiūnas
  • 7,310
  • 3
  • 24
  • 41

2 Answers2

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
  • Yes, I've seen it. It deletes it's own cache only. – Ruslanas Balčiūnas Jul 02 '12 at 12:47
  • 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