简体   繁体   English

Android Google在附近搜索

[英]Android google places nearby search

I am using Google Places API for searching nearby places. 我正在使用Google Places API搜索附近的地方。 I enabled Google Places API and I need to search for Taj Hotels nearby my current location, So I wrote code like this but I am getting some other names.. Can anyone please help me to do it. 我启用了Google Places API,我需要搜索当前位置附近的泰姬陵酒店,所以我写了这样的代码,但我得到了一些其他的名字。

btnFind.setOnClickListener(new OnClickListener() {

                @Override
                public void onClick(View v) {

                    String type = "Taj Hotel";

                    StringBuilder sb = new StringBuilder("https://maps.googleapis.com/maps/api/place/nearbysearch/json?");
                    sb.append("location="+mLatitude+","+mLongitude);
                    sb.append("&radius=5000");
                    sb.append("&types="+type);
                    sb.append("&sensor=true");
                    sb.append("&key=XXXXXXXXXXXXXXXXXX e");

try using this command it will show nearby places in ascending order 尝试使用此命令,它将以升序显示附近的地方

    String url= "https://maps.googleapis.com/maps/api/place/nearbysearch/json?location="+latitude+","+longitude+"&rankby=distance&name="+constraint+"&key="+API_KEY;

Refer here for more:- http://coderzpassion.com/android-working-google-places-api/ 有关更多信息,请参见此处: -http : //coderzpassion.com/android-working-google-places-api/

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

相关问题 显示谷歌地图搜索android附近的地方 - Showing nearby places in google map search android Android:如何使用Google Places API(自动填充)搜索附近的酒店? - Android: How to search for nearby hotels using the Google Places API (Autocomplete)? 带有附近地点的 Android 谷歌地图 - Android Google map with nearby places Android:使用Google Places API查找附近的地点 - Android: Finding nearby places with Google Places API 使用谷歌搜索特定的附近地方为Android安置api web服务 - Search specific nearby places using google places api web services for android 使用 Kotlin 在 Android Studio 中搜索附近地点 - Search Nearby Places in Android Studio using Kotlin Google附近的地方Android版-需要应用限制 - Google Nearby Places Android - Need to apply Restrictions Android 谷歌地图:哪个 API 用于搜索您当前位置附近的地方? - Android Google Maps: which API used to search places nearby your current location? 我正在尝试在Android的Google地图上的绘制区域内搜索附近的地方,例如银行,饭店,自动取款机 - I'm trying to search nearby places such as banks, restaurants, ATMs inside the drawn area on google maps in android Google Places API获取Android中附近地点的距离 - Google places api get distance of nearby places in android
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM