Question

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">
 <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?

Was it helpful?

Solution

There are some quirks:

  1. You have to specify the namespace as:

    <kml xmlns="http://earth.google.com/kml/2.x">

  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.

OTHER TIPS

For those coming here from Google, this is the only online KML conversion tool I've found that will turn a regular KML file into one that DDMS will parse:

http://lab.soledadpenades.com/android/kml/

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

This example kml file worked for me. The trick was using notepad to create it, not wordpad. Your mileage may vary.

link text

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top