Android Emulator, Google Earth, and KML
Posted: June 8th, 2010 | Author: danny | Filed under: Uncategorized | Tags: android, google earth, kml | No Comments »This is a quick post that details how to use Google Earth to create a KML file that can then be used by Eclipse with the Android Emulator (ADK).
- Inside of google earth create a new folder.
- Add various placemarks to the map.
- Right click on the folder and select save place as (select kml as the file type).
- In Eclipse, start an emulated device
- In Eclipse, select the window menu item, and click on open perspective DDMS (Dalvik Debug Monitor Server).
- In the emulator control tab (most likely on the bottom left) find the location section and select kml.
- Click the load kml button to load kml - You should at this point see a datagrid populated with various locations.
-
- If no locations are loaded into the datagrid there might be one small problem with your kml file. For some reason when exporting kml using google earth it uses the default namespace of http://www.opengis.net/kml/2.2 as shown below:
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom"and it needs to be changed to: http://earth.google.com/kml/2.x
<kml xmlns="http://earth.google.com/kml/2.x"
- If no locations are loaded into the datagrid there might be one small problem with your kml file. For some reason when exporting kml using google earth it uses the default namespace of http://www.opengis.net/kml/2.2 as shown below:
- In the emulator select the Map application and go to the current location, it should take you to the the location in your kml file.
Leave a Reply