code: public static String getCacheDir(Context ctx) {
          return Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState()) || (!Environment.isExternalStorageRemovable() && ctx.getExternalCacheDir() != null) ?
                  ctx.getExternalCacheDir().getPath() : ctx.getCacheDir().getPath();
      }
docs: Gets the appropriate cache dir
  
  @param ctx
  @return