我处于必须读取 json 数据并将其插入 Sqlite 表的情况。但是这种格式的json数据:
{
"result": "success",
"data": {
"userId": "873",
"volume": "0.5",
"schoolId": "0",
"schoolName": "",
"preferredLanguageId": "1",
"fname": "robin",
"lname": "singh",
"email": "rob@live.com",
"password": "password1111",
"isParent": "0",
"countryId": "254",
"stateId": "143",
"state": "",
"city": "san diego",
"coins": "0",
"zip": "",
"players": []
}
}
JSONObject json = new JSONObject(jsonString);
String uname=json.getString("fname");
但我无法获得字符串 uname 中的名字。