【问题标题】:GPX files won't load in Android emulatorGPX 文件不会在 Android 模拟器中加载
【发布时间】:2016-12-17 02:25:45
【问题描述】:

总结:

我尝试将 GPX 文件加载到 Android 模拟器中,但收到错误消息“表包含错误。未发送位置”。

重现步骤:

  1. 打开模拟器
  2. 点击右侧垂直条中的三个点
  3. 在“位置”选项卡下的“扩展控件”弹出窗口中,单击“加载 GPX/KML”并选择一个 GPX 文件
  4. 点击“播放”按钮

GPX 文件(test.gpx):

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<gpx
xmlns="http://www.topografix.com/GPX/1/1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd"
version="1.1"
creator="gpx-poi.com">
   <wpt lat="28.0587" lon="-82.4139">
      <time>2015-12-01T03:01:44Z</time>
   </wpt>
</gpx>

预期行为:

位置应该发送到模拟器

观察到的行为:

错误消息“表包含错误。未发送位置”:

设备和安卓版本:

模拟器 Nexus 5X API 级别 23(Google API),1080 x 1920; 420 dpi,Android 6.0 (Google API),x86,1GB,Windows 7 Enterprise SP1 64 位

【问题讨论】:

    标签: android android-emulator location gpx


    【解决方案1】:

    截至 2016 年 8 月 10 日,模拟器似乎不支持 GPX 航点格式:

    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <gpx
    xmlns="http://www.topografix.com/GPX/1/1"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd"
    version="1.1"
    creator="gpx-poi.com">
       <wpt lat="28.0587" lon="-82.4139">
          <time>2015-12-01T03:01:44Z</time>
       </wpt>
    </gpx>
    

    不过,它似乎确实支持 GPX 轨道格式:

    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <gpx
    xmlns="http://www.topografix.com/GPX/1/1"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd"
    version="1.1"
    creator="gpx-poi.com">
       <trk>
          <name />
          <cmt />
          <trkseg>
            <trkpt lat="28.0587" lon="-82.4139">
              <ele>0</ele>
              <time>2015-12-01T03:01:44Z</time>
            </trkpt>
          </trkseg>
       </trk>
    </gpx>
    

    上述 GPX 轨道格式成功加载到模拟器并正确注入位置。

    【讨论】:

      猜你喜欢
      • 2020-01-10
      • 2011-05-23
      • 2014-06-10
      • 1970-01-01
      • 2013-06-21
      • 2017-09-11
      • 1970-01-01
      • 2013-11-06
      • 2023-03-24
      相关资源
      最近更新 更多