diff --git a/.gitignore b/.gitignore index b4ae271d..bc32f55c 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,5 @@ local.properties .project project.properties secure.properties +secrets.properties .DS_Store diff --git a/README.md b/README.md index 4003d394..b0a4f427 100644 --- a/README.md +++ b/README.md @@ -16,12 +16,11 @@ It enables you to write more concise, idiomatic Kotlin. Each set of extensions c ## Requirements * Kotlin-enabled project * Kotlin coroutines -* API level 15+ +* API level 21+ +* An [API key](https://developers.google.com/maps/documentation/android-sdk/get-api-key) ## Installation -If you are using the Maps SDK through Google Play Services: - ```groovy dependencies { @@ -33,8 +32,6 @@ dependencies { } ``` -_**Note**_: The Beta version of the SDK is deprecated and scheduled for decommissioning. A future version of the SDK will provide similar support for Beta features. See the [release notes](https://developers.google.com/maps/documentation/android-sdk/releases#2021-08-18) for more information. - ## Example Usage With this KTX library, you should be able to take advantage of several Kotlin language features such as extension functions, named parameters and default arguments, destructuring declarations, and coroutines. @@ -48,8 +45,8 @@ This repository includes a [demo app](app) that illustrates the use of this KTX To run the demo app, you'll have to: 1. [Get a Maps API key](https://developers.google.com/maps/documentation/android-sdk/get-api-key) -1. Create a file in the root directory called `secure.properties` (this file should *NOT* be under version control to protect your API key) -1. Add a single line to `secure.properties` that looks like `MAPS_API_KEY=YOUR_API_KEY`, where `YOUR_API_KEY` is the API key you obtained in the first step +1. Create a file in the root directory called `secrets.properties` (this file should *NOT* be under version control to protect your API key) +1. Add a single line to `secrets.properties` that looks like `MAPS_API_KEY=YOUR_API_KEY`, where `YOUR_API_KEY` is the API key you obtained in the first step 1. Build and run ### Maps SDK KTX diff --git a/app/build.gradle b/app/build.gradle index 0774f411..f7178231 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -49,28 +49,22 @@ android { namespace 'com.google.maps.android.ktx.demo' } -// [START maps_android_utils_ktx_install_snippet] dependencies { - // [START_EXCLUDE silent] implementation fileTree(dir: 'libs', include: ['*.jar']) implementation deps.kotlin implementation deps.androidx.appcompat implementation deps.androidx.coreKtx implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.2' implementation 'com.google.android.gms:play-services-maps:18.2.0' - // implementation 'com.google.maps.android:maps-ktx:4.0.0' implementation project(':maps-ktx') - // implementation project(':maps-utils-ktx') - // [END_EXCLUDE] - implementation 'com.google.maps.android:maps-utils-ktx:4.0.0' + implementation project(':maps-utils-ktx') } -// [END maps_android_utils_ktx_install_snippet] secrets { // To add your Maps API key to this project: - // 1. Create a file ./secure.properties + // 1. Create a file ./secrets.properties // 2. Add this line, where YOUR_API_KEY is your API key: // MAPS_API_KEY=YOUR_API_KEY - propertiesFileName 'secure.properties' - defaultPropertiesFileName 'secure.defaults.properties' + propertiesFileName 'secrets.properties' + defaultPropertiesFileName 'secrets.defaults.properties' } diff --git a/build.gradle b/build.gradle index e1438cc1..be11ab4a 100644 --- a/build.gradle +++ b/build.gradle @@ -35,7 +35,7 @@ buildscript { 'kotlinxCoroutines': '1.6.0', 'mockito' : '3.0.0', 'mockitoKotlin' : '2.2.0', - 'playServices' : '18.1.0', + 'androidMapsSdk' : '18.2.0', 'volley' : '1.2.0', ] @@ -53,11 +53,10 @@ buildscript { 'junit' : "junit:junit:$versions.junit", 'kotlin' : "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$versions.kotlin", 'kotlinxCoroutines': "org.jetbrains.kotlinx:kotlinx-coroutines-android:$versions.kotlinxCoroutines", - 'mapsBeta' : "com.google.android.libraries.maps:maps:$versions.mapsBeta", 'mockito' : "org.mockito:mockito-core:$versions.mockito", 'mockitoKotlin' : "com.nhaarman.mockitokotlin2:mockito-kotlin:$versions.mockitoKotlin", 'playServices' : [ - 'maps' : "com.google.android.gms:play-services-maps:$versions.playServices", + 'maps' : "com.google.android.gms:play-services-maps:$versions.androidMapsSdk", ], 'volley' : "com.android.volley:volley:$versions.volley", ] diff --git a/maps-utils-ktx/build.gradle b/maps-utils-ktx/build.gradle index a1cae504..51ef8178 100644 --- a/maps-utils-ktx/build.gradle +++ b/maps-utils-ktx/build.gradle @@ -51,7 +51,6 @@ android { dependencies { implementation deps.kotlin api deps.androidMapsUtils.gms - api deps.playServices.maps // Tests testImplementation deps.androidx.test diff --git a/secure.defaults.properties b/secrets.defaults.properties similarity index 100% rename from secure.defaults.properties rename to secrets.defaults.properties