Skip to content

docs(skills): add android-maps-sdk skill - #2450

Draft
dkhawk wants to merge 11 commits into
mainfrom
feat/maps-sdk-skill
Draft

dkhawk wants to merge 11 commits into
mainfrom
feat/maps-sdk-skill

Conversation

@dkhawk

@dkhawk dkhawk commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Adds the android-maps-sdk developer skill in .gemini/skills/android-maps-sdk/ for pair programming on Google Maps Android apps.

It covers:

  • Setting up Google Maps with Compose and Views.
  • Writing headless JVM tests using Robolectric shadows (android-maps-robolectric).
  • Pre-flight API key checks via gcloud (verifying package name, debug SHA-1, and enabled APIs before building).
  • Integrating android-maps-utils for clustering, GeoJSON parsing, and distance calculations.
  • Practical patterns to avoid common pitfalls (such as using AssetManager instead of ClassLoader for assets, and avoiding duplicate marker rendering when clustering).
  • Reference guides and templates for camera controls, custom styling, Street View, and modular architecture.

@dkhawk dkhawk changed the title feat(skills): introduce android-maps-sdk skill with TDD, pre-flight audits, and utility synergy docs(skills): add android-maps-sdk skill Oct 8, 2026
@dkhawk
dkhawk marked this pull request as ready for review October 8, 2026 19:45
@snippet-bot

snippet-bot Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

No region tags are edited in this PR.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@dkhawk
dkhawk requested review from LoyalAbbas and kikoso October 8, 2026 19:46
@dkhawk

dkhawk commented Oct 8, 2026

Copy link
Copy Markdown
Contributor Author

@kikoso @LoyalAbbas - Ready for review! Only one approval is needed.

@dkhawk
dkhawk marked this pull request as draft October 8, 2026 20:23

@kikoso kikoso left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you take a look at the comments, @dkhawk ? Thanks! Most of them are about local paths and internal references that slipped into the skill.


This skill operates in synergy with official Google Maps Platform Android engineering skills:

