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
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).
π§ Work-in-Progress: we are working on bringing more samples into the application.
- Clone the repository
- Open the whole project in Android Studio.
- Set up a Firebase project and connect your app to Firebase by adding your Firebase configuration
file (
google-services.json) to the/appdirectory. Read more in the Firebase documentation and the Android-specific setup guide. - Sync & Run
appconfiguration
The app will open with the samples list screen that allows you to navigate throughout the different available samples.
Here is the list of samples you can find in the /samples folder:
| Samples | |
|---|---|
| β¨πΌοΈπ Gemini Image Chat: A chatbot app using the new Gemini 2.5 Flash Image model (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 |
|
| β¨π£οΈ Gemini Chatbot: A chatbot app using the Gemini Flash model. You can tweak the system instructions in the model configuration to change the tone or the persona of the model. > Browse code |
|
| β¨πΈ Gemini Multimodal: A sample leveraging the multimodal capabilities of the Gemini Flash model (in this case text and image-to-text) to let you prompt the model with an image. > Browse code |
|
| β¨π±π° On-device Summarization: A sample letting you summarize text on-device using Gemini Nano via the GenAI Summarization API. > Browse code |
|
| β¨π±π On-device Image Description: A sample letting you generate image descriptions using Gemini Nano via the GenAI Image Description API. > Browse code |
|
| β¨π±ποΈ On-device Writing Assistance: A sample letting you proofread and rewrite text using Gemini Nano via the GenAI Rewriting API. > Browse code |
|
| πΌοΈ Image Generation with Imagen: A sample using Imagen to generate images of landscapes, objects and people in various artistic style. > Browse code |
|
| πΌοΈπΈ Magic Selfie: A sample using ML Kit subject Segmentation SDK to remove the background behind a person, and Imagen to generate new background. > Browse code |
|
| β¨π₯ Gemini Video Summarization: A sample using Gemini Flash to summarize videos leveraging the large file support. > Browse code |
|
| β¨π₯ 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 to the model context for inference. > Browse code |
|
| β¨π£οΈ Gemini Live Todo App: A Todo List app using the Gemini Live API to let the user interact with Gemini Live via voice to update the todo list. > Browse code |
|
| πΌοΈποΈ Imagen Editing: A sample using Imagen to generate images and editing images using the mask based editing capabilities of the model. > Browse code |
You can report issues with the samples using this repository. When doing so, make sure to specify which sample you are referring to.
We aren't open to contribution to this project at the moment.
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.