简体   繁体   中英

How to read KML file using java android

I want to read a KML file that exists on the android mobile directory(sd card ) and I want to get the information from this file and display it on the screen.

this is the KML file that I have :

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

Just parse it as you parse XML. Here's my take on it. Hope this help: https://gist.github.com/3163006

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM