I 'm pretty new to Android. So, I 'm struggling with a HttpPost in android with Json Data.
JSONObject jsonObj = new JSONObject();
JSONObject jsonObjDasUser = new JSONObject();
jsonObj.put("name", "Login");
jsonObj.put("type", "request");
jsonObj.put("UserCredential", jsonObjUserCredential );
jsonObjUserCredential .put("username", id);
jsonObjUserCredential .put("password", password);
// Create the POST object and add the parameters
HttpPost httpPost = new HttpPost(url);
StringEntity entity = new StringEntity(jsonObj.toString(), HTTP.UTF_8);
entity.setContentType("application/json");
httpPost.setEntity(entity);
HttpClient client = new DefaultHttpClient();
How can I include the jsonObjUserCredential as a entity like:::
//StringEntity userCredential = new StringEntity(jsonObjUserCredential .toString(),HTTP.UTF_8);??????
What am doing wrong here?????
Please Help me....