Skip to content

android/ai-samples

Repository files navigation

Android AI Sample Catalog

Android AI Sample Catalog screenshots

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

  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 and the Android-specific setup guide.
  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 (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 sample βœ¨πŸ—£οΈ 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 sample βœ¨πŸ“Έ 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

Gemini Nano summarization sample βœ¨πŸ“±πŸ“° On-device Summarization:
A sample letting you summarize text on-device using Gemini Nano via the GenAI Summarization API.



> Browse code

Gemini Nano Image description βœ¨πŸ“±πŸ” On-device Image Description:
A sample letting you generate image descriptions using Gemini Nano via the GenAI Image Description API.



> Browse code

Gemini Nano Rewrite βœ¨πŸ“±πŸ–‹οΈ On-device Writing Assistance:
A sample letting you proofread and rewrite text using Gemini Nano via the GenAI Rewriting API.



> Browse code

Imagen sample πŸ–ΌοΈ Image Generation with Imagen:
A sample using Imagen to generate images of landscapes, objects and people in various artistic style.



> Browse code

Magic Selfie sample πŸ–ΌοΈπŸ“Έ 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 sample ✨πŸŽ₯ Gemini Video Summarization:
A sample using Gemini Flash to summarize videos leveraging the large file support.



> Browse code

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 to the model context for inference.



> Browse code

Gemini Live Todo sample βœ¨πŸ—£οΈ 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 sample πŸ–ΌοΈπŸ–ŒοΈ Imagen Editing:
A sample using Imagen to generate images and editing images using the mask based editing capabilities of the model.



> Browse code

Reporting issues

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.

Releases

No releases published

Packages

No packages published

Languages