# ai-samples **Repository Path**: mirrors_android/ai-samples ## Basic Information - **Project Name**: ai-samples - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-10-02 - **Last Updated**: 2025-11-08 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Android AI Sample Catalog ![Android AI Sample Catalog screenshots](https://developer.android.com/static/ai/assets/images/ai_catalog_screenshot_1440.png) This folder contains the Android AI Sample catalog, a stand alone application giving you access to individual self-contained samples illustrating some of the Generative AI capabilities unlocked by some of Google's models. > **Note:** These samples are intended to showcase specific AI capabilities in isolation, and they may use > simplified code. They are demo not intended to be used as production-ready code. > For best practices follow our documentation and check > [Now In Android](https://github.com/android/nowinandroid) > **Requires Firebase setup** the samples relying on Google Cloud models (Gemini Pro, Gemini Flash, etc...) > require setting up a Firebase project and connecting the app to Firebase (read more [here](https://firebase.google.com/docs/ai-logic/get-started?platform=android&api=dev#set-up-firebase)). > 🚧 **Work-in-Progress:** we are working on bringing more samples into the application. ## How to run 1. Clone the repository 2. Open the whole project in Android Studio. 3. Set up a Firebase project and connect your app to Firebase by adding your Firebase configuration file (`google-services.json`) to the `/app` directory. Read more in the [Firebase documentation](https://firebase.google.com/docs/ai-logic/get-started?platform=android&api=dev#set-up-firebase) and the [Android-specific setup guide](https://firebase.google.com/docs/android/learn-more?authuser=0#google-services-plugin-and-file). 4. Sync & Run `app` configuration The app will open with the samples list screen that allows you to navigate throughout the different available samples. ## Samples Here is the list of samples you can find in the `/samples` folder: | Samples | | |:----------------------------------------------------------------------------------------------------------------------------------|-----------| | Gemini Image Chat sample | ✨🖼️🍌 **Gemini Image Chat**:
A chatbot app using the new [Gemini 2.5 Flash Image model](https://developers.googleblog.com/en/introducing-gemini-2-5-flash-image/) (a.k.a. "NanoBanana") enabling image generation and iterations via conversation with the Gemini model. Ask the model to generate an image and ask for tweaks in the chat.



**[> Browse code](samples/gemini-image-chat)**

| | | | | Gemini Chatbot sample | ✨🗣️ **Gemini Chatbot**:
A chatbot app using the Gemini Flash model. You can tweak the [system instructions](https://firebase.google.com/docs/ai-logic/system-instructions) in the model configuration to change the tone or the persona of the model.



**[> Browse code](samples/gemini-chatbot)**

| | | | | Gemini Multimodal sample | ✨📸 **Gemini Multimodal**:
A sample leveraging the [multimodal capabilities](https://developer.android.com/ai/gemini/developer-api#generate-text-from-media) of the Gemini Flash model (in this case text and image-to-text) to let you prompt the model with an image.



**[> Browse code](samples/gemini-multimodal)**

| | | | | Gemini Nano summarization sample | ✨📱📰 **On-device Summarization**:
A sample letting you summarize text on-device using Gemini Nano via the [GenAI Summarization API](https://developers.google.com/ml-kit/genai/summarization/android).



**[> Browse code](samples/genai-summarization)**

| | | | | Gemini Nano Image description | ✨📱🔍 **On-device Image Description**:
A sample letting you generate image descriptions using Gemini Nano via the [GenAI Image Description API](https://developers.google.com/ml-kit/genai/image-description/android).



**[> Browse code](samples/genai-image-description)**

| | | | | Gemini Nano Rewrite | ✨📱🖋️ **On-device Writing Assistance**:
A sample letting you proofread and rewrite text using Gemini Nano via the [GenAI Rewriting API](https://developers.google.com/ml-kit/genai/rewriting/android).



**[> Browse code](samples/genai-writing-assistance)**

| | | | | Imagen sample | 🖼️ **Image Generation with Imagen**:
A sample using [Imagen to generate images](https://developer.android.com/ai/imagen#generate-image) of landscapes, objects and people in various artistic style.



**[> Browse code](samples/imagen)**

| | | | | Magic Selfie sample | 🖼️📸 **Magic Selfie**:
A sample using [ML Kit subject Segmentation SDK](https://developers.google.com/ml-kit/vision/subject-segmentation/android) to remove the background behind a person, and [Imagen](https://developer.android.com/ai/imagen#generate-image) to generate new background.



**[> Browse code](samples/magic-selfie)**

| | | | | Gemini Video Summarization sample | ✨🎥 **Gemini Video Summarization**:
A sample using Gemini Flash to [summarize videos](https://firebase.google.com/docs/ai-logic/analyze-video?api=dev) leveraging the [large file support](https://firebase.google.com/docs/ai-logic/solutions/cloud-storage).



**[> Browse code](samples/gemini-video-summarization)**

| | | | | Gemini Video Metadata sample | ✨🎥 **Gemini Video Metadata Creation**:
A sample using Gemini Flash to generate thumbnails, descriptions, hashtags, account tags, chapters and links from a video. This sample leverages the ability to provide a [Youtube video link](https://firebase.google.com/docs/ai-logic/input-file-requirements?api=dev#provide-file-using-url) to the model context for inference.



**[> Browse code](samples/gemini-video-metadata-creation)**

| | | | | Gemini Live Todo sample | ✨🗣️ **Gemini Live Todo App**:
A Todo List app using the [Gemini Live API](https://developer.android.com/ai/gemini/live) to let the user interact with Gemini Live via voice to update the todo list.



**[> Browse code](samples/gemini-live-todo)**

| | | | | Imagen Editing sample | 🖼️🖌️ **Imagen Editing**:
A sample using Imagen to [generate images](https://developer.android.com/ai/imagen#generate-image) and [editing images](https://developer.android.com/ai/imagen#editing) using the mask based editing capabilities of the model.



**[> Browse code](samples/imagen-editing)**

| ## Reporting issues You can report [issues with the samples](https://github.com/android/ai-samples/issues) using this repository. When doing so, make sure to specify which sample you are referring to. ## Contributions We aren't open to contribution to this project at the moment. ## License ``` Copyright 2023 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ```