0

How to set up a public available Xamarin Forms Android app in the Google Play App Store with system level security to for example deleting all app cache (freestorage).

Already tried adding the permission to the manifest. Dont know if I has to do with the system user id I forgot to add, Api level 23 or higher, or these options are only available for dangerous but not to signature|system level.

I see many new apps capable of doing this.

Kind regards,

XamDev
  • 1

1 Answers1

0

How to set up a public available Xamarin Forms Android app in the Google Play App Store with system level security to for example deleting all app cache (freestorage).

To register a dangerous Android system permission after Api version 23, we need to request permissions at run time. You can check it in the official document Requesting Permissions at Run Time:

If the device is running Android 6.0 or higher, and your app's target SDK is 23 or higher: The app has to list the permissions in the manifest, and it must request each dangerous permission it needs while the app is running. The user can grant or deny each permission, and the app can continue to run with limited capabilities even if the user denies a permission request.

For app cache, I think you specially point to the cache like in the folder data/data/<packagename>/cache, then it cannot be deleted from other app because all apps are running in sandbox. The old API for doing this is no more supported in API 23, that is Marshmallow. Permission <uses-permission android:name="android.permission.CLEAR_APP_CACHE"/> is deprecated in Marshmallow. So I personally think that for both internal storage cache and external storage cache, they can only be cleared by app itself or by system for now. You can also check the discussion here: How to delete other applications cache from our android app? .

But usually developers will usually create folder for data caching their app, because it is always suggested to maintain the cache files by developer themselves and stay within a reasonable limit of space consumed, such as 1MB. So like the images for this app, are usually saved in the folder which is created by developers. The files under this folder can be deleted, you may need permission for example like READ_EXTERNAL_STORAGE and WRITE_EXTERNAL_STORAGE for doing this.

Grace Feng
  • 16,564
  • 2
  • 22
  • 45