使用Eclipse中的DDMS視圖,我發現可以使用KML文件將位置提供給AVD。我有一個應用程序,用於偵聽位置並移動Google地圖視圖,從一個地方繪製線條到另一個地方。當我使用手動選項卡手動輸入時,它工作正常。在AVD中使用KML文件
但是,當我嘗試打開有效的KML文件時,沒有任何反應。我有數百個有效的KML文件,可以在Google地球,Bing地圖和Google地圖中正常工作。但DDMS模擬器控件不打開它們。沒有任何錯誤,它只是不打開它們。我在下面粘貼了一個小的KML文件。這個論壇軟件有問題,當我粘貼代碼時,它並沒有捕捉到所有的東西,所以它看起來像一個無效的文件,但它不是,它通常捕捉第一行,跳過一堆其他行,然後顯示文件的其餘部分,它也是用Java代碼完成的)。
感謝, 加里
<?xml version="1.0" encoding="utf-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<Name>_Name</Name>
<Style id="mTTPathStyle">
<LineStyle>
<color>aaff0000</color>
<width>4</width>
</LineStyle>
</Style>
<Style id="StartIconStyle">
<IconStyle>
<Icon><href>http://dl.dropbox.com/u/39662979/start.png</href></Icon>
<hotSpot x="0.5" y="0.0" xunits="fraction" yunits="fraction" />
</IconStyle>
</Style>
<Style id="FinishIconStyle">
<IconStyle>
<Icon><href>http://dl.dropbox.com/u/39662979/finish.png</href></Icon>
<hotSpot x="0.5" y="0.0" xunits="fraction" yunits="fraction" />
</IconStyle>
</Style>
<Folder>
<name>Test1</name>
<open>1</open>
<Placemark><name><![CDATA[6/3/2012 4:00:34 PM]]></name><visibility>1</visibility><styleUrl>#StartIconStyle</styleUrl><Point><coordinates>-111.03501118, 31.79118389, 893.5 </coordinates></Point></Placemark>
<Placemark><name><![CDATA[6/3/2012 4:01:55 PM]]></name><visibility>1</visibility><description>Test1 0.37 Miles 1 min, 21 sec 16.7 MPH</description><styleUrl>#FinishIconStyle</styleUrl><Point><coordinates>-111.03053401,31.79307061,932.299987792969 </coordinates></Point></Placemark>
<Folder><name><![CDATA[Path]]></name><open>0</open><Placemark><name>only Segment for now</name><styleUrl>#mTTPathStyle</styleUrl><LineString><extrude>0</extrude><tessellate>1</tessellate><altitudeMode>clampToGround</altitudeMode><coordinates>-111.03501118,31.79118389,893.5 -111.0352843,31.79227626,917.299987792969 -111.03510817,31.79219134,927.099975585938 -111.03491294,31.79222276,927.5 -111.03483045,31.79230171,928 -111.03465771,31.79236738,929.799987792969 -111.03418779,31.79235829,933.799987792969 -111.03282738,31.79241828,934.799987792969 -111.03200371,31.79269077,932.099975585938 -111.03157208,31.79302646,933.900024414063 -111.0311052,31.79310853,933.599975585938 -111.03053401,31.79307061,932.299987792969 </coordinates></LineString></Placemark></Folder>
</Folder>