Skip to content

Commit

Permalink
Merge pull request #9 from Rohitesh-Kumar-Jain/develop
Browse files Browse the repository at this point in the history
Clean up
  • Loading branch information
Rohitesh-Kumar-Jain authored Oct 19, 2022
2 parents 61cad7f + c1c90bd commit 9363748
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
5 changes: 1 addition & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
plugins {
id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin")
}

plugins {
id 'com.google.secrets_gradle_plugin'
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'kotlin-android-extensions'
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<meta-data
android:name = "keyValue"
android:value = "${KEY}"/>

</application>

</manifest>
Expand Down
9 changes: 8 additions & 1 deletion app/src/main/java/com/example/app/MainActivity.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.example.app

import android.annotation.SuppressLint
import android.content.pm.ApplicationInfo
import android.content.pm.PackageManager
import android.graphics.Point
import android.os.Bundle
import android.os.Handler
Expand Down Expand Up @@ -97,7 +99,12 @@ class MainActivity : AppCompatActivity() {
* You can get your own ArcGIS online API key from https://developers.arcgis.com/sign-up/
*/
private fun setApiKeyForApp() {
ArcGISRuntimeEnvironment.setApiKey("AAPK5ea618c24b1d43ca9672b8329c88adc1EKFW0i1WBQ6pD9DAHnOCR7zqJXuvk2UobY9YsrsAcu63hUutb4MaMpY51iszA7bP")
val ai: ApplicationInfo = applicationContext.packageManager
.getApplicationInfo(applicationContext.packageName, PackageManager.GET_META_DATA)
val value = ai.metaData["keyValue"]

val key = value.toString()
ArcGISRuntimeEnvironment.setApiKey(key)
}

/**
Expand Down

0 comments on commit 9363748

Please sign in to comment.