清除应用程序缓存编程?

清除应用程序缓存编程?

问题描述:

我想写一个实用工具,用户可以选择一组安装的应用程序,并清除其数据的高速缓存,即喜欢,你可以使用内置的设置 - > Applictions设置手动的方式做屏幕的清除缓存按钮

I want to write a utility where the user can select a set of installed apps and clear their data caches i.e. like the way you can do manually using the built-in Settings->Applictions settings screen with the "Clear cache" button.

我如何可以访问多少缓存数据的每个应用程序都有和编程清楚这些缓存?

How can I access how much cached data each app has and programmatically clear these caches?

普通的SDK应用程序没有权限访问,更不用说修改,其他应用程序的缓存,任何超过他们有破解文件的权利。

Ordinary SDK applications have no rights to access, let alone modify, the caches of other applications, any more than they have a right to hack your files.

这是可能的植根与手机以root运行你的应用程序,在这种情况下,你将不得不手动构建基于应用程序的包名的路径。

This may be possible on rooted phones with your application running as root, in which case you will have to manually construct the paths based upon the apps' package names.