Android系统文件目录路径说明
系统数据存储路径,如下:其中应用程序包名为:com.spt
ContextWrapper类中,包含以下方法:
1. getFilesDir() --> 内部存储
@Override
public File getFilesDir() {
return mBase.getFilesDir();
}
k86m_QC机器上数据存储路径:/data/data/com.spt/files
华为手机上数据存储路径:/data/data/com.spt/files
2. getExternalFilesDir(String type) 参数指定为:Environment.DIRECTORY_PICTURES --> 外部存储
@Override
public File getExternalFilesDir(String type) {
return mBase.getExternalFilesDir(type);
}
k86m_QC机器上数据存储路径:/storage/sdcard0/Android/data/com.spt/files/Pictures
华为手机上数据存储路径:/storage/emulated/0/Android/data/com.spt/files/Pictures
3. getCacheDir() --> 内部存储
@Override
public File getCacheDir() {
return mBase.getCacheDir();
}
k86m_QC机器上数据存储路径:/data/data/com.spt/cache
华为手机上数据存储路径:/data/data/com.spt/cache
4. getExternalCacheDir() --> 外部存储
@Override
public File getExternalCacheDir() {
return mBase.getExternalCacheDir();
}
k86m_QC机器上数据存储路径:/storage/sdcard0/Android/data/com.spt/cache
华为手机上数据存储路径:/storage/emulated/0/Android/data/com.spt/cache
Environment类中,包含以下方法:
1. getDataDirctory()
/**
* Return the user data directory.
*/
public static File getDataDirectory() {
return DATA_DIRECTORY;
}
k86m_QC机器上数据存储路径:/data
华为手机上数据存储路径:/data
2. getDownLoadCacheDirectory()
/**
* Return the download/cache content directory.
*/
public static File getDownloadCacheDirectory() {
return DOWNLOAD_CACHE_DIRECTORY;
}
k86m_QC机器上数据存储路径:/cache
华为手机上数据存储路径:/cache
3. getExternalStorageDirectory()
/**
* Return the primary external storage directory. This directory may not
* currently be accessible if it has been mounted by the user on their
* computer, has been removed from the device, or some other problem has
* happened. You can determine its current state with
* {@link #getExternalStorageState()}.
* <p>
* <em>Note: don't be confused by the word "external" here. This directory
* can better be thought as media/shared storage. It is a filesystem that
* can hold a relatively large amount of data and that is shared across all
* applications (does not enforce permissions). Traditionally this is an SD
* card, but it may also be implemented as built-in storage in a device that
* is distinct from the protected internal storage and can be mounted as a
* filesystem on a computer.</em>
* <p>
* On devices with multiple users (as described by {@link UserManager}),
* each user has their own isolated external storage. Applications only have
* access to the external storage for the user they're running as.
* <p>
* In devices with multiple "external" storage directories, this directory
* represents the "primary" external storage that the user will interact
* with. Access to secondary storage is available through
* <p>
* Applications should not directly use this top-level directory, in order
* to avoid polluting the user's root namespace. Any files that are private
* to the application should be placed in a directory returned by
* {@link android.content.Context#getExternalFilesDir
* Context.getExternalFilesDir}, which the system will take care of deleting
* if the application is uninstalled. Other shared files should be placed in
* one of the directories returned by
* {@link #getExternalStoragePublicDirectory}.
* <p>
* Writing to this path requires the
* {@link android.Manifest.permission#WRITE_EXTERNAL_STORAGE} permission,
* and starting in read access requires the
* {@link android.Manifest.permission#READ_EXTERNAL_STORAGE} permission,
* which is automatically granted if you hold the write permission.
* <p>
* Starting in {@link android.os.Build.VERSION_CODES#KITKAT}, if your
* application only needs to store internal data, consider using
* {@link Context#getExternalFilesDir(String)} or
* {@link Context#getExternalCacheDir()}, which require no permissions to
* read or write.
* <p>
* This path may change between platform versions, so applications should
* only persist relative paths.
* <p>
* Here is an example of typical code to monitor the state of external
* storage:
* <p>
* {@sample
* development/samples/ApiDemos/src/com/example/android/apis/content/ExternalStorage.java
* monitor_storage}
*
* @see #getExternalStorageState()
* @see #isExternalStorageRemovable()
*/
public static File getExternalStorageDirectory() {
throwIfUserRequired();
return sCurrentUser.getExternalDirsForApp()[0];
}
k86m_QC机器上数据存储路径:/storage/sdcard0
华为手机上数据存储路径:/storage/emulated/0
4. getRootDirectory()
/**
* Return root of the "system" partition holding the core Android OS.
* Always present and mounted read-only.
*/
public static File getRootDirectory() {
return DIR_ANDROID_ROOT;
}
k86m_QC机器上数据存储路径:/system
华为手机上数据存储路径:/system
5. getExternalStoragePublicDirectory(String type)
/**
* Get a top-level public external storage directory for placing files of
* a particular type. This is where the user will typically place and
* manage their own files, so you should be careful about what you put here
* to ensure you don't erase their files or get in the way of their own
* organization.
*
* <p>On devices with multiple users (as described by {@link UserManager}),
* each user has their own isolated external storage. Applications only
* have access to the external storage for the user they're running as.</p>
*
* <p>Here is an example of typical code to manipulate a picture on
* the public external storage:</p>
*
* {@sample development/samples/ApiDemos/src/com/example/android/apis/content/ExternalStorage.java
* public_picture}
*
* @param type The type of storage directory to return. Should be one of
* {@link #DIRECTORY_MUSIC}, {@link #DIRECTORY_PODCASTS},
* {@link #DIRECTORY_RINGTONES}, {@link #DIRECTORY_ALARMS},
* {@link #DIRECTORY_NOTIFICATIONS}, {@link #DIRECTORY_PICTURES},
* {@link #DIRECTORY_MOVIES}, {@link #DIRECTORY_DOWNLOADS}, or
* {@link #DIRECTORY_DCIM}. May not be null.
*
* @return Returns the File path for the directory. Note that this
* directory may not yet exist, so you must make sure it exists before
* using it such as with {@link File#mkdirs File.mkdirs()}.
*/
public static File getExternalStoragePublicDirectory(String type) {
throwIfUserRequired();
return sCurrentUser.buildExternalStoragePublicDirs(type)[0];
}
k86m_QC机器上数据存储路径:/storage/sdcard0/Pictures
华为手机上数据存储路径:/storage/emulated/0/Pictures
Internal Storage和External Storage的区别:

