Skip to content

Commit b25aa0e

Browse files
committed
docs: update LLM guide with secrets plugin instructions
1 parent 978bf3f commit b25aa0e

1 file changed

Lines changed: 36 additions & 8 deletions

File tree

llm-integration-prompt.md

Lines changed: 36 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,36 @@ dependencies {
2222
}
2323
```
2424

25-
## 2. Update AndroidManifest.xml
25+
## 2. Setup the Secrets Gradle Plugin
2626

27-
Add the required permissions and the Google Maps API key meta-data to `AndroidManifest.xml`. Instruct the user to replace `YOUR_API_KEY` with their actual API key from the Google Cloud Console.
27+
Instead of hardcoding the Google Maps API key in `AndroidManifest.xml`, use the Secrets Gradle Plugin for Android to inject the API key securely.
28+
29+
First, add the plugin to the project-level `build.gradle.kts`:
30+
31+
```kotlin
32+
buildscript {
33+
dependencies {
34+
classpath("com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.1")
35+
}
36+
}
37+
```
38+
39+
Then, apply the plugin in the app-level `build.gradle.kts`:
40+
41+
```kotlin
42+
plugins {
43+
// ...
44+
id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin")
45+
}
46+
```
47+
48+
Add the API Key to `local.properties`:
49+
50+
```properties
51+
MAPS_API_KEY=YOUR_API_KEY
52+
```
53+
54+
In `AndroidManifest.xml`, add the required permissions and reference the injected API key meta-data:
2855

2956
```xml
3057
<manifest ...>
@@ -33,10 +60,10 @@ Add the required permissions and the Google Maps API key meta-data to `AndroidMa
3360
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
3461

3562
<application ...>
36-
<!-- Google Maps API Key -->
63+
<!-- Google Maps API Key injected by Secrets Gradle Plugin -->
3764
<meta-data
3865
android:name="com.google.android.geo.API_KEY"
39-
android:value="YOUR_API_KEY" />
66+
android:value="${MAPS_API_KEY}" />
4067
...
4168
</application>
4269
</manifest>
@@ -87,7 +114,8 @@ fun MapScreen() {
87114

88115
## 5. Execution Steps
89116
1. Create a new branch `feature/maps-compose-integration`.
90-
2. Add the dependencies to `build.gradle.kts`.
91-
3. Update `AndroidManifest.xml` with permissions and the API key placeholder.
92-
4. Create the `MapScreen.kt` composable.
93-
5. Provide a summary of the changes and instruct the user on how to add their API key.
117+
2. Add the Maps Compose dependencies to the app-level `build.gradle.kts`.
118+
3. Set up the Secrets Gradle Plugin in both project-level and app-level `build.gradle.kts`.
119+
4. Update `AndroidManifest.xml` with permissions and the `${MAPS_API_KEY}` placeholder.
120+
5. Create the `MapScreen.kt` composable.
121+
6. Provide a summary of the changes and instruct the user on how to add their API key to `local.properties`.

0 commit comments

Comments
 (0)