Open source China Oschina Android Client Source Analysis (12) Clean cache

Source: Internet
Author: User

In the previous article in the cache object we mentioned that there are three places where the object data is cached, and here's a detailed:

1 (/data/data/com.xxx.xxx/cache) apply the private cache directory, belong to the internal cache, other applications can not access, generally store smaller data;

2 (/mnt/sdcard/android/data/com.xxx.xxx/cache), apply the private external cache directory.

Custom directories under 3SD cards, shared.


To implement clear caching, first you need to know:

1 whether the application adopts the cache strategy;

2 What is the cached data and where is it cached?

The 3 cache size calculation is actually the sum of the size of the files you cache;

4 Clear the cached directory, directly trace to the directory, the directory of the files are all deleted.

In the client source code, the cleanup cache is encapsulated in the Datacleanmanager class, which provides cleanup of internal caches, external private caches, externally exposed caches, internal databases, and data in Sharedpreference.

Open source China Oschina Android Client Source Analysis (12) Clean cache

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.