0

{"result":[{"FullName":"Upasiri"}]}

This is what i get when i run my php. I tried doing various things like put this ti a JSONObject and use get methods, but nothing works :/ How can i extract the "Upasiri" from that? Im new to android, so any help is very much appreciated!

2 Answers 2

1

Generate POJO classes with http://www.jsonschema2pojo.org/ (for example), then you can use any JSON serializer to get the Java Objects and get FullName from it. Example how to do it with a GSON you can find here - http://www.javacreed.com/simple-gson-example/

Sign up to request clarification or add additional context in comments.

Comments

0

This is your answer

JSonArray array = object.getJSonArray ("result");

for (int i=0; i<array.lenght(); i++) {
  JSONObject object= array.getJSONObject(i);

// this is your uripase
  String url = object.getString("FullName");

}

1 Comment

i did exactly this, But i still get the output as ["Upasiri"]. :/ And here what exactly did u mean by "response"?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.