Android 内部和外部存储

发布于 2024-09-08 14:54:23 字数 113 浏览 4 评论 0原文

我有一个可以访问音乐的应用程序,至少有一个用户抱怨他的一些歌曲位于内部存储中,这导致了强制关闭。

我的问题是,我现在是否必须为每首歌曲执行 2 次调用,或者我可以进行查询来查看内部和外部存储器吗?

I have an app that accesses music and I had at least one user complain that some of his songs are on internal storage and that causes a force close.

My question is do I have to do 2 calls for each song now or can I make a query that will look at both the internal and external memory?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(3

半暖夏伤 2024-09-15 14:54:23

多媒体不是我的强项,但我认为媒体扫描仪会保留内容索引。另一种选择是查看启动时媒体文件所在的位置,并将这些数据记录在 SharedPreferences 中以供以后使用。

Multimedia is not my strong suit, but I would think the media scanner would keep an index of what is where. Another option would be to look at startup where the media files are located and record this data in SharedPreferences for later use.

随遇而安 2024-09-15 14:54:23

看看我在这篇文章中的回答:
https://stackoverflow.com/a/13935210/1716620

关键

ContentProvider 是我有一个使用外部和内部的应用程序的 内存来保存图片,我需要使用图库在某些情况下查看它们,如果我尝试传递指向内部内存的 uri

https://stackoverflow.com/a/13935210/1716620

这样我解决了我的问题......还有你的:)

look at my answer in this post:
https://stackoverflow.com/a/13935210/1716620

ContentProvider is the key

i have an application that use external and internal memory to save pictures and i needed to use gallery to view them in some rircumstance and it gave error if i tried to pass an uri that pointed to an internal memory

https://stackoverflow.com/a/13935210/1716620

that way i solved my problem... and your :)

∝单色的世界 2024-09-15 14:54:23

这取决于制造商如何实施其 MediaProvider/Scanner 等,因为没有针对多个闪存 (SD) 设备的标准。

It depends on how the manufacturer implemented their MediaProvider/Scanner etc. as there is no standard for more than one flash(SD) device.

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