Android Context Get getExternalCacheDir(Context context)

Here you can find the source of getExternalCacheDir(Context context)

Description

get External Cache Dir

License

Open Source License

Declaration

private static File getExternalCacheDir(Context context) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.io.File;

import android.content.Context;

import android.os.Build;
import android.os.Environment;

public class Main {
    private static File getExternalCacheDir(Context context) {
        if (hasExternalCacheDir()) {
            return context.getExternalCacheDir();
        }/*from w  w  w .ja  va 2  s .  c o m*/
        final String cacheDir = "/Android/data/" + context.getPackageName()
                + "/cache/";
        return new File(Environment.getExternalStorageDirectory().getPath()
                + cacheDir);
    }

    private static boolean hasExternalCacheDir() {
        return Build.VERSION.SDK_INT >= Build.VERSION_CODES.FROYO;
    }
}

Related

  1. getDisplayPhoto(Context context, long photoFileId)
  2. getDpiToPix(Context ctx)
  3. getEditor( Context ctx)
  4. getExternalCacheDir(Context context)
  5. getExternalCacheDir(Context context)
  6. getFAFont(Context context)
  7. getFiles(Context context, String ext)
  8. getFromAssets(Context con, String fileName)
  9. getHelpUrl(Context context, String s)