android开发数据储存的路径示例

为了弄清楚getFilesDir,getExternalFilesDir,getExternalStorageDirectory,getExternalStoragePublicDirectory等android文件操作方法的路径,在activity中执行以下代码:

        Log.i("qqq", "getFilesDir = " + getFilesDir());
        Log.i("qqq", "getExternalFilesDir = " + getExternalFilesDir("exter_test").getAbsolutePath());
        Log.i("qqq", "getDownloadCacheDirectory = " + Environment.getDownloadCacheDirectory().getAbsolutePath());
        Log.i("qqq", "getDataDirectory = " + Environment.getDataDirectory().getAbsolutePath());
        Log.i("qqq", "getExternalStorageDirectory = " + Environment.getExternalStorageDirectory().getAbsolutePath());
        Log.i("qqq", "getExternalStoragePublicDirectory = " + Environment.getExternalStoragePublicDirectory("pub_test"));
打印结果如下图:
android开发数据储存的路径示例_第1张图片

你可能感兴趣的:(android存储路径)