traversal path for the requested pieces of info from the JSON response for an instagram API query
Number of likes for an image:
Root->JSONObject with key “data”->JSONObject with key “likes”->get integer value for the key “count”
Image filter selected for the image:
Root->JSONObject with key “data”-> get String value for the key “filter”
Website URL for the thumbnail version of the image:
Root->JSONObject with key “data”->JSONObject with key “images”-> JSONObject with the “thumbnail”->get String value for the key “url”
Username of the first user in the image:
Root->JSONObject with key “data”->JSONArray with key “tags”->Look at first element in the array
Parsing json in android
https://developer.android.com/reference/org/json/JSONObject.html
https://developer.android.com/reference/org/json/JSONArray.html
json format
https://jsonformatter.curiousconcept.com/
Magnitude, Location, Time, Website URL
long timeInMilliseconds = 14512431222OL; Date dateObject = new Date(timeInMilliseconds); SimpleDateFormat dateFormatter = new SimpleDateFormat("MMM DD, yyyy"); String dateToDisplay = dateFormatter.format(dateObject); import java.text.SimpleDateFormat; import java.util.Date;