获取android的各种路径
来源:互联网 发布:郭美美事件 知乎 编辑:程序博客网 时间:2024/05/22 14:23
有时候我们需要访问android的很多路径,下面我们就来总结一下android的一些目录的获取方式:
// 获取当前程序路径 getApplicationContext().getFilesDir().getAbsolutePath();// 获取该程序的安装包路径 String path=getApplicationContext().getPackageResourcePath();// 获取程序默认数据库路径 getApplicationContext().getDatabasePath("s").getAbsolutePath();
<span style="color: rgb(51, 51, 51); font-family: Helvetica, Tahoma, Arial, sans-serif; font-size: 14px; line-height: 24px; background-color: rgb(245, 245, 245); "> //获取"/sdcard/" sdcard的文件夹目录 </span>
<span style="background-color: rgb(245, 245, 245); "><span style="white-space: pre; "></span>Environment.getExternalStorageDirectory()</span>
<span style="background-color: rgb(245, 245, 245); "><span style="color: rgb(51, 51, 51); font-family: Helvetica, Tahoma, Arial, sans-serif; font-size: 14px; line-height: 24px; background-color: rgb(245, 245, 245); "><span style="white-space:pre"></span>//使用SDCard目录前,需要判断是否有sdcard:Environment.getExternalStorageState() ,<span style="color: rgb(51, 51, 51); font-family: Helvetica, Tahoma, Arial, sans-serif; font-size: 14px; line-height: 24px; background-color: rgb(245, 245, 245); ">操作此目录时需要在主配置文件中注册操作权限。</span></span></span>
0 0
- 获取android的各种路径
- Android Environment 获取各种路径的方法
- android获取各种系统路径的方法
- android各种图片获取路径的方式
- Android 获取各种路径的方法:
- android获取各种系统路径的方法
- android获取各种系统路径的方法
- android 获取各种路径大全
- android的Environment类,获取各种目录路径
- Android 获取本地存储路径的各种方法详解
- JSP各种路径的获取
- jsp的各种路径获取
- Android上的各种路径
- java的各种路径的获取
- eclipse路径获取的各种方式
- web项目中各种路径的获取
- web项目中各种路径的获取
- Java中获取路径的各种方法
- Android小知识——TextView的高的自适应
- coco2d-x2.2.4 时间倒记时显示
- Codeforces Round #FF (Div. 2) C. DZY Loves Sequences
- key 串口
- Hadoop-2.4.1学习之以伪分布模式部署Hadoop
- 获取android的各种路径
- VC和Linux C下可用的控制台进度代码
- jQuery中attr()和prop()的区别,修改checked属性
- android ics SystemUI详解
- 玩App怎么赚钱(二)
- Android使用Ant批量打包
- 将条形码插入到word文档中
- DedeCms系统的路径说明及获取内容页的绝对地址
- Oracle db_file_mulitblock_read_count参数