在 Android 中将图像存储在 SD 卡或 SQL lite DB 中的最佳实践是什么?

发布于 2024-10-09 03:49:41 字数 42 浏览 0 评论 0原文

我想存储示例图像。将天气存储在 SD 卡或数据库中的最有效方式是什么?

I want to store sample images. what is the best efficient way weather to store on SD card or in DB?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

指尖凝香 2024-10-16 03:49:41

如果图像不大(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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文