获取用户当前位置周围的地点列表
因此,我在 SO 和其他论坛上看到了很多与此相关的问题,但没有明确的答案。这似乎是一个基本的过程,所以我不明白为什么我找不到任何答案。
在 Android 开发者文档中 - http://developer. android.com/guide/topics/location/obtaining-user-location.html#Adjusting - 在“帮助用户决定去哪里”部分的底部附近,他们给出了一个例子,“你希望提供附近餐馆、商店和娱乐场所的列表,并且推荐顺序会根据用户位置而变化。”
这篇文章 - 查找附近位置 - 建议使用外部 API。对于我来说,Google 的 Android API 不包含此功能是没有意义的,特别是考虑到其文档中的上述场景。
其他帖子讨论了使用 GeoCoder + getFromLocationName()。这似乎不太正确,因为它并不真正感觉像搜索,而且似乎也针对特定地址。
Android 开发者文档中的上述示例是否可以使用当前的 Android SDK 来完成?我在很多应用程序中都看到过这种情况,但尝试奇怪的解决方案却毫无效果,我感到非常沮丧。请帮助我了解发生了什么事。
谢谢!
更新:Google Places API 不是这个问题的答案吗?它是一个网络服务,但看起来它的作用正是我上面描述的?如果我在这方面离题很远,请告诉我。
So, I've seen many questions about this here on SO and in other forums, but no definite answer. It seems like such a basic process, so I don't understand why I can't find any answers for it.
In the Android Developer documentation - http://developer.android.com/guide/topics/location/obtaining-user-location.html#Adjusting - near the bottom in the section "Helping the user decide on where to go", they give the example, "you're looking to provide a list of nearby restaurants, stores, and entertainment and the order of recommendations changes depending on the user location."
This post - finding nearby locations - suggests using external APIs. It doesn't make sense to me that Google's Android API would not include this functionality, especially given the above scenario in their documentation.
Other posts talk about using the GeoCoder + getFromLocationName(). This doesn't seem right either seeing as how it doesn't really feel like a search and it also seems geared toward a specific address.
Is the above example from the Android Developer documentation able to be done using the current Android SDK? I've seen it done in many apps and am getting very frustrated trying weird solutions that don't get anywhere. Please help me understand what's going on.
Thanks!
UPDATE: Is Google Places API not the answer for this? It is a web service, but it seems like the it does exactly what I've described above? If I am way off on this, please let me know.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
适用于 Java 的 Google API 客户端库(用于基于 HTTP 的 API)和 Google Places API(用于地点数据)是正确的选择。
使用 Google Places API
Google APIs Client Library for Java (for HTTP-based APIs) and Google Places API (for Places Data) is the way to go.
Using Google Places API