Android용 Maps SDK 유틸리티 설정
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
이 페이지에서는 Android용 Maps SDK 유틸리티
라이브러리를 설정하고
라이브러리에 포함된 데모 앱을 실행하는 방법을 설명합니다.
사전 요구사항 및 참고 사항
Android용 Maps SDK 유틸리티 라이브러리는
Android API 수준
15 이상을 지원합니다. 프로젝트 빌드 대상을 설정할 때 최신
Android API 수준을 사용하세요.
GitHub에서
참조
문서를 볼 수 있습니다.
1단계: Android용 Maps SDK 유틸리티 라이브러리 설치
앱의 build.gradle
파일에 다음 종속 항목을 추가합니다.
dependencies {
// Utility Library for Maps SDK for Android
// You do not need to add a separate dependency for the Maps SDK for Android
// since this library builds in the compatible version of the Maps SDK.
implementation 'com.google.maps.android:android-maps-utils:3.8.0'
}
라이브러리에서
마커 클러스터링,
히트맵
또는 기타
유틸리티 등
유틸리티 중 하나를 사용하세요.
2단계: (선택사항) Android용 Maps SDK 유틸리티 KTX 라이브러리 설치
Android용 Maps SDK 유틸리티 라이브러리는 해당 Kotlin 확장 프로그램(KTX) 라이브러리와
함께 제공됩니다. 이 라이브러리에서는 확장 프로그램 기능, 이름이 지정된 기본 인수 등과 같은
Kotlin 언어 기능을 제공하여 간결하고 자연스러운 Kotlin을 작성할 수 있습니다. Kotlin에서 개발하지 않는 경우
이 단계를 건너뛸 수 있습니다.
이 라이브러리를
사용하려면 android-maps-utils
종속 항목 외에 다음 종속 항목을 앱의 build.gradle
파일에 추가하세요.
dependencies {
// KTX for the Maps SDK for Android Utility Library
implementation 'com.google.maps.android:maps-utils-ktx:5.1.1'
}
이 라이브러리에 대한 추가 정보는
Maps KTX GitHub 페이지를 확인하세요.
3단계: Android용 Maps SDK 유틸리티 라이브러리 소스 코드 보기
유틸리티 라이브러리는 오픈소스이므로
android-maps-utils
라이브러리를 다운로드하여 라이브러리를 맞춤설정하고 데모 앱을 보거나 라이브러리 작동 방식을
파악할 수 있습니다. 저장소를
클론(권장됨, 자동 업데이트 수신)하거나
zip 파일을
다운로드하면
됩니다. 라이브러리를 맞춤설정하려면
저장소를 포크해야 합니다.
저장소는 다음 항목을 포함합니다.
demo
디렉터리에 있는 데모 애플리케이션
library
디렉터리에 있는 유틸리티 라이브러리
- 라이선스, 참여자, 리드미를 포함한 다양한 파일
- Android 스튜디오에서 사용할 Gradle 빌드 구성
유틸리티 데모 앱 실행
유틸리티 라이브러리용 GitHub 저장소에는 각 유틸리티의
샘플 구현이 포함된 데모 앱이 함께 제공됩니다. 다음 단계에 따라 Android 기기에서
데모 앱을 실행합니다.
- 위에서 언급한 옵션 중 하나를 사용하여 저장소를 다운로드합니다.
- Android 스튜디오에서 File(파일) > New(새 파일) > Import Project(프로젝트 가져오기)를 선택합니다.
- 유틸리티 라이브러리를 클론했을 때
생성된 android-maps-utils 디렉터리를 찾아
선택(더블클릭)합니다. Android 스튜디오에서 이제 프로젝트를 빌드합니다.
- 에뮬레이터 대신 Android 기기를 사용하는 경우
개발자 모드를 사용 설정해야 합니다.
그런 다음 Android 기기를 컴퓨터에 연결합니다.
local.properties
에 다음과 같이 한 줄을 추가합니다.
MAPS_API_KEY=YOUR_API_KEY
여기서 YOUR_API_KEY는 API 키 사용에 설명된 대로 가져온 API 키입니다.
- 데모 앱 빌드 및 실행
Android 기기에서 앱이 열리고 클러스터링, poyutil, 히트맵
등의 유틸리티가 목록으로 표시됩니다. 지도 유틸리티 데모 이름 아래의 앱 목록에 있는
앱을 찾을 수도 있습니다.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2024-08-13(UTC)
[null,null,["최종 업데이트: 2024-08-13(UTC)"],[[["\u003cp\u003eThis page explains how to set up the Maps SDK for Android utility library and run its demo app, allowing you to utilize features like marker clustering and heatmaps.\u003c/p\u003e\n"],["\u003cp\u003eThe library supports Android API level 15 and above, requiring you to add a specific dependency to your app's \u003ccode\u003ebuild.gradle.kts\u003c/code\u003e file for implementation.\u003c/p\u003e\n"],["\u003cp\u003eAn optional Kotlin extensions (KTX) library provides Kotlin-specific features for more concise coding if you are developing in Kotlin.\u003c/p\u003e\n"],["\u003cp\u003eThe open-source nature of the library allows for customization by cloning or downloading the \u003ccode\u003eandroid-maps-utils\u003c/code\u003e repository from GitHub.\u003c/p\u003e\n"],["\u003cp\u003eYou can explore the functionalities of the library by running the demo app included in the repository, requiring steps like adding your API key and building the project in Android Studio.\u003c/p\u003e\n"]]],["To set up the Maps SDK for Android utility library, add the `android-maps-utils` dependency to your `build.gradle.kts` file. Optionally, include the `maps-utils-ktx` dependency for Kotlin features. The library, which supports Android API level 15 and above, is open-source and can be downloaded from GitHub. To run the included demo app, clone the repository, import the project into Android Studio, enable developer mode on your Android device, add your API key to `local.properties`, and then build and run the app.\n"],null,["Select platform: [Android](/maps/documentation/android-sdk/utility/setup \"View this page for the Android platform docs.\") [iOS](/maps/documentation/ios-sdk/utility/setup \"View this page for the iOS platform docs.\")\n\nThis page describes how to set up the\n[Maps SDK for Android\nutility library](https://github.com/googlemaps/android-maps-utils), and to run the demo app included in the library.\n\nPrerequisites and notes\n\nThe Maps SDK for Android utility library supports Android\n[API\nlevel](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) 15 and above. When setting your project build target, make sure you use the latest\nAndroid API level.\n\nThe\n[reference\ndocumentation](http://googlemaps.github.io/android-maps-utils/javadoc/) is available on GitHub.\n\nStep 1. Install the Maps SDK for Android utility library\n\nAdd the following dependency to your app's `build.gradle.kts` file: \n\n```carbon\ndependencies {\n\n\n // Utility Library for Maps SDK for Android\n // You do not need to add a separate dependency for the Maps SDK for Android\n // since this library builds in the compatible version of the Maps SDK.\n implementation(\"com.google.maps.android:android-maps-utils:3.14.0\")\n}\n```\n\nUse one of the utilities from the library, such as\n[marker\nclustering](/maps/documentation/android-sdk/utility/marker-clustering),\n[heatmaps](/maps/documentation/android-sdk/utility/heatmap), or\nthe [other\nutilities](/maps/documentation/android-sdk/utility).\n\nStep 2. (Optional) Install the Maps SDK for Android utility KTX library\n\nThe Maps SDK for Android utility library comes with a corresponding Kotlin extensions\n(KTX) library. This library provides Kotlin language features---such as extension functions, named\nand default arguments---to enable you to write concise and idiomatic Kotlin. If you are not\ndeveloping in Kotlin, you can skip this step.\n\nTo use this library, add the following dependency, in addition to the\n`android-maps-utils` dependency, to your app's `build.gradle.kts` file: \n\n```carbon\ndependencies {\n\n // KTX for the Maps SDK for Android Utility Library\n implementation(\"com.google.maps.android:maps-utils-ktx:5.2.0\")\n}\n```\n\nCheck out the [Maps KTX GitHub](https://github.com/googlemaps/android-maps-ktx) page\nfor additional information about this library.\n\nStep 3. View the Maps SDK for Android utility library source code\n\nSince the utility library is open source, you can download the\n[android-maps-utils](https://github.com/googlemaps/android-maps-utils)\nlibrary to your machine to customize it, view the demo app, or if you just want to understand how\nthe library works. You can do so by\n[cloning](https://github.com/googlemaps/android-maps-utils.git) the repo (recommended,\nto receive automatic updates) or\n[downloading\na zip file](https://github.com/googlemaps/android-maps-utils/archive/master.zip). If you want to customize the library, you should\n[fork the repo](https://help.github.com/articles/fork-a-repo).\n\nThe repository includes:\n\n- A demo application, in the `demo` directory.\n- The library of utilities, in the `library` directory.\n- Various files containing license, contributors, and readme information.\n- Gradle build configuration, for use with Android Studio.\n\nRun the utility demo app\n\nThe GitHub repository for the utility library ships with a demo app that includes sample\nimplementations of each utility. Follow these steps to run the demo app on\nyour Android device.\n\n1. Download the repository using one of the options mentioned above.\n2. In Android Studio, choose **File -\\\u003e New -\\\u003e Import Project**.\n3. Browse to and select (double-click) the **android-maps-utils** directory that was created when you cloned the utility library. Android Studio now builds the project.\n4. If you are using an Android device instead of an emulator, make sure to [enable developer mode](https://developer.android.com/tools/device.html#setting-up). Then attach the Android device to your computer.\n5. Add a single line to `local.properties` that looks like this:\n\n ```scdoc\n MAPS_API_KEY=YOUR_API_KEY\n ```\n\n Where \u003cvar translate=\"no\"\u003eYOUR_API_KEY\u003c/var\u003e is the API key you obtained as described in\n [Using API Keys](/maps/documentation/android-sdk/get-api-key).\n6. Build and run the **demo** app.\n\nThe app should open on the Android device, displaying a list of utilities\nincluding clustering, poyutil, heatmap, and more. You can also find the app in\nyour app list, under the name **Maps Utils Demo**."]]