【问题标题】:Is it possible to programmatically access the Google Maps' navigation history?是否可以以编程方式访问谷歌地图的导航历史?
【发布时间】:2013-11-16 09:38:50
【问题描述】:

我想知道是否可以检索谷歌地图的导航历史。换句话说,有没有办法检索 Google 地图应用的用户最近使用/搜索的路线?

谢谢

【问题讨论】:

    标签: android google-maps


    【解决方案1】:

    您无法完成 Google 导航应用。

    我发现只有一项工作可以解决, 以当前位置重新开始导航,导航将自动结束。

    public static void startNavigationIntent(Context activity, String destination)
        {
            Intent intent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse("google.navigation:q=" + destination));
            activity.startActivity(intent);
        }
    

    然后将您的应用带到前台。

    Intent bringToForegroundIntent = new Intent(BackgroundLocationService.this, DashboardActivity.class);
                            bringToForegroundIntent.setFlags(Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED | Intent.FLAG_ACTIVITY_NEW_TASK);
                            startActivity(bringToForegroundIntent);
    

    【讨论】:

      【解决方案2】:

      没有可用于从导航应用程序获取信息的 API。但是您可以向地图提供一些数据,以通过 Intent / URI 请求路线。

      但我不认为地图应用程序会保存整条路线,只会保存目的地。用户选择任何保存的目的地,您可以从任何来源到达那里。

      【讨论】:

      • 目标列表是否可以通过 API 访问?
      • @GuilhermeSilva AFAIK no.
      猜你喜欢
      • 1970-01-01
      • 2014-09-28
      • 2021-03-23
      • 2012-01-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-10-22
      • 2011-03-15
      相关资源
      最近更新 更多