본문 바로가기
안드로이드 코드

나혼자보는 카카오맵 총정리

by 우딬 2020. 11. 8.

1. 안드로이드에서 카카오앱 열기

 

        String url = "kakaomap://open";
        Intent intent2 = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
        startActivity(intent2);

 

2. 안드로이드에서 네이게이션앱 열기

 

        com.kakao.kakaonavi.Location destination = com.kakao.kakaonavi.Location.newBuilder(orderAddress, orderlon, orderlat).build(); //주소,y,x
        NaviOptions options = NaviOptions.newBuilder().setCoordType(CoordType.WGS84).setVehicleType(VehicleType.FIRST).setRpOption(RpOption.SHORTEST).build();

        KakaoNaviParams.Builder builder = KakaoNaviParams.newBuilder(destination).setNaviOptions(options);
        KakaoNaviParams params = builder.build();

        KakaoNaviService.navigate(ProgressPopupActivity.this, builder.build());
        <meta-data android:name="com.kakao.sdk.AppKey"
            android:value="9b2cdd1a1ccbfed5ec7026a44c11cda9"/>
    implementation group: 'com.kakao.sdk', name: 'kakaonavi', version: '1.6.2'

댓글