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:
- Translate text: Use Gemini 3.1 Flash-Lite to translate text
- SVG Generator: Use Gemini 3.5 Flash to create SVG illustrations
- Gemini 3.1 Flash Image (Nano Banana 2): Generate and/or edit images using Nano Banana 2
- Gemini 3 Pro Image (Nano Banana Pro): Generate and/or edit images using Nano Banana Pro
- Gemini 3.1 Flash Image (Nano Banana 2): Generate and/or edit images using Nano Banana 2
- Gemini 3 Pro Image (Nano Banana Pro): Generate and/or edit images using Nano Banana Pro
- Gemini 2.5 Flash Image (Nano Banana): Generate and/or edit images using Nano Banana
- Audio Summarization: Use Gemini 3.1 Flash Lite to summarize an audio file
- Summarize video: Summarize a video and extract important dialogue.
- Translation from audio (Vertex AI): Translate an audio file stored in Cloud Storage
- Blog post creator (Vertex AI): Create a blog post from an image file stored in Cloud Storage.
- Document comparison (Vertex AI): Compare the contents of 2 documents stored in Cloud Storage.
- Hashtags for a video (Vertex AI): Generate hashtags for a video ad stored in Cloud Storage
- Grounding with Google Search: Use Grounding with Google Search to get responses based on up-to-date information from the web.
- Manual function calling: Use function calling to get the weather conditions for a specific US city on a specific date.
- Automatic function calling: Use automatic function calling to get the weather conditions for a specific US city on a specific date.
- Gemini Live (audio input): Use bidirectional streaming to get information about weather conditions for a specific US city on a specific date
- Gemini Live (video input): Use bidirectional streaming to chat with Gemini using your phone's camera
- Gemini Live (audio input): Use bidirectional streaming to get information about weather conditions for a specific US city on a specific date
- Gemini Live (video input): Use bidirectional streaming to chat with Gemini using your phone's camera
- Server Prompt Templates - Gemini: Generate an invoice using server prompt templates.
- Hybrid Receipt Scanner: Use hybrid inference to scan receipts and extract expense data on-device whenever possible.
The full list of available samples can be found in the FirebaseAISamples.kt file.
