简体   繁体   English

Android内部和外部存储

[英]Android Internal and External Storage

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? 我的问题是我现在必须为每首歌做2次通话,还是可以进行一次查询,同时查看内部​​和外部存储器?

look at my answer in this post: https://stackoverflow.com/a/13935210/1716620 看看我在这篇文章中的答案: https : //stackoverflow.com/a/13935210/1716620

ContentProvider is the key ContentProvider是关键

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 我有一个使用外部和内部存储器保存图片的应用程序,我需要使用图库在某些情况下查看它们,如果我尝试传递指向内部存储器的uri,则会出错

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

that way i solved my problem... and your :) 这样我就解决了我的问题...和你的:)

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. 另一个选择是查看媒体文件所在的启动,并将此数据记录在SharedPreferences以备后用。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM