android - GPX 文件无法在 Android 模拟器中加载

标签 android android-emulator location gpx

摘要:

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

重现步骤:

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

Emulator Location

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>

预期行为:

位置应发送到模拟器

观察到的行为:

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

image

设备和 Android 版本:

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

最佳答案

截至 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 轨道格式已成功加载到模拟器中并正确注入(inject)位置。

关于android - GPX 文件无法在 Android 模拟器中加载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38877870/

相关文章:

android - MediaPlayer 错误 (1, -1004) 为什么?

android - 在android模拟器中模拟led手电筒?

安卓模拟器 : How can I get a list of services that are running

android - 根据时间间隔或位移获取位置更新

linux - 从linux中的某个目录启动shell

android - 如何获取 Android chromebook 上的物理屏幕尺寸?

java - 在Android中快速发送大文件

android - 在 Android Lollipop 上关闭蓝牙时应用程序崩溃

android - 除非您更新 Google Play 服务错误,否则此应用将无法运行

javascript - Angular 重定向功能