Skip to content

Commit a190fff

Browse files
committed
docs: add AI integration standards
1 parent 0990679 commit a190fff

5 files changed

Lines changed: 96 additions & 0 deletions

File tree

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name: android-samples
3+
description: Guide for understanding and using the Google Maps SDK for Android Samples repository. Use when users want to learn how to implement Maps SDK features, find examples, or create a new sample.
4+
---
5+
6+
# Google Maps SDK for Android Samples
7+
8+
You are an expert Android developer specializing in the Google Maps SDK for Android. This repository contains various samples demonstrating how to use the SDK.
9+
10+
## Repository Structure
11+
12+
1. **ApiDemos**: A collection of small demos showing most features of the Maps SDK for Android (e.g., markers, polygons, camera movement, location).
13+
2. **FireMarkers**: Demonstrates using Firebase Realtime Database with the Maps SDK.
14+
3. **WearOS**: Demonstrates a basic map on a Wear OS device.
15+
4. **tutorials**: Samples associated with tutorials in the developer's guide.
16+
5. **snippets**: Snippets for code found in the official documentation.
17+
18+
## Running the Samples
19+
20+
To run the samples, the user needs:
21+
- A Google Maps API key added to `local.properties`: `MAPS_API_KEY=YOUR_API_KEY`
22+
- The Secrets Gradle Plugin for Android is used to inject the API key.
23+
24+
## Creating a New Sample
25+
When creating a new sample or modifying an existing one:
26+
1. Ensure the code is written in Kotlin.
27+
2. Follow modern Android development practices.
28+
3. Use the Secrets Gradle plugin for API key management.
29+
4. If adding a completely new feature demonstration, consider adding it to `ApiDemos`.
30+
31+
## AI Guidelines
32+
Always refer to `.geminiignore` to avoid indexing large media assets or build directories.

.geminiignore

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Ignore build and generated directories
2+
build/
3+
**/build/
4+
.gradle/
5+
.idea/
6+
.kotlin/
7+
.vscode/
8+
9+
# Ignore outputs
10+
*.apk
11+
*.ap_
12+
*.aab
13+
*.dex
14+
*.class
15+
16+
# Ignore large media assets (images, fonts, etc) unless specifically required
17+
**/*.png
18+
**/*.jpg
19+
**/*.jpeg
20+
**/*.gif
21+
**/*.webp
22+
**/*.svg
23+
**/*.mp4
24+
**/*.mp3
25+
**/*.wav
26+
**/*.ttf
27+
**/*.woff
28+
**/*.woff2
29+
**/*.otf
30+
31+
# Ignore temporary and cache files
32+
tmp/
33+
**/tmp/
34+
*.log
35+
*.tmp
36+
*.bak
37+
*.swp
38+
*~.nib
39+
local.properties
40+
.DS_Store

CONTRIBUTING.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,9 @@ Please fill out either the individual or corporate Contributor License Agreement
1818
Follow either of the two links above to access the appropriate CLA and
1919
instructions for how to sign and return it. Once we receive it, we'll be able to
2020
accept your pull requests.
21+
22+
## Using AI to Contribute
23+
24+
This repository provides an official Gemini Skill to help AI agents navigate and contribute to the project effectively. If you are using an AI agent like the `gemini-cli`, you can invoke the skill located in `.gemini/skills/android-samples` to learn how to interact with the codebase.
25+
26+
Additionally, the `.geminiignore` file prevents AI tools from consuming large or irrelevant files to preserve context limits. You can also reference the generic `llm-integration-prompt.md` to feed into web-based LLMs for general assistance.

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ under [releases](https://github.com/googlemaps/android-samples/releases).
6868

6969
Contributions are welcome and encouraged! If you'd like to contribute, send us a [pull request] and refer to our [code of conduct] and [contributing guide].
7070

71+
### Using AI
72+
This repository provides an official Gemini Skill and an `llm-integration-prompt.md` to help AI agents navigate the codebase and provide assistance. Refer to the [contributing guide] for more details on AI usage.
73+
74+
7175
## Terms of Service
7276

7377
This sample uses Google Maps Platform services. Use of Google Maps Platform services through this sample is subject to the Google Maps Platform [Terms of Service].

llm-integration-prompt.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Google Maps SDK for Android Samples - AI Integration Prompt
2+
3+
You are an expert Android developer. Your task is to reference the Google Maps SDK for Android samples to implement Maps functionality.
4+
5+
## Core Concepts to Reference
6+
- **Setup**: Always use the Secrets Gradle Plugin to inject `MAPS_API_KEY` from `local.properties`.
7+
- **ApiDemos**: Look at the `ApiDemos` directory for concise examples of markers, map styles, camera controls, and overlays.
8+
- **Snippets**: Refer to the `snippets` directory for raw, documentation-ready code blocks.
9+
10+
## Example Integration
11+
To integrate a basic map, follow the patterns shown in the `ApiDemos` project:
12+
1. Include `com.google.android.gms:play-services-maps` in dependencies.
13+
2. Setup the `SupportMapFragment` or `MapView`.
14+
3. Implement `OnMapReadyCallback`.

0 commit comments

Comments
 (0)