{"vsUserName":"d475","vsPassword":"8080","vsIPAddress":"192.168.1.1"}
This is the key value pairs that I have to parse in Android and used to login and password. I am new in android so no knowledge of parsing in android.
{"vsUserName":"d475","vsPassword":"8080","vsIPAddress":"192.168.1.1"}
This is the key value pairs that I have to parse in Android and used to login and password. I am new in android so no knowledge of parsing in android.
If you would like to parse JSON into model, then you can use google gson library its easy to use.
{"vsUserName":"d475","vsPassword":"8080","vsIPAddress":"192.168.1.1"}
Other approach is to parse json manually as:
Get the json object first
JSONObject jObject = new JSONObject(result);
then get key-value pairs
String aJsonString = jObject.getString("STRINGNAME");
and so on...
For further assistance you can visit this link
you should take a look at this - http://www.javatpoint.com/android-json-parsing-tutorial
your json like - {"vsUserName":"d475","vsPassword":"8080","vsIPAddress":"192.168.1.1"}
with help of - http://hayageek.com/android-http-post-get/
try this may be this could be helpful.. i'm not tested it -- pls let me know if problem persist - The steps to do it below -
Follow the steps to send HTTP POST requests. 1. Create an object of HttpClient
Create an object of HttpPost
Add POST parameters with url
Finally making an HTTP POST request
Boolean bIsSuccess = false; // Write according to your logic this is demo.
public void parseResponse(JSONObject response) {
try {
JSONObject jObject = new JSONObject(String.valueOf(response));
bIsSuccess = jObject.getBoolean("success");
} catch (JSONException e) {
e.printStackTrace();
Toast.makeText(Class.this, "" + e.toString(), Toast.LENGTH_LONG).show(); // Test
}
}