在 Android 中将图像存储在 SD 卡或 SQL lite DB 中的最佳实践是什么?
我想存储示例图像。将天气存储在 SD 卡或数据库中的最有效方式是什么?
I want to store sample images. what is the best efficient way weather to store on SD card or in DB?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果图像不大(2-3 KB)并且它们的集合不应该扩展,那么您可以将它们保存到数据库。但写它们、读它们会更困难。另一方面,用户将无法对它们执行任何操作。
否则,如果您想让用户扩展图像集合或图像相当大,您应该将它们存储到 SD 卡。
无论如何,您应该意识到空间不足并适当对待这些情况。
if the images are not big(2-3 KB) and the collection of them is not supposed to be expanded then you can save them to db. But it would be harder to write them, read them. On the other hand the user won't be able to do anything with them.
Otherwise, if you want to let user to expand the image collection or the images are rather big you should store them to sd card.
Anyway, you should be aware of space lackness and treat those cases appropriately.