- [**`android-maps-compose`**](file:///usr/local/google/home/dkhawk/.gemini/config/skills/android-maps-compose/SKILL.md): Comprehensive guide for building declarative map experiences using Jetpack Compose (`com.google.maps.android:maps-compose`). Use whenever developers target Jetpack Compose or modern declarative UI.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The skill links point to file:///usr/local/google/home/dkhawk/..., so they will be broken for everybody else (same in the routing section below). Could we link to the skills in their repos instead, e.g. https://github.com/googlemaps/android-maps-compose/tree/main/.gemini/skills/android-maps-compose ? Some of them (artemis, android-autonomous-qa, android-monkey-testing) do not seem to be public, so we may want to drop those.

- **GCP Update Preconditions (`apiTargets` Preservation)**: When calling `gcloud services api-keys update`, all APIs with active traffic in the last 7 days (`maps-android-backend.googleapis.com`, `geocoding-backend.googleapis.com`, `places-backend.googleapis.com`, etc.) MUST be preserved and passed back as `--api-target=service=...` flags. Omitting them causes GCP to reject the update with `FAILED_PRECONDITION`.
- **Automated Fix via `gcloud`**: If verification fails, the agent must offer to fix it automatically using the `gcloud` CLI (using safe update scripts that preserve existing allowed applications and active `apiTargets`).
- **Fallback When `gcloud` Fails or is Missing**: If `gcloud` produces authentication errors (e.g., Context Aware Access block, expired credentials) or is missing:
1. Offer to fix it automatically once the user authenticates `gcloud` (`gcloud auth login` or `go/gcloud-caa-error`).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

go/gcloud-caa-error is an internal link, so it will not work for external developers. Should we remove it here and in secrets_and_security.md?


### 2. Photorealistic 3D Map Experiences → Point to `android-maps3d-samples`
If the user is interested in building a **3D map** (photorealistic 3D tiles, 3D meshes, 3D camera fly-tos, 3D polylines/polygons, or 3D model markers):
* **Recommendation**: Point the user directly to the **Google Maps 3D SDK for Android** (`com.google.android.gms:play-services-maps3d:0.2.0+`).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to understand it: is 0.2.0+ intentional? The 3D samples are already on play-services-maps3d 16.0.0.

```kotlin
dependencies {
// 1. Behavioral JVM Unit Tests (Robolectric Shadows & Truth Matchers)
testImplementation("com.google.android.maps.robolectric:shadows:1.1.0-rc01")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I may be missing something, but I cannot find com.google.android.maps.robolectric:shadows (nor the golden and visual artefacts) on Maven Central. If they are not published yet, an agent following this will end up with a build that does not resolve. Could we mark them as upcoming, or point to the repo setup instead?


---

### Step 3: Base Dependency Setup & API Key Security

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: this is the second Step 3, and the numbering does not match the diagram above (where dependencies are Step 4).

| `lite_demo` | Lite Mode Map | `GoogleMapOptions.liteMode(true)`, `MapView`, snapshot interaction | `LiteDemoActivity.java` | `LiteDemoActivity.kt` |
| `lite_list_demo` | Lite Maps in List | `RecyclerView`, `MapView` recycled in ViewHolders, `setMapLocation()` | `LiteListDemoActivity.java` | `LiteListDemoActivity.kt` |
| `location_source_demo` | Custom Location Source | `setLocationSource()`, `LocationSource.OnLocationChangedListener` | `LocationSourceDemoActivity.java` | `LocationSourceDemoActivity.kt` |
| `marker_close_on_click` | Marker Click Behavior | `setOnMarkerClickListener()`, consuming click events, popup handling | `MarkerCloseOnClickDemoActivity.java` | `MarkerCloseOnClickDemoActivity.kt` |

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: there is no MarkerCloseOnClickDemoActivity, I think this one is MarkerCloseInfoWindowOnRetapDemoActivity.

Suggested change
| `marker_close_on_click` | Marker Click Behavior | `setOnMarkerClickListener()`, consuming click events, popup handling | `MarkerCloseOnClickDemoActivity.java` | `MarkerCloseOnClickDemoActivity.kt` |
| `marker_close_on_click` | Marker Click Behavior | `setOnMarkerClickListener()`, consuming click events, popup handling | `MarkerCloseInfoWindowOnRetapDemoActivity.java` | `MarkerCloseInfoWindowOnRetapDemoActivity.kt` |

)
) {
Marker(
state = MarkerState(position = initialLocation),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: creating MarkerState directly in composition recreates it on every recomposition. Let's use rememberUpdatedMarkerState (and update the import):

Suggested change
state = MarkerState(position = initialLocation),
state = rememberUpdatedMarkerState(position = initialLocation),

Capture["1. Capture Map Screenshot"] --> Diff["2. Fast Local Pixel Diff (< tolerance)"]
Diff -->|Passed| Pass["Test PASSED (Zero Network / Zero Quota)"]
Diff -->|Failed| AI["3. Gemini Flash Multimodal Semantic Evaluation"]
AI -->|Valid Semantic Change| Approve["Test PASSED (Auto-Update Golden Baseline)"]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am thinking out loud if auto-updating the golden baseline when Gemini approves is a good idea. A regression the model misjudges would silently become the new baseline. Shouldn't we favour failing and asking for a manual update?


---

## 5. Case Study: Boulder Creek Fountains (< 130 Lines Per File)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Being this a public skill, the Boulder Creek Fountains case study is not in this repo, so agents cannot look at it. Do we have a link to the source, or should we remove the section?

override fun getSnippet(): String = snippet
override fun getZIndex(): Float? = null

// Ensure equals & hashCode are implemented for accurate item removal

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: MyItem is a data class, so equals and hashCode are already generated. We can drop the manual overrides and keep the example shorter.

@LoyalAbbas

Copy link
Copy Markdown
Contributor

Can we rename folder name .gemini to .agents so it's general-purpose and works nicely for any AI assistant or coding tool, not just Gemini?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants