retrofit2 - How to get Response values (Login Responses) from retrofit android -




i beginner of android learner,i used retrofit in project,i responses login request

{"android":{"msg":"user login successfull","data":{"id":"14","name":"meena","url":"","email":"meena04@gmail.com","password":"202cb962ac59075b964b07152d234b70","phone":"","country":"china","photo":"","status":"pending","role":"3","device_id":"","oauth_uid":"","resume":"","oauth_provider":null,"created":"1503316508"}}} 

try can parse json this

try {    jsonobject json = new jsonobject(jsonresponse);   string msg= data.getstring("msg")// msg    jsonobject data = json.getjsonobject("data");// secong json object     string id= data.getstring("id");// id data json object     string name= data.getstring("name");// name data json object     string url= data.getstring("url");// url data json object     string email= data.getstring("email");// email data json object     string password= data.getstring("password");// password data json object     string phone= data.getstring("phone") ; // phone data json object     string country= data.getstring("country");// country data json object     string photo= data.getstring("photo");// photo data json object     string status= data.getstring("status");// status data json object     string role= data.getstring("role");// role data json object     string device_id= data.getstring("device_id");// device_id data json object     string oauth_uid= data.getstring("oauth_uid");// oauth_id data json object     string resume= data.getstring("resume");// resune data json object     string oauth_provider= data.getstring("oauth_provider");// oauth_provider data json object     string created= data.getstring("created");// created data json object      log.e("result :-> ",msg+" "+id+""+name+"  "+url+""+email+""+password+" "+phone+" "+phone     +country+" "+photo+""+status+" "+role+" "+device_id+" "+resume+"  "+oauth_provider+" "+created+ " ");   } catch (jsonexception e) {    e.printstacktrace(); } 




wiki

Comments

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -