读取SD卡中所有MP3文件
2013-11-04 21:49
204 查看
想做一个音乐播放器,首先当然要有播放列表啊,通过查资料,暂时先做了个获取SD卡里所有MP3文件名称的小Demo,效果图如下:
sd_list.xml
3.最后注意添上权限
PS:修改下后缀文件名,也可用于查找其他类型文件 。
源代码下载
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal" > <TextView android:id="@+id/tv_file" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="2" android:text="音乐文件:" /> <TextView android:id="@+id/tc_fileName" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" /> </LinearLayout>
sd_list.xml
3.最后注意添上权限
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
PS:修改下后缀文件名,也可用于查找其他类型文件 。
源代码下载
相关文章推荐
- Android读取SD卡中的媒体文件(MP3)
- 读取SD卡文件夹下的MP3文件和播放MP3文件
- 读取某一目录下(包括子目录)所有mp3、wma、m4a格式文件,制作成m3u列表(Java, Windows)
- Android 扫描SD卡内所有MP3(音频)文件
- android 读取SD卡中MP3文件的信息
- Android从SD卡中读取所有的文件
- Android 读取SD卡指定后缀的所有文件
- Android 读取SD卡指定后缀的所有文件
- 读取某个文件夹下的所有文件
- android 中读取asset目录中文件并写入SD卡以及从SD卡中读取的简介
- ASP读取WMA,MP3文件信息类
- VBA 读取一个Excel文件中的所有worksheet第一行到另一个Excel文件中
- [安卓源代码]简单实现SD卡上遍历所有文件夹寻找指定格式文件
- 存储和读取一个MP3文件于MySQL中
- Java实现读取文件夹下(包括子目录)所有文件的文件名
- 可视化webpart基础开发——TreeView控件读取文档库中的所有文件夹和文件(递归方法读取)
- Python读取一个目录下所有目录和文件的方法
- 读取Android sd卡的文件
- 读取一个文件夹或子文件夹内的所有文件范例
- [置顶] 纯js读取excel文件内容,支持所有刘浏览器