【发布时间】:2020-04-16 16:29:35
【问题描述】:
我正在对 Room 数据库进行整个 API 响应以进行离线访问。 我已设法存储所有字符串值,但我也想将图像(获取图像 url 作为响应)存储到数据库中。 由于我没有使用 Room 数据库的经验,我对如何存储图像 int Room db 列感到困惑 以下是 API 响应
{
"beast": [{
"id": "1",
"name": "The Griffin of Edward III",
"description": "The English Beast has always been a lion",
"image": "www.google.com/uploads/beast-images/2.png"
},
{
"id": "2",
"name": "The Lion of England",
"description": "The English Beast has always been a lion",
"image": "www.google.com/uploads/beast-images/2.png"
}]
}
【问题讨论】:
-
@ManthanTilva 我正在获取图像 url 作为响应,我想将其作为图像存储在房间数据库中
-
将图像保存为blob/字节数组或房间数据库中的base64字符串
标签: android android-room