简体   繁体   English

就像在Google Maps上一样,Google Places API(Android)自动完成

[英]Google Places API (Android) Autocomplete just like on Google Maps

I am working on an app in which there is a AutoCompleteTextView that returns suggestions when a user types in. Everything is working fine but I have noted that there is difference in suggestions comparing to maps.google.com. 我正在开发一个应用程序,其中有一个AutoCompleteTextView可以在用户键入内容时返回建议。一切正常,但是我注意到与maps.google.com相比,建议存在差异。 For example when I search "bakery near" in google maps it returns suggestions, but when I search same text on my test app (which uses Google Places API AutoComplete) it returns nothing. 例如,当我在Google地图中搜索“附近的面包店”时,它会返回建议,但是当我在测试应用程序(使用Google Places API自动完成)中搜索相同的文本时,它什么也不会返回。 Please tell me how can I achieve the suggestions like maps.google.com. 请告诉我如何实现诸如maps.google.com之类的建议。

Note: I don't want to show google maps in my app. 注意:我不想在我的应用程序中显示Google地图。

Google Maps Example: http://i.imgur.com/BiwzxoD.jpg , Google Places API AutoComplete Example: http://i.imgur.com/T4lQe7x.png Google Maps示例: http : //i.imgur.com/BiwzxoD.jpg,Google Places API自动完成示例: http : //i.imgur.com/T4lQe7x.png

Your help would be highly appreciated. 您的帮助将不胜感激。

For a query like, "bakery near ...", I believe you would want to use the Query Autocomplete web service. 对于类似“ ...附近的面包店”的查询,我相信您将要使用查询自动完成 Web服务。 Though even with this I do notice some differences between the results on Google Maps and this web service. 尽管这样做,但我确实注意到Google Maps和该Web服务的结果之间存在一些差异。 I suspect that Google Maps has custom logic that moulds the input/results to be a bit more intuitive. 我怀疑Google Maps具有自定义逻辑,可以使输入/结果更直观。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM