Android 使用JSON解析检测天气
如何从下面解析代码、消息、计算时间、城市、id、国家、名称 使用此URL:Android 使用JSON解析检测天气,android,json,api,Android,Json,Api,如何从下面解析代码、消息、计算时间、城市、id、国家、名称 使用此URL: 请遵循以下代码: JSONObject jObj=new JSONObject(jsonResponse); String msg=jObj.getString("message"); String calctime=jObj.getString("calctime"); 请遵循以下代码: JSONObject jObj=new JSONObject(jsonResponse); String msg=jObj.get
请遵循以下代码:
JSONObject jObj=new JSONObject(jsonResponse);
String msg=jObj.getString("message");
String calctime=jObj.getString("calctime");
请遵循以下代码:
JSONObject jObj=new JSONObject(jsonResponse);
String msg=jObj.getString("message");
String calctime=jObj.getString("calctime");
使用下面的代码解析代码,消息,计算时间,城市,id,国家,从上面的url名称,它将解决您的问题
JSONObject mJsonObj = new JSONObject(mJsonResponse);
String mCode = mJsonObj.getString("cod");
String mMessage = mJsonObj.getString("message");
String mCalcTime = mJsonObj.getString("calctime");
JSONObject mJsonCityObj = mJsonObj.getJSONObject("city");
String mId = mJsonCityObj.getString("id");
String mConuntry = mJsonCityObj.getString("country");
String mName = mJsonCityObj.getString("name");
使用下面的代码解析代码,消息,计算时间,城市,id,国家,从上面的url名称,它将解决您的问题
JSONObject mJsonObj = new JSONObject(mJsonResponse);
String mCode = mJsonObj.getString("cod");
String mMessage = mJsonObj.getString("message");
String mCalcTime = mJsonObj.getString("calctime");
JSONObject mJsonCityObj = mJsonObj.getJSONObject("city");
String mId = mJsonCityObj.getString("id");
String mConuntry = mJsonCityObj.getString("country");
String mName = mJsonCityObj.getString("name");
请看我的答案,它会解决你的问题。请看我的答案,它会解决你的问题。