gpt4 book ai didi

android - 我们如何从 Android 中的 Google Places API 获取附近的地点?

转载 作者:行者123 更新时间:2023-11-29 23:01:40 25 4
gpt4 key购买 nike

研究如何为 Android 应用程序配置 Google Places API key ,因为 API 限制限制我们基于引用网站。现在 Google 将 Place API 视为 Web 服务,因此必须使用 IP 地址限制 API key 。所以我在 android 代码中得到了空结果,它说“API key 不受限制”,所以现在如何在 Android 应用程序中使用 API key 来接近地点结果。

最佳答案

请参阅https://developers.google.com/places/android-sdk/get-api-key#restrict-key有关限制您的 API key 用于您的 Android 应用程序的说明。

要使用 Places SDK for Android 实现附近地点的显示,您有两种选择:

  1. 使用PlacesClient.findCurrentPlace()立即获取设备当前位置周围最有可能的地点。
  2. 使用AutocompletesetLocationBias or setLocationRestriction允许用户键入他们想要在特定位置周围搜索的特定地名或查询。

关于android - 我们如何从 Android 中的 Google Places API 获取附近的地点?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56902056/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com