如何将json数据存储并提取到Android的房间中

时间:2019-11-24 04:15:14

标签: android sqlite

我想将JSON数据插入到房间库中,并获取与我存储的相同的JSON数据。
我的JSON看起来像

{
    "Category_Name": [
        "Combo and Thali",
        "Festival combo snack and list"
    ],
    "Alldishitems": [
        [
            {
                "DishId": "1",
                "Subcategory": "Combo",
                "DishName": "Rajma Masala Combo",
                "DishPrice": "136",
                "DishNewPrice": "136",
                "Dishdescription": ""
            },
            {
                "DishId": "2",
                "Subcategory": "Combo",
                "DishName": "Lassi with Aloo Paratha",
                "DishPrice": "100",
                "DishNewPrice": "100",
                "Dishdescription": ""
            },
            {
                "DishId": "3",
                "Subcategory": "Thali",
                "DishName": "Chinise thali",
                "DishPrice": "100",
                "DishNewPrice": "100",
                "Dishdescription": ""
            },
            {
                "DishId": "4",
                "Subcategory": "Thali",
                "DishName": "Rajasthani Thali",
                "DishPrice": "100",
                "DishNewPrice": "100",
                "Dishdescription": ""
            }
        ],
        [
            {
                "DishId": "5",
                "Subcategory": "snack",
                "DishName": "rajma rice",
                "DishPrice": "100",
                "DishNewPrice": "100",
                "Dishdescription": ""
            }
        ]

    ]
}

我想像以下那样获取数据

List<String> category
List<List<MenulistMode>> menulistmodel

我该怎么做?请有人帮我

0 个答案:

没有答案