This Android sample app demonstrates how to use state-of-the-art generative AI models (like Gemini) to build AI-powered features and applications.
For more information about Firebase AI Logic, visit the documentation.
- Google AI (Gemini) API Key: Most samples work out of the box with the Google AI SDK.
- Vertex AI: Samples marked with (Vertex AI) require you to enable the Vertex AI API in your Google Cloud project and have your files in Cloud Storage.
- Server Prompt Templates: These samples require you to set up templates in the Firebase Console.
To try out this sample app, you need to use latest stable version of Android Studio.
- Set up your Android app for Firebase
- Use the package name
com.google.firebase.quickstart.ai
- Use the package name
- Set up Firebase AI Logic
- Run the app on an Android device or emulator.
You can find the implementation for each feature by clicking on the links below:
- Travel tips: The user wants the model to help a new traveler with travel tips
- Chatbot recommendations for courses: A chatbot suggests courses for a performing arts program.
- Weather Chat: Use function calling to get the weather conditions for a specific US city on a specific date.
- Grounding with Google Search: Use Grounding with Google Search to get responses based on up-to-date information from the web.
- Thinking: Gemini 2.5 Flash with dynamic thinking
- Server Prompt Templates - Gemini: Generate an invoice using server prompt templates.
- Imagen 4 - image generation: Generate images using Imagen 4
- Imagen 3 - Inpainting (Vertex AI): Replace part of an image using Imagen 3
- Imagen 3 - Outpainting (Vertex AI): Expand an image by drawing in more background
- Imagen 3 - Subject Reference (Vertex AI): Generate an image using a referenced subject (must be an animal)
- Imagen 3 - Style Transfer (Vertex AI): Change the art style of a cat picture using a reference
- Gemini 2.5 Flash Image (aka nanobanana): Generate and/or edit images using Gemini 2.5 Flash Image aka nanobanana
- Server Prompt Template - Imagen: Generate an image using a server prompt template.
- SVG Generator: Use Gemini 3 Flash preview to create SVG illustrations
- Blog post creator (Vertex AI): Create a blog post from an image file stored in Cloud Storage.
- Audio Summarization: Summarize an audio file
- Translation from audio (Vertex AI): Translate an audio file stored in Cloud Storage
- Hashtags for a video (Vertex AI): Generate hashtags for a video ad stored in Cloud Storage
- Summarize video: Summarize a video and extract important dialogue.
- ForecastTalk: Use bidirectional streaming to get information about weather conditions
- Gemini Live (Video input): Use bidirectional streaming to chat with Gemini using your phone's camera
- Document comparison (Vertex AI): Compare the contents of 2 documents in Cloud Storage.
The full list of available samples can be found in the FirebaseAISamples.kt file.