-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#21 : Parsing JSON data using GSON #23
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 0 additions & 22 deletions
22
app/src/main/java/com/pulkit4tech/privy/data/MarkerData.java
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
30 changes: 30 additions & 0 deletions
30
app/src/main/java/com/pulkit4tech/privy/data/json/Location.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.pulkit4tech.privy.data.json; | ||
|
||
public class Location { | ||
private double lat; | ||
private double lng; | ||
|
||
public double getLat() { | ||
return lat; | ||
} | ||
|
||
public void setLat(double lat) { | ||
this.lat = lat; | ||
} | ||
|
||
public double getLng() { | ||
return lng; | ||
} | ||
|
||
public void setLng(double lng) { | ||
this.lng = lng; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "Location{" + | ||
"lat=" + lat + | ||
", lng=" + lng + | ||
'}'; | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
app/src/main/java/com/pulkit4tech/privy/data/json/LocationData.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.pulkit4tech.privy.data.json; | ||
|
||
public class LocationData { | ||
private Location location; | ||
|
||
public void setLocation(Location location) { | ||
this.location = location; | ||
} | ||
|
||
public Location getLocation() { | ||
return location; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "LocationData{" + | ||
"location=" + location + | ||
'}'; | ||
} | ||
} |
96 changes: 96 additions & 0 deletions
96
app/src/main/java/com/pulkit4tech/privy/data/json/MarkerData.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
package com.pulkit4tech.privy.data.json; | ||
|
||
import com.google.gson.annotations.SerializedName; | ||
|
||
import java.util.List; | ||
|
||
public class MarkerData { | ||
private LocationData geometry; | ||
|
||
@SerializedName("icon") | ||
private String icon_url; | ||
private String id; | ||
private String name; | ||
private String place_id; | ||
private String scope; | ||
private List<String> types; | ||
private String vicinity; | ||
|
||
public LocationData getGeometry() { | ||
return geometry; | ||
} | ||
|
||
public void setGeometry(LocationData geometry) { | ||
this.geometry = geometry; | ||
} | ||
|
||
public String getIconurl() { | ||
return icon_url; | ||
} | ||
|
||
public void setIconurl(String icon_url) { | ||
this.icon_url = icon_url; | ||
} | ||
|
||
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 String getPlaceid() { | ||
return place_id; | ||
} | ||
|
||
public void setPlaceid(String place_id) { | ||
this.place_id = place_id; | ||
} | ||
|
||
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; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "MarkerData{" + | ||
"geometry=" + geometry + | ||
", icon_url='" + icon_url + '\'' + | ||
", id='" + id + '\'' + | ||
", name='" + name + '\'' + | ||
", place_id='" + place_id + '\'' + | ||
", scope='" + scope + '\'' + | ||
", types=" + types + | ||
", vicinity='" + vicinity + '\'' + | ||
'}'; | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
app/src/main/java/com/pulkit4tech/privy/data/json/PrivyPost.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package com.pulkit4tech.privy.data.json; | ||
|
||
import java.util.List; | ||
|
||
public class PrivyPost { | ||
private List<String> html_attributions; | ||
private List<MarkerData> results; | ||
private String status; | ||
|
||
public List<String> getHtmlattributions() { | ||
return html_attributions; | ||
} | ||
|
||
public void setHtmlattributions(List<String> html_attributions) { | ||
this.html_attributions = html_attributions; | ||
} | ||
|
||
public List<MarkerData> getResults() { | ||
return results; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "PrivyPost{" + | ||
"html_attributions=" + html_attributions + | ||
", results=" + results + | ||
", status='" + status + '\'' + | ||
'}'; | ||
} | ||
|
||
public void setResults(List<MarkerData> results) { | ||
this.results = results; | ||
} | ||
|
||
public String getStatus() { | ||
return status; | ||
} | ||
|
||
public void setStatus(String status) { | ||
this.status = status; | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.