使用 android MediaScannerConnection.scanFile 扫描网络存储上的文件
在 Android SDK 中,“MediaScannerConnection”类中的“scanFile”功能允许在 MediaStore 中添加文件,然后使用漂亮的 Android 应用程序来显示和播放多媒体文件。
“ScanFile”方法需要一个“path”参数(要扫描的文件的路径)。
有没有办法为 ftp 服务器上的文件构建内容提供程序并使用“scanFile”方法将它们添加到媒体存储中?
这些文件在网络存储单元上的“路径”是什么?
In Android SDK the fonction "scanFile" from "MediaScannerConnection" class allows to add files in the MediaStore, and then to use nice android apps to display and play multimedia files.
The "ScanFile" method need a "path" parameter (the path to the file to be scanned).
Is there a way to build a content provider for files on a ftp server and use the "scanFile" method to add them to the media store ?
What would be the "path" for these files on a network storage unit ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以看到 MediaScanner.java 和 MediaScannerConnection.java 文件。目前它选择像 /mnt/sdcard 这样的安装路径,然后调用 scanFile 函数。另外,在 init.rc 中,您提到了安装点。也许,它可能会给你一些这个方向的指标。
维布杰尔
You could see MediaScanner.java and MediaScannerConnection.java files. Currently it picks the mount path like /mnt/sdcard and then scanFile function is called on that. Also, in init.rc, you mention about the mount points. Probably, it may give you some indicators in that direction.
Vibgyor