Google Navigation 실행

2012. 8. 21. 14:21

Google Navigation control 하기 위한 방법은 다음과 같다.

Intent navigation = new Intent(Intent.ACTION_VIEW, 

Uri.parse(“http://maps.google.com/maps?saddr=42.35892,-71.05781&daddr=40.756054,-73.986951”));

startActivity(navigation);


saddr = latitude and longitude of starting point.

daddr = latitude and longitude of destination point.



아래와 같이 직접 주소를 입력해도 되고,

Intent intent = new Intent(android.content.Intent.ACTION_VIEW, 
      Uri.parse("google.navigation:q=an+1600 Amphitheatre Parkway Mountain View+CA"));
startActivity(intent);

Intent filter에 의해 Map 기능 있는 다른 App choose dialog box가 나온다면 요녀석으로 해결..

intent.setClassName("com.google.android.apps.maps", "com.google.android.maps.MapsActivity");


'관심거리 > Android' 카테고리의 다른 글

Android resource??  (0) 2014.09.06
UI는 UI Thread에게.  (1) 2012.08.20
startManagingCursor()  (2) 2012.02.26

+ Recent posts