使用 android MediaScannerConnection.scanFile 扫描网络存储上的文件

发布于 2025-01-04 22:29:03 字数 253 浏览 2 评论 0原文

在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

早乙女 2025-01-11 22:29:03

您可以看到 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文