如何获取login api的响应以使用内容类型的此json数据使用volley执行登录:application / x-www-form-urlencoded

问题描述 投票:1回答:2
{  
   "status":"success",
   "contents":[  
      {  
         "id":"100",
         "event":"",
         "name":"ww",
         "email":"[email protected]",
         "phone":"",
         "zip_code":"",
         "state":"",
         "password":"@ww",
         "sports_id":"3",
         "sports_name":"BASEBALL",
         "mascoat_name":"ww",
         "logo":"https://www.gstatic.com/webp/gallery/1.jpg",
         "logo1":"https://www.gstatic.com/webp/gallery/1.jpg",
         "file":"http:\/\/something.com\/assets_admin\/uploads\/file\/",
         "status":"1"
      }
   ]
}

对于这个Json Data,我有params,Content-type和URL。如何使用volley为此Json Response执行登录。

android json login android-volley
2个回答
0
投票

我希望这个项目能帮助你链接:https://github.com/probelalkhan/android-login-example-using-volley


0
投票

试试这个...

JSONObject json = new JSONObject(response);

 String status= json.getString("status");
 JSONArray jsonarray = json.getJSONArray("contents");

 JSONObject c = jsonarray.getJSONObject(0);
 String emil= c.getString("email");
 //remaining data you will 
© www.soinside.com 2019 - 2024. All rights reserved.