0

Possible Duplicate:
JSON Parsing in Android

https://api.zomato.com/v1/restaurant.json/315?apikey=4f4b91f51207b8175170604f4b91f512 this is my

web service we want to parsing so that we can print id and name

i have try so much but not able to do parse and retrieve data i m new in android. plz send me

code how i will parse i m able to read This Web service but data is not coming formatted so not

able to Parsing.

Community
  • 1
  • 1
  • You should done R&D before posting here: [**Android JSON Parsing**](http://stackoverflow.com/search?q=Android+JSON+Parsing) – Paresh Mayani Apr 02 '12 at 12:11
  • This is the best tutuorial with a sample code for the json parsing. http://www.androidhive.info/2012/01/android-json-parsing-tutorial/ – wolverine Apr 02 '12 at 12:13
  • Follow the tutorial - [http://www.vogella.de/articles/AndroidJSON/article.html](http://www.vogella.de/articles/AndroidJSON/article.html) This tutorial explain both how to retrive data and parse data. – Shaiful Apr 02 '12 at 12:09

2 Answers2

1

You can learn from these links. Very simple example shown in these links.

http://www.technotalkative.com/android-json-parsing/

http://www.androidcompetencycenter.com/2009/10/json-parsing-in-android/

Hope this will help you.

Thanks...

Never Quit
  • 2,074
  • 1
  • 21
  • 43
0

It's pretty simple. You have a JSONString there. You need to do this.

  1. First make an JSONObject like this.

    JSONObject json = new JSONOBject("String you want"); // I mean the string you get from server
    
  2. Then give the key's you want to get.

    json.get("id");
    

and so on

For more see here

Sergey Glotov
  • 19,939
  • 11
  • 82
  • 96
ngesh
  • 13,241
  • 4
  • 43
  • 59