在sqlite中存储blob图像

发布于 2024-12-05 14:02:54 字数 341 浏览 1 评论 0原文

在 sqlite 中存储图像不是正确的方法。我可以存储图像的位置,例如(asset/facea.png)等等...所以当我从 sqlite DB 获取数据时,我得到位置(asset/facea.png)。从这里开始,请指导我在提交链接(asset/facea.png)位置时如何将其转换为图像。我的编辑文本包含类似“hi asset/facea.png”的值,如何在单击提交时将其更改为 hi

我的示例代码: http://pastebin.com/xzPBKK2L

提前致谢。

Storing a image in sqlite is not a proper way to do. Can I store the location of the image eg.(asset/facea.png) and so on... So when I fetch the data from sqlite DB I get the location(asset/facea.png). From here please guide me how to convert the link (asset/facea.png) location to image when I submit it. My edittext contains value like "hi asset/facea.png" how can I change that to hi <image> on click submit.

MY sample code: http://pastebin.com/xzPBKK2L

Thanks in advance.

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

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

发布评论

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

评论(1

浪漫之都 2024-12-12 14:02:54

将图像放在 asset 文件夹中(放入可绘制的文件夹中)是一个坏主意,而且如果将图像放在 apk(资源)中,那么应用程序大小可能会变大(可能以 MB 为单位)。所以我只是建议您将图像放在服务器上,然后从该服务器下载并使用 < 的概念进行查看strong>LAZYLIST(缓存),也可以参考这个

it an bad idea to put image in asset folder (put in drawable), morever if you put image in apk(resource) then there might be chance of application size become large(may be in MBs). so i just advice you to put image on server and just download from that and view with the concept of LAZYLIST(cache) and can refer also this

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