Search code examples
androidgoogle-mapskml

How to create KML file in Android?


At the moment, my app receives KML file from server and displays all the placemarks in the maps. But there is too much data going back and forth, so now i want to receive only a short string (lat,lang for a few points) from the server.

Is it possible to create KML file on an Android device (any API for this?


Solution

  • There does not seem to be any KML libraries that will work well with Android right now. I have been using the Simple XML library for parsing KML, and is working out well.

    However, since you are already receiving the data in a simplified format, you would be much better off using the Google Maps API directly yourself. This will save the effort of building up the KML, sending it to Google, and then getting back the rendered map. The tutorial here will help you get started: http://developer.android.com/resources/tutorials/views/hello-mapview.html