httpresponse - How to send parameters with url and get response in android -


i performing login task , getting data php server in json format. in response, getting 'success' tag containing user-id

like {"message":"you have been login","success":"75"}

i value "uid" in same activity , move next page. in next page, want check user profile. that, have pass "uid" 'params' url , value server. don't understand how that.

in next activity page creating asynctask perform action.

protected string doinbackground(string... args) {         // building parameters         list<namevaluepair> params = new arraylist<namevaluepair>();           // getting json string url         jsonobject json = jsonparser.makehttprequest(profile_url, "get",params);          // check log cat json reponse         log.d("profile json: ", json.tostring());          try {             // profile json object             profile = json.getjsonobject(tag_profile);         } catch (jsonexception e) {             e.printstacktrace();         }          return null;     } 

now have set 'uid' in place of params.

use intent, if want keep uid long time , can use sharedprefferences


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -