I am new to learning Google Places API and have been searching for an answer to this problem without much luck.
So in the first part of my app, I wish to retrieve the placeTypes of my current location. I have successfully done that, but it returns a list of Integer values, which then correlate to different Place.TYPE_*s.
My overall goal, though, is to get the current placeTypes of my location, then do a PlaceSearch via URL. To do so, I need to convert the Integers in my list of the location, to the string types so I can insert them into my URL.
Note: I have tried inserting the integer value for "restaurant" instead of just the word "restaurant" in the URL, but it returned wrong results such as hotels, office buildings that were not returned when I used the word instead.
For example, my URL would look like:
https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=" + lat + "," + lng+"&radius=2000&type=restaurant&key=my_key
Notice the word "restaurant" in the URL. That is where I have replaced it with the Integer value and it did not return correct results.
[EDITED]
You can try this.
I created a test to validate it, should work, just missing some types:
administrative_area_level_4
,administrative_area_level_5
,postal_code_suffix
andstreet_number
.[OLD]
I didn't understand where type integer is coming from, in documentation it's always referred as string.