Android 플랫폼에서 아이나비 지도를 사용하기 위한 프로젝트 기본 설정 방법을 설명합니다.
0.20.0 미만 버전은 일정 시간이 지난 후 지원이 종료될 수 있습니다. 0.20.0 이상 버전으로 업그레이드를 권장합니다.- 0.20.0 미만 버전의 설명은 이전 README.md를 참조하시기 바랍니다.
- 아이나비 지도를 사용하기 위해서는 인증을 위한 APP KEY가 필요합니다.
- APP KEY 발급을 위해서는 iMPS 계정이 필요합니다. 계정이 없다면 먼저 계정을 생성해주세요.
- iMPS Console 에서 APP을 생성합니다.
- 생성된 APP에서 상품을 신청을 신청하시면, APP KEY를 확인할 수 있습니다.
다음과 같이 Project 및 App 모듈 레벨의 build.gradle 파일에 아이나비 지도 저장소를 추가하고, 의존성을 설정합니다.
/* Root Project build.gradle */
allprojects {
repositories {
google()
...
// 아이나비 지도 저장소
maven {
url 'https://repo.inavi.com/artifactory/maps'
}
}
}/* App Module build.gradle */
dependencies {
implementation 'com.inavi.mapsdk:inavi-maps-sdk:0.21.1'
}발급받은 APP KEY를 설정할 수 있도록 아래의 두 가지 방법을 제공합니다.
APP KEY가 설정되지 않으면 지도 초기화 단계에서 인증 오류가 발생합니다.
AndroidManifest.xml에 다음과 같이 <meta-data>를 추가하여 APP KEY를 설정할 수 있습니다.
<!-- AndroidManifext.xml -->
<manifest>
<application>
<meta-data
android:name="com.inavi.mapsdk.AppKey"
android:value="YOUR_APP_KEY" />
</application>
</manifest>Application 생성 시점에 동적으로 InaviMapSdk 싱글턴 객체의 함수를 호출하여 APP KEY를 설정할 수 있습니다.
// Kotlin
InaviMapSdk.getInstance(context).appKey = "YOUR_APP_KEY" R8/ProGuard를 사용하는 릴리스 빌드에서는 iNavi Maps SDK 관련 클래스 보존을 위해 아래 규칙을 proguard-rules.pro 또는 consumer-rules.pro에 필수로 추가해야 합니다.
-keep class com.inavi.mapsdk.** { *; }
-dontwarn com.inavi.mapsdk.**추가적인 iNavi Maps SDK 사용법은 iMPS를 참고하시기 바랍니다.
© 2019-2025. iNavi Systems Corp. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.