// /storage/emulated/0 public static void getEnvirmentPath(){ Logger.e("--> "+ Environment.getExternalStorageState() +" : "+ Environment.getExternalStorageDirectory().getAbsolutePath()); } // /data public static void getDataDirectory(){ Logger.e("info"+Environment.getDataDirectory().getAbsolutePath()); } // /cache : /storage/emulated/0/Music public static void getDonwLoader(){ Logger.e("info"+ Environment.getDownloadCacheDirectory().getAbsolutePath()+" : "+Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_MUSIC)); } // /system : true public static void getEnvironmentState(){ Logger.e(Environment.getRootDirectory().getAbsolutePath()+ " : "+Environment.isExternalStorageEmulated()); } // /data/data/hdproject.evergrande.com.myapplication/databases/smc.db public static void getDataBasePath(Context context){ Logger.e("info: "+context.getDatabasePath("smc.db").getAbsolutePath()); } // /data/data/hdproject.evergrande.com.myapplication/cache : /storage/emulated/0/Android/data/hdproject.evergrande.com.myapplication/cache public static void getCachePath(Context context){ Logger.e("info: "+context.getCacheDir()+" : "+context.getExternalCacheDir()); } // /data/data/hdproject.evergrande.com.myapplication/files : /storage/emulated/0/Android/obb/hdproject.evergrande.com.myapplication public static void getFilePath(Context context){ Logger.e("info: "+context.getFilesDir().getAbsolutePath()+" : "+context.getObbDir().getAbsolutePath()); }
Environment Context api
最新推荐文章于 2024-04-04 11:37:07 发布