public static void getFile(Context context){
LogDcjet.e("hanlx", "Environment.getExternalStorageDirectory()" +
Environment.getExternalStorageDirectory().getAbsolutePath());
// /storage/sdcard1

LogDcjet.e("hanlx", "Environment.getDataDirectory()" +
Environment.getDataDirectory().getAbsolutePath());
// /data

LogDcjet.e("hanlx", context.getCacheDir().getAbsolutePath());
// /data/data/com.dcjet.oa/cache

LogDcjet.e("hanlx", context.getExternalCacheDir().getAbsolutePath());
// /storage/sdcard1/Android/data/com.dcjet.oa/cache

LogDcjet.e("hanlx", context.getExternalFilesDir(null).getAbsolutePath());
///storage/sdcard1/Android/data/com.dcjet.oa/files

LogDcjet.e("hanlx", context.getFilesDir().getAbsolutePath());
// /data/data/com.dcjet.oa/files

Log.d("hanlx", Environment.getExternalStorageState().equals(android.os.Environment.MEDIA_MOUNTED) + "");
//true

//以上是默认存储位置设为SD卡,保存在外存的数据保存在SD卡上
//以下是默认存储位置设为内存设备,保存到外存的数据保存在手机上,不root用文件管理器可以看到,卸载了sd卡判断外存是否存在,结果是true;


// /storage/emulated/0
// /data
// /data/data/com.dcjet.oa/cache
// /storage/emulated/0/Android/data/com.dcjet.oa/cache
// /storage/emulated/0/Android/data/com.dcjet.oa/files
// /data/data/com.dcjet.oa/files
// true

更多相关文章

  1. android使用HTTP协议读取数据
  2. Android PopupWindow显示位置和显示大小
  3. android升级数据库(Sqlite)简单示例
  4. Android Room 数据库
  5. android 数据保存与提取
  6. android数据库操作
  7. sqlit导入外部数据库查找数据方法
  8. Android 和 PHP 之间进行数据加密传输

随机推荐

  1. Android小功能集
  2. Android(安卓)设置横屏/竖屏
  3. android 工具类:用来判断一个文件是不是图
  4. Android(安卓)UI: LinearLayout中layout_
  5. Android中ListView多种Item布局
  6. 【转载】android仿QQ列表的效果实现
  7. android内核编译过程
  8. Android各种获取Context方法
  9. Android(安卓)Lock 使用
  10. Android下使用Logcat打印信息