You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
How to run
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 /app directory. Read more in the Firebase documentation and the Android-specific setup guide.
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
✨📱☁️ Hybrid Inference: A sample demonstrating a hybrid approach to generative AI, utilizing both on-device (Gemini Nano via ML Kit) and cloud-based (Gemini via Firebase AI SDK) models. It showcases how to fallback to the cloud when on-device capabilities are unavailable.
✨🖼️🍌 Gemini Image Chat: A chatbot app using the new Gemini 3 Pro Image model (a.k.a. "Nano Banana Pro") 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.
✨🗣️ 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.
✨📸 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.
🖼️🍌 Nanobanana: A sample using Gemini 3.1 Flash Image model (a.k.a. "Nano Banana") to generate images of landscapes, objects and people in various artistic style.
✨🎥 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.
You can report issues with the samples 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.