Skip to content

Commit

Permalink
feature/#1: 네이버 맵 SDK 설정
Browse files Browse the repository at this point in the history
  • Loading branch information
tristanjung1006 committed Jan 11, 2025
1 parent 79d3991 commit ebaf314
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 0 deletions.
11 changes: 11 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
import java.util.Properties

plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
id("kotlin-kapt")
}

val localProperties = Properties()
localProperties.load(project.rootProject.file("local.properties").inputStream())
val naverMapClientId = localProperties.getProperty("NAVER_MAP_CLIENT_ID")?:""
val naverMapClientSECRET = localProperties.getProperty("NAVER_MAP_CLIENT_SECRET")?:""

android {
namespace = "com.whidy.whidyandroid"
compileSdk = 35
Expand All @@ -16,6 +23,9 @@ android {
versionName = "1.0"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"

buildConfigField("String", "NAVER_MAP_CLIENT_ID", "\"$naverMapClientId\"")
buildConfigField("String", "NAVER_MAP_CLIENT_SECRET", "\"$naverMapClientSECRET\"")
}

buildTypes {
Expand Down Expand Up @@ -50,6 +60,7 @@ dependencies {
implementation(libs.androidx.constraintlayout)
implementation(libs.androidx.navigation.fragment.ktx)
implementation(libs.androidx.navigation.ui.ktx)
implementation(libs.navermap)
testImplementation(libs.junit)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)
Expand Down
1 change: 1 addition & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
xmlns:tools="http://schemas.android.com/tools">

<application
android:name=".WhidyApplication"
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
Expand Down
12 changes: 12 additions & 0 deletions app/src/main/java/com/whidy/whidyandroid/WhidyApplication.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.whidy.whidyandroid

import android.app.Application
import com.naver.maps.map.NaverMapSdk

class WhidyApplication : Application() {
override fun onCreate() {
super.onCreate()
NaverMapSdk.getInstance(this).client =
NaverMapSdk.NaverCloudPlatformClient(BuildConfig.NAVER_MAP_CLIENT_ID)
}
}
6 changes: 6 additions & 0 deletions app/src/main/res/layout/fragment_map.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,10 @@
android:layout_width="match_parent"
android:layout_height="match_parent">

<androidx.fragment.app.FragmentContainerView
android:id="@+id/map_fragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:name="com.naver.maps.map.MapFragment" />

</androidx.constraintlayout.widget.ConstraintLayout>
2 changes: 2 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ constraintlayout = "2.2.0"
navigationFragmentKtx = "2.8.5"
navigationUiKtx = "2.8.5"
timber = "5.0.1"
navermap = "3.20.0"

[libraries]
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
Expand All @@ -25,6 +26,7 @@ androidx-constraintlayout = { group = "androidx.constraintlayout", name = "const
androidx-navigation-fragment-ktx = { group = "androidx.navigation", name = "navigation-fragment-ktx", version.ref = "navigationFragmentKtx" }
androidx-navigation-ui-ktx = { group = "androidx.navigation", name = "navigation-ui-ktx", version.ref = "navigationUiKtx" }
timber = { group = "com.jakewharton.timber", name = "timber", version.ref = "timber" }
navermap = { group = "com.naver.maps", name = "map-sdk", version.ref = "navermap" }

[plugins]
android-application = { id = "com.android.application", version.ref = "agp" }
Expand Down
1 change: 1 addition & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ dependencyResolutionManagement {
repositories {
google()
mavenCentral()
maven("https://repository.map.naver.com/archive/maven")
}
}

Expand Down

0 comments on commit ebaf314

Please sign in to comment.