安卓中查看SD卡剩余空间
来源:互联网 发布:爬虫爬数据库犯法吗 编辑:程序博客网 时间:2024/06/02 13:12
在我们向SD卡中传入视频等较大容量的文件时,先要对SD卡剩余容量进行获取,然后与要传文件大小进行比较。
多的不说,直接看代码:
MainActivity类:
布局文件:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" tools:context=".MainActivity" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="SD卡剩余空间:" /> <TextView android:id="@+id/save_space" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="SD卡总空间:" /> <TextView android:id="@+id/totle_space" android:layout_width="wrap_content" android:layout_height="wrap_content" /></LinearLayout>
效果图:
0 0
- 安卓中查看SD卡剩余空间
- 使用SD卡剩余空间
- android SD卡剩余空间
- 获取SD卡剩余空间
- 获取SD卡的剩余空间
- 判断SD卡剩余空间是否可用
- 让树莓派使用sd卡剩余空间
- 安卓获取sd卡剩余空间
- Android获取SD卡剩余空间
- 查看表空间剩余
- 查看表空间剩余空间
- 如何判断SD卡的剩余空间小于某个值
- android获取SD卡剩余空间及注意事项
- 树莓派B+新手学习笔记---【使用SD卡剩余空间】
- Android 存储:SD卡剩余空间的检测
- 识别剩余sd卡
- 判断SD卡剩余空间大小和总SD卡总容量
- SD卡是否挂载,剩余可用空间,获取SD卡信息
- 数据结构-哈夫曼树
- android 编译生成的out目录结构剖析
- Android去掉Activity的头部标题栏
- 实验十一:帧中继
- 关于IO函数
- 安卓中查看SD卡剩余空间
- A -- Alarm
- js中的数组
- c++设计模式代理模式
- HDOJ 1285 确定比赛名次
- deque和map的使用(poj3074)
- mysql-python安装时EnvironmentError: mysql_config not found
- 实现两个select之间的两极联动
- 【幻化万千戏红尘】qianfengDay19-java基础学习:转换流、对象流、打印流、三大标准(重定向)