Just an update for anyone who might be looking at this thread in an
archive... it literally only takes 3-4 lines of code if you use Gson
http://code.google.com/p/google-gson/ and Gson is so awesome that it
will automatically push your json objects or arrays directly into a
POJO. http://benjii.me/2010/04/deserializing-json-in-android-using-gson/

Shawn

On Jan 22, 8:44 am, DanH <[email protected]> wrote:
> A JSON parser is about 500 lines of code -- a few hours work.  (The
> encoder is another 250 or so.)  The hard part is parsing numbers per
> the JSON spec.
>
> Or you can probably find about 50 Java implementations on the net.
>
> On Jan 22, 2:45 am, Faheem Khatri <[email protected]> wrote:
>
> > I want to create parser for the given JSON below, Anyone help me out
> > for this.
> > { "0" : { "Distance" : "7.7364796125473",
> >       "LBS_CategoryMaster_ID" : "6",
> >       "LBS_POI_Description" : "",
> >       "LBS_POI_Latitude" : "24.85251",
> >       "LBS_POI_Longitude" : "67.03203",
> >       "LBS_POI_Name" : "POI1"
> >     },
> >   "1" : { "Distance" : "7.68653354773716",
> >       "LBS_CategoryMaster_ID" : "6",
> >       "LBS_POI_Description" : "",
> >       "LBS_POI_Latitude" : "24.85247",
> >       "LBS_POI_Longitude" : "67.03211",
> >       "LBS_POI_Name" : "POI1"
> >     },
> >   "2" : { "Distance" : "2.44026574305725",
> >       "LBS_CategoryMaster_ID" : "6",
> >       "LBS_POI_Description" : "",
> >       "LBS_POI_Latitude" : "24.85118",
> >       "LBS_POI_Longitude" : "67.03118",
> >       "LBS_POI_Name" : "POI2"
> >     },
> >   "3" : { "Distance" : "8.0421178896909",
> >       "LBS_CategoryMaster_ID" : "6",
> >       "LBS_POI_Description" : "",
> >       "LBS_POI_Latitude" : "24.85251",
> >       "LBS_POI_Longitude" : "67.03216",
> >       "LBS_POI_Name" : "POI3"
> >     },
> >   "4" : { "Distance" : "4.6843846750868",
> >       "LBS_CategoryMaster_ID" : "6",
> >       "LBS_POI_Description" : "",
> >       "LBS_POI_Latitude" : "24.8514",
> >       "LBS_POI_Longitude" : "67.03073",
> >       "LBS_POI_Name" : "POI4"
> >     }
>
> > }
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to