Repository navigation
Conversation
…sting, and modular architecture
…trictions, robolectric looper, and modularity case study
…loud before building or deploying
…mmendation to android-maps-sdk
…rship, and gcloud apiTargets precondition
No region tags are edited in this PR.This comment is generated by snippet-bot.
|
|
@kikoso @LoyalAbbas - Ready for review! Only one approval is needed. |
|
|
||
| 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. |
There was a problem hiding this comment.
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`). |
There was a problem hiding this comment.
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+`). |
There was a problem hiding this comment.
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") |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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` | |
There was a problem hiding this comment.
nit: there is no MarkerCloseOnClickDemoActivity, I think this one is MarkerCloseInfoWindowOnRetapDemoActivity.
| | `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), |
There was a problem hiding this comment.
nit: creating MarkerState directly in composition recreates it on every recomposition. Let's use rememberUpdatedMarkerState (and update the import):
| 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)"] |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
nit: MyItem is a data class, so equals and hashCode are already generated. We can drop the manual overrides and keep the example shorter.
|
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? |
Adds the
android-maps-sdkdeveloper skill in.gemini/skills/android-maps-sdk/for pair programming on Google Maps Android apps.It covers:
android-maps-robolectric).gcloud(verifying package name, debug SHA-1, and enabled APIs before building).android-maps-utilsfor clustering, GeoJSON parsing, and distance calculations.AssetManagerinstead ofClassLoaderfor assets, and avoiding duplicate marker rendering when clustering).