MediaStore的Andr​​oid [英] MediaStore Android

查看:168
本文介绍了MediaStore的Andr​​oid的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚开始学习的内容提供商和MediaStore,但有一件事,我无法弄清楚和MediaStore的文件是真穷。据我所知,Android的使用数据库来保存有关媒体文件的信息,速度和功耗的原因,我看到它的领域,但我看不出数据库条目和和文件之间的映射而成。例如音频媒体有专辑,艺术家等,但我找不到像路径什么的现场,他们也没有提供一个架构或东西帮助我理解所有这些元素之间的关系。

I've just started learning about content providers and MediaStore, but there is one thing that I can't figure it out and the documentation on MediaStore is really poor. I understand that android uses a database to keep information about media files, for speed and power consumption reasons, and I saw it's fields, but I don't see how the mapping between database entries and and files is made. For example audio media has album, artists etc., but I couldn't find a field like path or something, also they don't provide a schema or something to help me understand the relations between all these elements.

推荐答案

MediaStore.MediaColumns.DATA 列是你在找什么。这列的文件路径存储在其中的特定文件。

The MediaStore.MediaColumns.DATA column is what you're looking for. That column has the file path to the particular file stored in it.

这篇关于MediaStore的Andr​​oid的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