简体   繁体   English

内容提供商,文件存储在哪里?

[英]Content provider, where are files stored?

The documentation says "However, if you have a large amount of binary data to add, such as a photograph or a complete song, put a content: URI for the data in the table and call ContentResolver.openOutputStream() with the file's URI. (That causes the content provider to store the data in a file and record the file path in a hidden field of the record.) ". 该文档说:“但是,如果要添加大量的二进制数据(例如照片或整首歌曲),请在表中放置内容:数据的URI,并使用文件的URI调用ContentResolver.openOutputStream()(这将导致内容提供者将数据存储在文件中,并将文件路径记录在记录的隐藏字段中。)

Is the file stored on internal or external storage? 文件存储在内部还是外部存储中? Also does the content provider manage the life of the file, ie gets destroyed when the record is deleted? 内容提供商是否还管理文件的生命周期,即在删除记录时将其销毁?

Im pretty sure the file does not get deleted by the content provider, you will need to dispose of it your self. 我非常确定文件不会被内容提供商删除,您需要自行处理。 As far as where it is stored - its within the phones content provider. 至于它的存储位置-它在电话内容提供商中。 You can query it to retrieve your data once its stored. 您可以查询它以在存储数据后检索您的数据。 See this link. 请参阅链接。

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

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