Implement google location search in android app li

2019-02-19 15:29发布

问题:

I have implemented google location search like OlaCabs app but it is not as fast in searching as OlaCabs do.Reason behind it is I need to hit a rest api (Google Place api) to find locations as per text search. I noticed that in olacab app there is some text showing "powered by Google"(Look screen below).So I just want to know:

1.Is there any api provided by google for android rather than rest api ?

2.If OlaCaps using some paid google search API then what is it and form where can I buy it?

回答1:

  1. You seem to be looking for Google Places Autocomplete API

  2. Most of Google APIs are free till some courtesy limit (different for each API) and paid afterwards. Courtesy limits are higher if you have given your credit card info. Still if you are beyond free limit, you should consider paying for them.



回答2:

You are in search of Google places autocomplete.

I figured Google has the Place Autocomplete service using which I can allow the user to type in a city name which’ll fetch all the cities containing that string from Google’s servers that can be presented in an AutoCompleteTextView.

Link :

*http://codetheory.in/google-place-api-autocomplete-service-in-android-application/

Hope it will* help you.