How to parse this Json using Gson and display the Placetype _Name and Place details?
I have this json and need help for parsing and and displaying the Placetype _Name and Place details.
{
"PlacesList": {
"PlaceType": [
{
"-Name": "Airport",
"Places": {
"Place": [
{
"name": "Juhu Aerodrome",
"latitude": "19.09778",
"longitude": "72.83083",
"description": "Juhu Aerodrome is an airport that serves the metropolitan"
},
{
"name": "Chhatrapati Shivaji International Airport",
"latitude": "19.09353",
"longitude": "72.85489",
"description": "Chhatrapati Shivaji International Airport "
}
]
}
},
{
"-Name": "Mall",
"Places": {
"Place": [
{
"name": "Infinity",
"latitude": "19.14030",
"longitude": "72.83180",
"description": "This Mall is one of the best places for all types of brand"
},
{
"name": "Heera Panna",
"latitude": "18.98283",
"longitude": "72.80897",
"description": "The Heera Panna Shopping Center is one of the most popular"
}
]
}
}
]
}
}
An easy solution to handle the JSON element name that starts with “-“, which is a character that cannot be used to start a Java identifier name, is to make use of the
@SerializedNameannotation.Output: