What are the differences between data cleanup, cache cleanup, and one-click cleanup for Android?

Source: Internet
Author: User

What are the differences between data cleanup, cache cleanup, and one-click cleanup for Android?
Preface

?? On Android devices, we often see system or application-related cleanup functions such as data cleanup, cache cleanup, and 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

?? Data cleanup is mainly used to clear user configurations, such as SharedPreferences and databases. The data is the user configuration information saved during the running of the program. After the data is cleared, the next entry into the program is the same as the first entry into the program;

Clear Cache

?? The 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

?? 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

?? To prevent unrelated useless files from being left in the file system after the program is uninstalled, 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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.