【发布时间】:2021-03-04 15:40:04
【问题描述】:
拥有简单的 JSON,for instance:
{
"widget": {
"debug": "on",
"window": {
"title": "Sample Konfabulator Widget",
"name": "main_window",
"width": 500,
"height": 500
},
"image": {
"src": "Images/Sun.png",
"name": "sun1",
"hOffset": 250,
"vOffset": 250,
"alignment": "center"
},
"text": {
"data": "Click Here",
"size": 36,
"style": "bold",
"name": "text1",
"hOffset": 250,
"vOffset": 100,
"alignment": "center",
"onMouseUp": "sun1.opacity = (sun1.opacity / 100) * 90;"
}
}
}
我们可以使用sites 或Android Studio 中的plugins 将其转换为POJO。但是如何转换成RoomEntities呢?
【问题讨论】:
-
@a_local_nobody,是的,但这是手动操作。我想要一个自动将 JSON 转换为实体的工具。
标签: android json entity android-room