internal vs external uri on fetching data from mediastore

感情迁移 提交于 2019-12-12 12:07:18

问题


Hopefully someone can clarify this to me...I am working on a simple video player app that plays video clip stored on phone.

All examples I've seen fetch video using MediaStore.Video.Media.EXTERNAL_CONTENT_URI content Uri, something like that

cursor = resolver.query(MediaStore.Video.Media.EXTERNAL_CONTENT_URI, cols, whereClause, null, sortOrder);

But won't it limit the list to only files stored on SD card?

Newer android phones has significant amount of internal memory - for example, Samsung Galaxy S typically comes with 16Gb on internal memory and 2Gb sd card.

Should I scan mediastore twice with external content uri and internal one?

Again I saw like 10 examples for audio and video players and all of them use external only.

Even checked source code for the stock music player and it also pulls only from external card.


回答1:


ran some tests and it seems the answer it depends. On android emulator and HTC mytouch it fetches only items on external SD card, while on Samsung Galaxy S it actually pulls from internal storage too.

This is the part I really hate about android - why such simple things are so different




回答2:


Can you just use

MediaStore.Video.Media.INTERNAL_CONTENT_URI



来源:https://stackoverflow.com/questions/4843764/internal-vs-external-uri-on-fetching-data-from-mediastore

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!