Weird URL parse issue. (Android)

Posted by Tarmon on Stack Overflow See other posts from Stack Overflow or by Tarmon
Published on 2010-06-08T20:28:23Z Indexed on 2010/06/08 20:32 UTC
Read the original article Hit count: 414

Filed under:
|
|
|
|

I am attempting to parse in a URL to a KML file from maps.google.com. When I try and use this link:

http://maps.google.com/maps/ms?ie=UTF8&hl=en&msa=0&msid=112748174025829638330.000483ad6315714cc941d&z=13&output=kml`

I am unable to overlay this KML file on my MapView. If I were to take the KML file that I get from following this link and upload it to my Dropbox it will work just fine. I think there may be something about the URL from Google that it doesn't like?

Link from dropbox:

http://dl.dropbox.com/u/1037184/Blue_original.kml

Also it would be better if we could just save these KML files locally and pass them in the same way but I can't figure out a way to do this.

Here is the code I am using:

Intent mapIntent = new Intent(Intent.ACTION_VIEW);
Uri uri1 = Uri.parse("geo:0,0?q=http://code.google.com/apis/kml/ 
documentation/KML_Samples.kml");
mapIntent.setData(uri1);
startActivity(Intent.createChooser(mapIntent, "Test"));

The URL used in this example also works.

So to recap:

  1. I am curious as to why some URLs work and others don't.
  2. Is there a way to place this KML file locally on the device and pass it to a Uri object?
  3. Any other suggestions?

Thanks, Rob

© Stack Overflow or respective owner

Related posts about android

Related posts about url