Android Emulator, Google Earth, and KML

Posted: June 8th, 2010 | Author: danny | Filed under: Uncategorized | Tags: , , | 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).

  1. Inside of google earth create a new folder.
  2. Add various placemarks to the map.
  3. Right click on the folder and select save place as (select kml as the file type).
  4. In Eclipse, start an emulated device
  5. In Eclipse, select the window menu item, and click on open perspective DDMS (Dalvik Debug Monitor Server).
  6. In the emulator control tab (most likely on the bottom left) find the location section and select kml.
  7. Click the load kml button to load kml – You should at this point see a datagrid populated with various locations.
    1. 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"

  8. 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.

Android 2.1 Development Notes

Posted: February 11th, 2010 | Author: admin | Filed under: Uncategorized | Tags: | No Comments »

The following is the notes I made while getting android 2.1 working on XP with Eclipse.  It wasn’t as easy as to get up and going as it should be, but the following instructions fix the only hard part — the installer doesn’t create necessary directories.

Dev Environment: Using Eclipse on Windows

Steps:

0. Download and Install SDK
1. Install ADT (Android Development Toolkit)

Didn’t work, I had no targets.

When running android.bat

I got the following:

Starting Android SDK and AVD Manager
Error: Error parsing the sdk

3. I manually created the directories: platform & add-ons in the android directory.  So the android directory now looks like

android-sdk-windows\tools
android-sdk-windows\platforms
android-sdk-windows\add-ons

This allowed android to run launching the Android SDK and AVD Manager, which then gives the error:

Failed to fetch URL https://dl-ssl.google.com/android/repository/repository.xml, reason: dl-ssl.google.com

4. I had to go to the settings section and click Force https:// to be fetched using http://

5. I was then able to see the available packages and selected SKD Platform 2.1 API 7 rev1, Google APIs by Google Inc App7 rev1, and USB driver package rev3

6. I was then able to create a new virtual device (AVD).

7. In Eclipse, I created a new Android Project, and then proceeded to try the Hello World Tutorial

Everything worked fine and I was able to create my application :)

Overall, I like the design of Android — I still have to do some work with it but, I like the overall concept.