Skip to content Skip to sidebar Skip to footer

Issue Streaming Directions For Google Maps Api V2 Android

So part of my application builds a navigation directions string and then attempts to parse the JSON and draw the polyline routes on my map. I first build my string using Location v

Solution 1:

You have to URL-encode the params, e.g. a space (" ") in a URL is written as "+". Your browser internally does this, probably without showing you the submitted URL.

static String urlEncode(String value) {
    try {
        return URLEncoder.encode(value, "UTF-8");
    } catch (UnsupportedEncodingException e) {
        return value;
    }
}

But don't encode the whole URL, only the parameter values. If the parameter names are non-ASCII, they have to be encoded as well, but Google APIs don't use such parameters.

Post a Comment for "Issue Streaming Directions For Google Maps Api V2 Android"