getFilesDir() --> 内部存储 /data/data/com.spt/files
getCacheDir() --> 内部存储 /data/data/com.spt/cache
内部存储,对应的是特定的应用程序,如上所述指的是包名为:com.spt应用程序
getExternalFilesDir(String type) --> 外部存储 /storage/sdcard0/Android/data/com.spt/files/Pictures
getExternalCacheDir() --> 外部存储 /storage/sdcard0/Android/data/com.spt/cache
getExternalStoragePublicDirectory(String type) --> 外部存储 /storage/sdcard0/Pictures
getExternalStorageDirectory() --> 外部存储 /storage/sdcard0
1. 外部存储,对应的是/storage/sdcard0/目录;
2. private files:如果需要在卸载应用程序时,删除所有该应用程序的外部存储(同时,该数据是本应用程序私有的),可以使用:getExternalFilesDir(String type)目录,带有应用程序包名;

3. public files可以存放在:getExternalStoragePublicDirectory(String type)
P.S.
对于特定的智能后视镜设备:Flash --> /mnt/sdcard 硬盘大小 外部存储路径:/storage/sdcard1" 外设的存储设备
Android系统文件目录路径说明的更多相关文章
- Android系统文件目录
- Android系统在超级终端下必会的命令大全(adb shell命令大全)
. 显示系统中全部Android平台: android list targets . 显示系统中全部AVD(模拟器): android list avd . 创建AVD(模拟器): android c ...
- Android系统的开机画面显示过程分析
文章转载至CSDN社区罗升阳的安卓之旅,原文地址:http://blog.csdn.net/luoshengyang/article/details/7691321 好几个月都没有更新过博客了,从今天 ...
- 【Android 系统开发】CyanogenMod 13.0 源码下载 编译 ROM 制作 ( 手机平台 : 小米4 | 编译平台 : Ubuntu 14.04 LTS 虚拟机)
分类: Android 系统开发(5) 作者同类文章X 版权声明:本文为博主原创文章 ...
- Android系统级技巧合集
Android系统级技巧合集(随时更新) #转载请注明来源# 1.高通骁龙系列查看CPU体质等级 CPU体质,即为CPU在工作频率下的电压.同一批次的CPU体质各有不同,体质越高,代表该颗CPU可在更 ...
- Android系统编译【转】
本文转载自;http://blog.csdn.net/zirconsdu/article/details/8005415 Android编译系统分析 概要 由于android编译系统的复杂和使用了不熟 ...
- Android系统关机或重启的几种实现方式
前阵子工作上遇到一些关于Android系统关机或重启的系统修改,于是,做了一些尝试,也搜集了一下资料,现在整理一下,做一些总结,方便学习或者日后工作的需要. 默认的SDK并没有提供应用开发者直接的An ...
- Android系统加载Apk文件的时机和流程分析(1)--Android 4.4.4 r1的源码
本文博客地址:https://blog.csdn.net/QQ1084283172/article/details/80982869 Android系统在启动时安装应用程序的过程,这些应用程序安装好之 ...
- Android系统编程入门系列之应用数据文件化保存
应用中关于数据的持久化保存,不管是简单的SharedPreferences还是数据库SQLiteDatabase,本质上都是将数据保存到系统的某种类型的文件中.因此可以直接使用java.io.File ...
随机推荐
- laravel 图片验证码
今天看见一个网站登录页面有个图片验证码,想想自己以前好像真没弄过这个玩意,正好现在有时间,准备用laravel来弄个图片验证码出来,不多BB,直接上代码 1.直接使用别人封装好的,composer下载 ...
- pillow的用法
这是原图 from PIL import Image im=Image.open('C:/Users/history/Desktop/微信图片_20190408110611.jpg') r,g,b=i ...
- Python操作文件-20181121
Python操作文件 Python操作文件和其他语言一样,操作的过程无非是先定位找到文件.打开文件,然后对文件进行操作,操作完成后关闭文件即可. 文件操作方式:对文件进行操作,主要就是读.写的方式,p ...
- 在鼠标右键上加入使用notepad++编辑【转】
我们在安装完notepad++文本编辑器之后,在一个文本文件上右键有时候并没有出现“使用notepad++编辑的选项”,我们可以通过简单地修改注册表文件来增加这样的功能: 1. 首先打开注册表,wi ...
- JN_0001:在微信朋友圈分享时长大于10s的视频
1,先在聊天窗口里发送视频. 2,长按视频点击”收藏“. 3,进入微信收藏管理页面,播放视频. 4,点击右上角三点按钮,选择“转存为笔记”. 5,于是在收藏页面中会生成一个新的收藏笔记链接,打开链接再 ...
- 数据结构Java实现03----栈:顺序栈和链式堆栈
一.堆栈的基本概念: 堆栈(也简称作栈)是一种特殊的线性表,堆栈的数据元素以及数据元素间的逻辑关系和线性表完全相同,其差别是线性表允许在任意位置进行插入和删除操作,而堆栈只允许在固定一端进行插入和删除 ...
- du---查看文件夹大小-并按大小进行排序
使用df 命令查看当前磁盘使用情况: df -lh [root@gaea-dev-xjqxz-3 ~]$ df -lh Filesystem Size Used Avail Use% Mounted ...
- 大数据基础-2-Hadoop-1环境搭建测试
Hadoop环境搭建测试 1 安装软件 1.1 规划目录 /opt [root@host2 ~]# cd /opt [root@host2 opt]# mkdir java [root@host2 o ...
- Selective Search for Object Recognition(理解)
0 - 背景 在目标检测任务中,我们希望输入一副图像,输出目标所在的位置以及目标的类别.最常用的算法是滑动窗口方法,但滑动窗口其实相当于穷举图像中的所有子图像,其效率低且精度也受限.该论文提出一种新的 ...
- Lua“控制”C
[前言] Lua语言本身是一个功能非常有限,而比较单调的语言,而且标准库也非常的平庸,它的NB之处就在于,它能和C.C++等高级语言完美“私通”.我们可以使用C.C++语言去给Lua写一个完美的库,让 ...