Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android

Trying to do Gson...

I started studying the Gson library, I try to do a lot of things about parsing. this is my code and I very appreciate it if someone tell me what I need to do to parsing Gson, this is my code:

package com.trip.android.trip.model; import java.util.List;

public class TripPlaceDetails {

private Geometry geometry; private String icon; private String id; private String name; private OpeningHours openingHours; private List<Photo> photos = null; private String placeId; private String reference; private String scope; private List<String> types = null; private String vicinity;

public Geometry getGeometry() { return geometry; }

public void setGeometry(Geometry geometry) { this.geometry = geometry; }

public String getIcon() { return icon; }

public void setIcon(String icon) { this.icon = icon; }

public String getId() { return id; }

public void setId(String id) { this.id = id; }

public String getName() { return name; }

public void setName(String name) { this.name = name; }

public OpeningHours getOpeningHours() { return openingHours; }

public void setOpeningHours(OpeningHours openingHours) { this.openingHours = openingHours; }

public List<Photo> getPhotos() { return photos; }

public void setPhotos(List<Photo> photos) { this.photos = photos; }

public String getPlaceId() { return placeId; }

public void setPlaceId(String placeId) { this.placeId = placeId; }

public String getReference() { return reference; }

public void setReference(String reference) { this.reference = reference; }

public String getScope() { return scope; }

public void setScope(String scope) { this.scope = scope; }

public List<String> getTypes() { return types; }

public void setTypes(List<String> types) { this.types = types; }

public String getVicinity() { return vicinity; }

public void setVicinity(String vicinity) { this.vicinity = vicinity; } }

This is my code gson from json:

public TripPlaceDetails getTripPlaceDetails(String jsonString) {

Gson gson = new Gson();
TripPlaceDetails tripPlaceDetails = gson.fromJson(arr.get(i), TripPlaceDetails.class);

so now, what I should do after this code? I don't know what to do?

Thank for Help :)