0

通过使用此代码,我获得了所有场地详细信息,在这里我想要特定类型的场地让我们说“酒店”,“餐厅”如何在以下代码中指定。

DefaultHttpClient httpclient = new DefaultHttpClient();
        final HttpParams httpParams = httpclient.getParams();
        HttpConnectionParams.setConnectionTimeout(httpParams, 30000);
        HttpConnectionParams.setSoTimeout(httpParams, 30000);
        HttpGet httppost = new HttpGet(
                "https://api.foursquare.com/v2/venues/search?intent=checkin&ll="
                + lat + "," + longi + "&client_id=" + client_id
                        + "&client_secret=" + client_secret + "&v="
                        + 20131008); //
4

1 回答 1

0

尝试了这个修改过的 url 来解决这个问题。在 url 中我们可以直接过滤场地。

try {
            httppost = new HttpGet(
                    "https://api.foursquare.com/v2/venues/search?intent=checkin&ll="
                    + lat + "," + longi + "&client_id=" + client_id
                            + "&client_secret=" + client_secret +"&query="+ URLEncoder.encode("Hotel|Bar|Club|Cafe|CoffeeShops", "utf-8")+ "&v="
                            + 20131008);
        } catch (UnsupportedEncodingException e1) {
            // TODO Auto-generated catch block
            e1.printStackTrace();
        } //
于 2013-10-08T12:16:09.757 回答