tags:

views:

1509

answers:

4

I can't get DDMS to load any KML files.

I have a KML file for example with the following in it:

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2"&gt;
 <Placemark>
   <name>Simple placemark</name>
   <description>Attached to the ground. Intelligently places itself
      at the height of the underlying terrain.</description>
   <Point>
     <coordinates>-122.0822035425683,37.42228990140251,0</coordinates>
   </Point>
 </Placemark>
</kml>

The docs at http://developer.android.com/guide/developing/tools/ddms.html seem to indicate that I only need to launch my app and fire up DDMS and load the KML. That doesn't work.

I even tried the Google Earth solution suggested at the same link.

I'm using SDK 1.5_r2. I am doing something wrong or missing something?

+1  A: 

There are some quirks:

  1. You have to specify the namespace as:

    <kml xmlns="http://earth.google.com/kml/2.x"&gt;

  2. "Placemark" elements must start with capital letter.

  3. "coordinates" and "name" elements must be within a "Placemark" element and start in lowercase.

Your example only needs a different namespace.

Peter Schubert
A: 

you managed to make reading the posts by kml

dario
A: 

I am having the same problem. Not being able to load kml files. I even tried the above sample after changing the NS to read 2.x.

Jay
haven't got to 2.0 yet, but I'll comment again when I do.
Neil D
A: 

I have found this Link that converts the KML files to ones compatible with android. http://ge2adt.appspot.com/

Drahcir