LoginSignup
37
38

More than 5 years have passed since last update.

GoogleMapナビの起動Intent

Last updated at Posted at 2013-03-07

GoogleMapナビをIntentで起動する方法メモ。
忘れないように備忘録。

Intent i = new Intent();
i.setAction(Intent.ACTION_VIEW);
i.setClassName("com.google.android.apps.maps", "com.google.android.maps.driveabout.app.NavigationActivity");

Uri uri = Uri.parse("google.navigation:///?ll=lat,lon&q=表示名");
i.setData(uri);
startActivity(i);

ll=lat,lon には目的地の緯度・経度が入ります。

ll=36.000000,137.000000

q=表示名 にはナビで表示する目的地名が入ります。
title=表示名としても同様ですが、目的地ではなく、"指定の地点"と表示されます。

徒歩の経路を検索する場合には、
mode=w
をつけると徒歩モードで検索します。

徒歩モード
Uri uri = Uri.parse("google.navigation:///?ll=lat,lon&title=表示名&mode=w");

logcatをみると、
entry=d
opt=4:0,5:0
というパラメータも渡しているようですが、何に使用しているのか不明でした。。。

37
38
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
37
38