페이지 이동경로
  • Docs>
  • Kakao Navi>
  • Android

Kakao Navi

Android

This document describes how to integrate the Kakao Navi API into your service with the Kakao SDK for Android ("Android SDK").

Before you begin

Check if Kakao Navi is installed

The Kakao Navi API provides the navigateIntent() function for navigation and the shareDestinationIntent() function for location sharing.

navigateIntent() and shareDestinationIntent() return Intent to invoke the navigation and location sharing function via the Kakao Navi app ("app"). If the Kakao Navi app is installed on a user's device, the app is launched. If not, the user should be directed to the download page for the Kakao Navi app.

To check if the Kakao Navi app is installed on a user's device, use the isKakaoNaviInstalled() method. Here is an example to check if the Kakao Navi app is installed.

if (NaviClient.instance.isKakaoNaviInstalled(context)) {
    Log.i(TAG, "Possible to use navigation on Kakao Navi app.")
} else {
    Log.i(TAG, "Kakao Navi app is not installed.")
}

Start navigation

Basic information
Reference App setting
[SDK] navigateIntent()
[SDK] Location
[SDK] NaviOption
Install
Initialize
Permission Prerequisite Kakao Login User consent
- Register platforms - -

Starts directions from a user's current location to the entered destination.

End of support for Kakao Navi web version

In Android SDK 2.8.4 or higher, Kakao Navi does not support its web version that is started on a device where the Kakao Navi app is not installed. Thus, implement to open the download page for Kakao Navi if Kakao Navi is not installed. Because the web version of navigation will be no longer available in the old versions, we recommend you to use the latest SDK. For more information, refer to Notice.

Request

Call the navigateIntent() method defined in the NaviClient class. You must pass destination as Location object that containing the destination information as an argument. You can also specify the desired search criteria using NaviOption.

Sample

// Navigation
if (NaviClient.instance.isKakaoNaviInstalled(requireContext())) {
    // If Kakao Navi is installed, navigation starts on Kakao Navi with WGS84.
    startActivity(
        NaviClient.instance.navigateIntent(
            Location("카카오 판교오피스", "127.108640", "37.402111"),
            NaviOption(coordType = CoordType.WGS84)
        )
    )
} else {
    // If Kakao Navi is not installed, open the download page for Kakao Navi.
    startActivity(
        Intent(
            Intent.ACTION_VIEW,
            Uri.parse(Constants.WEB_NAVI_INSTALL)
        ).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP)
    )
}
Start navigation

Addtional feature

Waypoint

This API also provides a function to specify a list of waypoints. To add waypoints, pass viaList through Location object.

// Navigation
if (NaviClient.instance.isKakaoNaviInstalled(requireContext())) {
    // If Kakao Navi is installed, navigation via waypoints starts on Kakao Navi with WGS84.
    startActivity(
        NaviClient.instance.navigateIntent(
            Location("카카오 판교오피스", "127.108640", "37.402111"),
            NaviOption(coordType = CoordType.WGS84),
            // Set a list of waypoints.
            listOf(
                Location("판교역 1번출구", "127.111492", "37.395225")
            )
        )
    )
} else {
    // If Kakao Navi is not installed, open the download page for Kakao Navi.
    startActivity(
        Intent(
            Intent.ACTION_VIEW,
            Uri.parse(Constants.WEB_NAVI_INSTALL)
        ).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP)
    )
}

Share location

Basic information
Reference App setting
[SDK] shareDestinationIntent()
[SDK] Location
[SDK] NaviOption
Install
Initialize
Permission Prerequisite Kakao Login User consent
- Register platforms - -

Provides a screen to share the destination specified on the Kakao Navi app.

Request

Call the shareDestinationIntent() method in the NaviClient class, which returns Intent. You must pass destination as Location object containing the location information as an argument. You can also specify the desired search criteria using NaviOption.

Sample

// Sharing location
if (NaviClient.instance.isKakaoNaviInstalled(requireContext())) {
    // If Kakao Navi is installed, location is shared on Kakao Navi with WGS84.
    startActivity(
        NaviClient.instance.shareDestinationIntent(
            Location("카카오 판교오피스", "127.108640", "37.402111"),
            NaviOption(coordType = CoordType.WGS84)
        )
    )
} else {
    // If Kakao Navi is not installed, open the download page for Kakao Navi.
    startActivity(
        Intent(
            Intent.ACTION_VIEW,
            Uri.parse(Constants.WEB_NAVI_INSTALL)
        ).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP)
    )
}
Share location

Additional feature

Waypoint

This API also provides a function to specify a list of waypoints. To share loacation with waypoints, pass viaList through Location object.

// Sharing location
if (NaviClient.instance.isKakaoNaviInstalled(requireContext())) {
    // If Kakao Navi is installed, location is shared on Kakao Navi with WGS84.
    startActivity(
        NaviClient.instance.shareDestinationIntent(
            Location("카카오 판교오피스", "127.108640", "37.402111"),
            NaviOption(coordType = CoordType.WGS84),
            // Set a list of waypoints.
            listOf(
                Location("판교역 1번출구", "127.111492", "37.395225")
            )
        )
    )
} else {
    // If Kakao Navi is not installed, open the download page for Kakao Navi.
    startActivity(
        Intent(
            Intent.ACTION_VIEW,
            Uri.parse(Constants.WEB_NAVI_INSTALL)
        ).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP)
    )
}