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?
Use the following intent to go to Saint-Malo, France the most beautiful city in the world :
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("google.navigation:q=48.649469,-2.02579"));
startActivity(intent);
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
© 2022 - 2024 — McMap. All rights reserved.