# FileScanner [ ![Download](https://api.bintray.com/packages/haydar-android/maven/FileScanner/images/download.svg) ](https://bintray.com/haydar-android/maven/FileScanner/_latestVersion) <a href='https://bintray.com/haydar-android/maven/FileScanner?source=watch' alt='Get automatic notifications about new "FileScanner" versions'><img src='https://www.bintray.com/docs/images/bintray_badge_color.png'></a>
## Android SD卡扫描某类文件(.mp3、.mp4...)
### 使用方法
``` gradlew
compile 'io.haydar.filescanner:filescannercore:1.1'
```
### 描述
FileScanner是一个扫描Android /storage/emulated/0/目录中指定格式的文件。扫描结果会保存在FileScanner数据库中。
### 注意
``` xml
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
```
必须得申请权限
### API
``` java
FileScanner.getInstance(Context).clear();
```
清除数据库信息
``` java
FileScanner.getInstance(this).setType(String).start(FileScanner.ScannerListener())
```
setType设置要查找文件的格式(.mp3)
start开始扫描,会自动根据数据库是否为空来进行全盘扫描还是增量扫描
```java
ArrayList<FileInfo> fileInfoArrayList= FileScanner.getInstance(MainActivity.this).getAllFiles();
```
获得扫描的文件
### 使用方法
``` java
private void fileScanner() {
FileScanner.getInstance(this).clear();
FileScanner.getInstance(this).setType(".png").start(new FileScanner.ScannerListener() {
/**
* 扫描开始
*/
@Override
public void onScanBegin() {
Log.d(TAG, "onScanBegin: ");
}
/**
* 扫描结束
*/
@Override
public void onScanEnd() {
Log.d(TAG, "onScanEnd: ");
ArrayList<FileInfo> fileInfoArrayList= FileScanner.getInstance(MainActivity.this).getAllFiles();
for (FileInfo fileInfo : fileInfoArrayList) {
Log.d(TAG, "fileScanner: "+fileInfo.getFilePath());
}
}
/**
* 扫描进行中
* @param paramString 文件夹地址
* @param progress 扫描进度
*/
@Override
public void onScanning(String paramString, int progress) {
Log.d(TAG, "onScanning: " + progress);
}
/**
* 扫描进行中,文件的更新
* @param info
* @param type SCANNER_TYPE_ADD:添加;SCANNER_TYPE_DEL:删除
*/
@Override
public void onScanningFiles(FileInfo info, int type) {
Log.d(TAG, "onScanningFiles: info=" + info.toString());
}
});
}
```
没有合适的资源?快使用搜索试试~ 我知道了~
Android-Android扫描SD卡指定类型文件
共389个文件
txt:57个
cmake:56个
xml:46个
需积分: 35 3 下载量 78 浏览量
2019-08-13
07:09:08
上传
评论
收藏 1.13MB ZIP 举报
温馨提示
Android SD卡扫描某类文件(.mp3、.mp4...)
资源推荐
资源详情
资源评论
收起资源包目录
Android-Android扫描SD卡指定类型文件 (389个子文件)
gradlew.bat 2KB
CMakeDetermineCompilerABI_CXX.bin 41KB
CMakeDetermineCompilerABI_CXX.bin 41KB
CMakeDetermineCompilerABI_C.bin 41KB
CMakeDetermineCompilerABI_C.bin 41KB
feature_tests.bin 41KB
feature_tests.bin 41KB
CMakeDetermineCompilerABI_CXX.bin 39KB
CMakeDetermineCompilerABI_CXX.bin 39KB
CMakeDetermineCompilerABI_C.bin 39KB
CMakeDetermineCompilerABI_C.bin 39KB
feature_tests.bin 39KB
feature_tests.bin 39KB
feature_tests.bin 16KB
feature_tests.bin 15KB
feature_tests.bin 14KB
feature_tests.bin 14KB
feature_tests.bin 13KB
feature_tests.bin 13KB
CMakeDetermineCompilerABI_CXX.bin 12KB
CMakeDetermineCompilerABI_CXX.bin 12KB
CMakeDetermineCompilerABI_C.bin 12KB
CMakeDetermineCompilerABI_C.bin 12KB
CMakeDetermineCompilerABI_CXX.bin 10KB
CMakeDetermineCompilerABI_CXX.bin 10KB
CMakeDetermineCompilerABI_C.bin 10KB
CMakeDetermineCompilerABI_C.bin 10KB
CMakeDetermineCompilerABI_CXX.bin 9KB
CMakeDetermineCompilerABI_CXX.bin 9KB
CMakeDetermineCompilerABI_C.bin 9KB
CMakeDetermineCompilerABI_C.bin 9KB
feature_tests.bin 9KB
feature_tests.bin 9KB
CMakeDetermineCompilerABI_CXX.bin 9KB
CMakeDetermineCompilerABI_CXX.bin 9KB
CMakeDetermineCompilerABI_C.bin 9KB
CMakeDetermineCompilerABI_C.bin 9KB
CMakeDetermineCompilerABI_CXX.bin 8KB
CMakeDetermineCompilerABI_CXX.bin 8KB
CMakeDetermineCompilerABI_C.bin 8KB
CMakeDetermineCompilerABI_C.bin 8KB
feature_tests.bin 8KB
feature_tests.bin 8KB
feature_tests.c 728B
feature_tests.c 728B
feature_tests.c 728B
feature_tests.c 728B
feature_tests.c 728B
feature_tests.c 728B
feature_tests.c 728B
feature_tests.c 728B
feature_tests.c 728B
feature_tests.c 728B
feature_tests.c 728B
feature_tests.c 728B
feature_tests.c 728B
feature_tests.c 728B
cmake.check_cache 85B
cmake.check_cache 85B
cmake.check_cache 85B
cmake.check_cache 85B
cmake.check_cache 85B
cmake.check_cache 85B
cmake.check_cache 85B
cmake.check_cache 85B
cmake.check_cache 85B
cmake.check_cache 85B
cmake.check_cache 85B
cmake.check_cache 85B
cmake.check_cache 85B
cmake.check_cache 85B
CMakeCXXCompiler.cmake 6KB
CMakeCXXCompiler.cmake 6KB
CMakeCXXCompiler.cmake 5KB
CMakeCXXCompiler.cmake 5KB
CMakeCXXCompiler.cmake 5KB
CMakeCXXCompiler.cmake 5KB
CMakeCXXCompiler.cmake 5KB
CMakeCXXCompiler.cmake 5KB
CMakeCXXCompiler.cmake 5KB
CMakeCXXCompiler.cmake 5KB
CMakeCXXCompiler.cmake 5KB
CMakeCXXCompiler.cmake 5KB
CMakeCXXCompiler.cmake 5KB
CMakeCXXCompiler.cmake 5KB
CMakeCCompiler.cmake 3KB
CMakeCCompiler.cmake 3KB
CMakeCCompiler.cmake 3KB
CMakeCCompiler.cmake 3KB
CMakeCCompiler.cmake 3KB
CMakeCCompiler.cmake 3KB
CMakeCCompiler.cmake 3KB
CMakeCCompiler.cmake 3KB
CMakeCCompiler.cmake 3KB
CMakeCCompiler.cmake 3KB
CMakeCCompiler.cmake 3KB
CMakeCCompiler.cmake 3KB
CMakeCCompiler.cmake 3KB
CMakeCCompiler.cmake 3KB
cmake_install.cmake 1KB
共 389 条
- 1
- 2
- 3
- 4
资源评论
weixin_39840914
- 粉丝: 435
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 猫咪和汤58.apk
- 浏览器.apk
- 基于matlab实现是一个matlab中的power system 中搭建的一个模型
- 基于JSP毕业设计-教学管理系统(源代码+论文).zip
- 基于JSP毕业设计-家政管理系统-毕业设计.zip
- 基于Python实现淘宝商品评论采集(含逆向)源代码
- 基于matlab实现多目标进化算法NSGAⅡ&Matlab讲解.rar
- 基于matlab实现多车辆车辆路径问题,用遗传算法编程,保证可用.rar
- 基于matlab实现多层极限学习机实现手写体识别,准确率超过99%.rar
- 基于matlab实现电力系统最优潮流程序,可以应用于电力市场下的最优潮流计算 适合电力系统专业的同仁使用.rar
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功