getCachePath

public static String getCachePath(Context context)

Retrieves the cache storage path, such as /sdcard/Android/data/<package name>/cache

Return

The full path of the directory, or an empty string if external storage is not mounted or an error occurs

Parameters

context

The provided Context


public static String getCachePath(Context context, String dir)

Retrieves the cache storage path, such as /sdcard/Android/data/<package name>/cache/<dir>

Return

The full path of the directory, or an empty string if external storage is not mounted or an error occurs

Parameters

context

The provided Context

dir

The custom directory