๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
tip๐Ÿ’ก

์•ˆ๋“œ๋กœ์ด๋“œ ์ŠคํŠœ๋””์˜ค ๋„ค์ด๋ฒ„์ง€๋„ api ์‚ฌ์šฉํ•˜๊ธฐ

by suyeoneee 2022. 6. 12.

1. ํด๋ผ์ด์–ธํŠธ ID ๋ฐœ๊ธ‰ํ•˜๊ธฐ

ํ”„๋กœ์ ํŠธ๋ช…์€ ์•ˆ๋“œ๋กœ์ด๋“œ ํŒจํ‚ค์ง€๋ช…๊ณผ ๋™์ผํ•˜๊ฒŒ

 

2. AndroidManifest.xml ์ฝ”๋“œ ์ถ”๊ฐ€

<application
	tools:replace="android:appComponentFactory"
    android:appComponentFactory="whateverString">
	<meta-data
            android:name="com.naver.maps.map.CLIENT_ID"
            android:value="๋ฐœ๊ธ‰๋ฐ›์€ ID" />
</application>

3. build.gradle(:app)

dependencies {

    implementation 'androidx.appcompat:appcompat:1.4.1'
    implementation 'com.google.android.material:material:1.6.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
    // ๋„ค์ด๋ฒ„ ์ง€๋„ SDK
    implementation 'com.naver.maps:map-sdk:3.15.0'
}

4. gradle.properties

android.useAndroidX=true
android.enableJetifier=true

5. settings.gradle

dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
        jcenter() // Warning: this repository is going to shut down soon
        maven {
            url 'https://naver.jfrog.io/artifactory/maven/'
        }
    }
}

6. activity_main.xml

<fragment
        android:id="@+id/map"
        android:name="com.naver.maps.map.MapFragment"
        android:layout_width="match_parent"
        android:layout_height="600dp"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintBottom_toTopOf="@+id/tv"/>

์ตœ๊ทผ๋Œ“๊ธ€

์ตœ๊ทผ๊ธ€

skin by ยฉ 2024 ttuttak