Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set language for Google Place Details result in android?

I want to set the language in which the results of Google Places API will be presented. I want the result I could get using this url:

https://maps.googleapis.com/maps/api/place/details/json?placeid=A_PLACE_ID&key=MY_EY&language=el 

In android I get place details like this:

PendingResult<PlaceBuffer> placeResult = Places.GeoDataApi
                        .getPlaceById(mGoogleApiClient, placeID);
placeResult.setResultCallback(mUpdatePlaceDetailsCallback);

I cannot find a way to set language for the results like above with "language=el".

like image 568
Manolis Karamanis Avatar asked Dec 16 '15 20:12

Manolis Karamanis


People also ask

How Use Google Places autocomplete Android?

The autocomplete widget is a search dialog with built-in autocomplete functionality. As a user enters search terms, the widget presents a list of predicted places to choose from. When the user makes a selection, a Place instance is returned, which your app can then use to get details about the selected place.

What is Google Places autocomplete?

If you're building a client-side application, take a look at the Places SDK for Android, the Places SDK for iOS, and the Places Library, Maps JavaScript API. The Place Autocomplete service is a web service that returns place predictions in response to an HTTP request.

How do I use Google Places autocomplete API?

Go to the Google Cloud Console. Click the Select a project button, then select the same project you set up for the Maps JavaScript API and click Open. From the list of APIs on the Dashboard, look for Places API. If you see the API in the list, you're all set.


1 Answers

Unfortunately we can't set language on the Places API for Android. The best way to go with this is to call the Places Details API. The resource has an optional language parameter to indicate the language of the response.

More information are shown here for the list of supported languages.

like image 189
adjuremods Avatar answered Oct 06 '22 20:10

adjuremods