編輯:初級開發
一、KML文件其實是一個XML文件,我們看下KML文件結構
<?XML version="1.0" encoding="UTF-8"?>
<kml XMLns="http://earth.google.com/kml/2.2">
<Document>
<name>1065 Brea Mall, Brea, CA 92821.kml</name>
<StyleMap id="default_copy0+nicon=/School/UploadFiles_7810/201106/20110630123629854.png">
<Pair>
<key>normal</key>
<styleUrl>#default_copy0+icon=/School/UploadFiles_7810/201106/20110630123630798.png</styleUrl>
</Pair>
<Pair>
<key>highlight</key>
<styleUrl>#default_copy0+icon=/School/UploadFiles_7810/201106/20110630123630597.png</styleUrl>
</Pair>
</StyleMap>
<Style id="default_copy0+icon=/School/UploadFiles_7810/201106/20110630123630597.png">
<IconStyle>
<scale>1.1</scale>
<Icon>
<href>/School/UploadFiles_7810/201106/20110630123630597.png</href>
</Icon>
</IconStyle>
<LabelStyle>
<scale>1.1</scale>
</LabelStyle>
</Style>
<Style id="default_copy0+icon=/School/UploadFiles_7810/201106/20110630123630798.png">
<IconStyle>
<Icon>
<href>/School/UploadFiles_7810/201106/20110630123630798.png</href>
</Icon>
</IconStyle>
</Style>
<Placemark>
<name>1065 Brea Mall, Brea, CA 92821</name>
<address>1065 Brea Mall, Brea, CA 92821</address>
<LookAt>
<longitude>-117.883593</longitude>
<latitude>33.916991</latitude>
<altitude>0</altitude>
<range>1000</range>
<tilt>0</tilt>
<heading>0</heading>
</LookAt>
<styleUrl>#default_copy0+nicon=/School/UploadFiles_7810/201106/20110630123629854.png</styleUrl>
<Point>
<coordinates>-117.883593,33.916991,0</coordinates>
</Point>
</Placemark>
</Document>
</kml>
二、NMEA協議就是常規的GPS數據,通過串口直接獲取到的,如下
$GPRMC,003347.000,A,3725.3433,N,12205.7920,W,0.08,149.46,061007,,,D*70
$GPRMC,003348.000,A,3725.3433,N,12205.7921,W,0.05,142.51,061007,,,D*7E
$GPRMC,003349.000,A,3725.3432,N,12205.7921,W,0.08,159.56,061007,,,D*7E
$GPRMC,003350.000,A,3725.3432,N,12205.7921,W,0.06,151.59,061007,,,D*7F
$GPRMC,003351.000,A,3725.3432,N,12205.7921,W,0.20,120.57,061007,,,D*72
實例:
解析方法:
RMC = Recommended Minimum Specific GPS/TRANSIT Data
$GPRMC,hhmmss.ss,A,llll.ll,a,yyyyy.yy,a,x.x,x.x,ddmmyy,x.x,a*hh
1 = UTC(universal time, coordinated) of position fix
2 = Data status (A=good, V=navigation receiver warning)
3 = Current Latitude
4 = North/South in Latitude Hemisphere
5 = Current Longitude
6 = East/West in Longitude Hemisphere
7 = Speed over ground in knots
8 = (Direction of travel N:0°, E:90°, S:180°, W:270°)
9 = UT DateStamp
10 = Magnetic variation degrees (Easterly var. subtracts from true course)
11 = East/West
12 = Checksum
$GPRMC,003347.000,A,3725.3433,N,12205.7920,W,0.08,149.46,061007,,,D*70
public class HelloXML extends Activity {private static final int MESSAGETYPE_01 = 0x
在android平台中可以使用第三方外部JAR庫文件,在Eclipse開發環境中,僅僅3步就可以使用第三方.jar文件:1.在Package Explorer(包浏覽器
Android操作系統平台很容易跟Google其他應用如Google地圖的整合。在Android應用中,如果能在其中加入Google地圖,則會為你的應用增添強大的功能,
本文節選於機械工業出版社推出的《android應用開發揭秘》一書,作者為楊豐盛。本書內容全面,詳細講解了Android框架、android組件、用戶界面開發、游戲開發、