Android clears data, clears cache, one-click cleanup, and android Cache
Preface
Zookeeper in Android devices, we often see system or application-related cleanup functions: clear data, clear cache, one-click cleanup, so many purge functions are hard to understand for a programmer, but many Android devices have these functions, which is more difficult for users to understand and think of when playing mobile phones, the index details their specific differences.
What are the differences between clearing data, clearing cache, and one-click cleanup?
Clear Data
Zookeeper clears user configurations, such as SharedPreferences and databases. The data is the user configuration information saved during the program running. After the data is cleared, the next entry into the program is the same as the first entry into the program;
Clear Cache
The Zookeeper cache is a temporary storage space when the program is running. It can store temporary images downloaded from the network. Clearing the cache from the user's point of view has no significant impact on users, however, when the APP is used again after the cache is cleared, because the local cache has been cleared, all data needs to be retrieved from the network again. Note: to clear the cache properly, store the cache file in the getCacheDir () or getExternalCacheDir () path. For example, to clear the cache, the chat records, user portraits, images, text, and other information cached by the circle of friends will be cleared. After the cache is cleared, you will find that the message records are cleared, the pictures and user portraits in the circle of friends must be loaded for a while before they can be displayed normally.
One-click cleanup
Zookeeper one-click cleanup is a system-level function. It is mainly used to kill background processes to release the memory. However, the process to kill is related to the important threshold value set during cleanup, the greater the important value, the lower the importance of the process. If the important value of a process exceeds the threshold during cleaning, the process will be killed. For example, when an application is in the background, all services related to the application will be killed after a clean-up (some services do some special processing and cannot be killed !!!).
References
What's the difference between clear cache & clear data in android settings
What data will be cleared by clearing data in Android system settings?
One-click cleanup and memory cleanup functions of Android
How to delete files created by the application on uninstall?
Description
Zookeeper allows a program to be uninstalled without leaving unrelated useless files in the file system, we recommend that you store application-related configuration and cache files in the folders that will be deleted when the program is uninstalled (music files, video files, images, and e-books are suitable for reading and browsing files for multiple applications ). except ), specific paths include:
/Data/package/
GetFilesDir ()
GetCacheDir ()
GetExternalCacheDir () (whether the program can be deleted when it is uninstalled depends on the API level)
GetExternalFilesDir () (whether the program can be deleted when it is uninstalled depends on the API level)