回答

0

您可以通过Official Google Documentation of API for Android读一个完整的信息谷歌地图。本指南介绍Google Places for Android中的功能,并向您展示如何配置应用以使用API​​。

Google Places API for Android的主要入口点是PlacePicker UI小部件,Autocomplete UI小部件,GeoDataApiPlaceDetectionApi

使用适用于Android的Google API,您可以构建位置感知型应用程序,对上下文响应本地企业和设备附近的其他地方。这意味着您可以基于对用户意味着什么的地方构建丰富的应用,以补充由[Android位置服务]提供的简单的基于地理位置的服务[6],您会传递一般搜索字词,Google地图将尝试查找您指定的lat/lng附近的位置符合您的标准。如果没有指定位置,Google地图会尝试查找附近的列表。例如:

// Search for restaurants nearby 
Uri gmmIntentUri = Uri.parse("geo:0,0?q=restaurants"); 
Intent mapIntent = new Intent(Intent.ACTION_VIEW, gmmIntentUri); 
mapIntent.setPackage("com.google.android.apps.maps"); 
startActivity(mapIntent); 

// Search for restaurants in San Francisco 
Uri gmmIntentUri = Uri.parse("geo:37.7749,-122.4194?q=restaurants"); 
Intent mapIntent = new Intent(Intent.ACTION_VIEW, gmmIntentUri); 
mapIntent.setPackage("com.google.android.apps.maps"); 
startActivity(mapIntent); 
相关问题