谷歌地图在android中放置api未给出正确结果

谷歌地图在android中放置api未给出正确结果,android,android-maps,Android,Android Maps,在我的应用程序中,我试图获得美容院在我当前位置附近的位置。为此,我正在使用GooglePlacesAPI。正如在链接中提到的,我正在努力获取我附近美容院的所有信息。为此,我使用以下代码 private void onPerformSearch() { double lat=gePoint_pt.getLatitudeE6()/1E6; double lon=gePoint_pt.getLongitudeE6()/1E6; String url="https://map

在我的应用程序中,我试图获得美容院在我当前位置附近的位置。为此,我正在使用GooglePlacesAPI。正如在链接中提到的,我正在努力获取我附近美容院的所有信息。为此,我使用以下代码

private void onPerformSearch() {

    double lat=gePoint_pt.getLatitudeE6()/1E6;
    double lon=gePoint_pt.getLongitudeE6()/1E6;

    String url="https://maps.googleapis.com/maps/api/place/search/xml?";
    url=url.concat("&location="+lat+","+lon);
    //url=url.concat("&location="+gePoint_pt);
    url=url.concat("&radius="+1000);
    url=url.concat("&types="+"beauty"+"_"+"salon");
    url=url.concat("&name=");
    url=url.concat("&sensor="+"true");
    url=url.concat("&key=*******");
    Log.i("url=========",""+url);
    try {

        HttpClient client=new DefaultHttpClient();
        HttpGet request = new HttpGet();
        request.setURI(new URI(url));
        HttpResponse response = client.execute(request);
        HttpEntity resEntity = response.getEntity();  
        if (resEntity != null) 
        { 
            //get web service responce
            String res_str=EntityUtils.toString(resEntity);
            Log.i("RESPONCE======",""+res_str);
            if(res_str!=null)
            {
                parse(res_str);
            }

        }
    }
    catch (Exception e) {
        e.printStackTrace();
    }





}
但现在我的问题是,无论何时我调用这种方法,美容院都会得到“零结果”。但当我在atm机上尝试同样的方法时,它会给我正确的结果。当我尝试用谷歌地图搜索相同的东西时,它会给我正确的回答。它显示了我附近所有的美容院。

这对我来说很有用:

其中lat,lon是双纬度和双经度


edit:
OP回答了这个问题,使用
name
参数而不是
types
,这很奇怪,因为Places文档明确说明使用
types
参数。此外,这在美国/英国等国家不需要,仅适用于印度地区。我希望谷歌能尽快解决这个问题

@reno…感谢您的回复…但在支持类型部分提到美容院的地方API文档…这是我使用它的原因…您能告诉我更多关于这个的细节吗…bcoz我无法打开您提到的url…您是对的,我已经检查了文档。你能告诉我你的近况吗,朗?我使用的url提供了一个类似于xml的kml。这是一个谷歌地球可以打开的文件。沙龙&name=&sensor=true&key=AIzaSyCALnYwpK5B90jgiSG2G0O4F5-dZz5gxEI…….这是我的url..它给我的响应是零结果…你是对的,这似乎是谷歌端的某种错误。然而,我的URL提供了10个位置。我已经在美国和英国的一些地方测试过你的URL,效果很好。有些地方在印度根本不起作用。@reno…终于得到了我的ans…我在Google places API上浏览了论坛…我用美容院替换了名称字段,现在开始工作了…无论如何谢谢你的帮助。。。