I'd like to tie into the directions functionality on Glass, in a similar method to the Mirror API Get Directions menu. Is there a way of launching directions via a URI within a GDK application?
8
votes
I'm very interested about this, thinking about creating navigation app which will lead you point to point. Have you tried calling Intent with ACTION_NAVIGATION? That would be my guess. If that works, we need to figure out parameter names for passing lat,lon AFAIK it's not documented anywhere.
– David Vávra
2 Answers
10
votes
0
votes
The log below was captured when launching built in navigation via "get directions"
11-20 22:26:58.087: I/NavigationActivity(14325): onCreate Intent { act=android.intent.action.VIEW dat=google.navigation:q=San+Diego&mode=mru flg=0x10000000 cmp=com.google.glass.maps/.NavigationActivity (has extras) }
It seems to show that you might be able to start activity class as "com.google.glass.maps.NavigationActivity" with Intent of "android.intent.action.VIEW " and data set to "google.navigation:q=San+Diego".
I've not actually try it, but it will be a good bet.
Update: after trying using 'adb am' command and it works, so this definitely should work from code prospective:
adb shell am start -n com.google.glass.maps/.NavigationActivity -a android.intent.action.VIEW -d google.navigation:q=92108