TAAFT
Free mode
100% free
Freemium
Free Trial
Prompts Deals

Android AI Sample Catalog

android / ai-samples

552 152 Language: Kotlin Updated: 2mo ago

README

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
<img src="samples/gemini-hybrid/gemini_hybrid.png" width="150" alt="Gemini Hybrid sample"> โœจ๐Ÿ“ฑโ˜๏ธ Hybrid Inference: <br>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.<br><br><br><br> > Browse code<br><br>
<img src="samples/gemini-image-chat/android_nano_banana.png" width="150" alt="Gemini Image Chat sample"> โœจ๐Ÿ–ผ๏ธ๐ŸŒ Gemini Image Chat:<br>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.<br><br><br><br> > Browse code<br><br>
<img src="samples/gemini-chatbot/gemini_chatbot.png" width="150" alt="Gemini Chatbot sample"> โœจ๐Ÿ—ฃ๏ธ Gemini Chatbot:<br>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.<br><br><br><br> > Browse code<br><br>
<img src="samples/gemini-multimodal/gemini_multimodal.png" width="150" alt="Gemini Multimodal sample"> โœจ๐Ÿ“ธ Gemini Multimodal:<br>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.<br><br><br><br> > Browse code<br><br>
<img src="samples/genai-summarization/nano_summarization.png" width="150" alt="Gemini Nano summarization sample"> โœจ๐Ÿ“ฑ๐Ÿ“ฐ On-device Summarization: <br>A sample letting you summarize text on-device using Gemini Nano via the GenAI Summarization API.<br><br><br><br> > Browse code<br><br>
<img src="samples/genai-image-description/nano_image_description.png" width="150" alt="Gemini Nano Image description"> โœจ๐Ÿ“ฑ๐Ÿ” On-device Image Description: <br>A sample letting you generate image descriptions using Gemini Nano via the GenAI Image Description API.<br><br><br><br> > Browse code<br><br>
<img src="samples/genai-writing-assistance/nano_rewrite.png" width="150" alt="Gemini Nano Rewrite"> โœจ๐Ÿ“ฑ๐Ÿ–‹๏ธ On-device Writing Assistance: <br>A sample letting you proofread and rewrite text using Gemini Nano via the GenAI Rewriting API.<br><br><br><br> > Browse code<br><br>
<img src="samples/imagen/imagen_image_generation.png" width="150" alt="Imagen sample"> ๐Ÿ–ผ๏ธ Image Generation with Imagen: <br>A sample using Imagen to generate images of landscapes, objects and people in various artistic style.<br><br><br><br> > Browse code<br><br>
<img src="samples/magic-selfie/magic_selfie.png" width="150" alt="Magic Selfie sample"> ๐Ÿ–ผ๏ธ๐Ÿ“ธ Magic Selfie: <br>A sample using ML Kit subject Segmentation SDK to remove the background behind a person, and Imagen to generate new background.<br><br><br><br> > Browse code<br><br>
<img src="samples/gemini-video-summarization/gemini_video_summarization.png" width="150" alt="Gemini Video Summarization sample"> โœจ๐ŸŽฅ Gemini Video Summarization: <br>A sample using Gemini Flash to summarize videos leveraging the large file support.<br><br><br><br> > Browse code<br><br>
<img src="samples/gemini-video-metadata-creation/gemini_video_metadata.png" width="150" alt="Gemini Video Metadata sample"> โœจ๐ŸŽฅ Gemini Video Metadata Creation: <br>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.<br><br><br><br> > Browse code<br><br>
<img src="samples/gemini-live-todo/gemini_live_todo.png" width="150" alt="Gemini Live API to-do sample"> โœจ๐Ÿ—ฃ๏ธ Gemini Live API To-do App: <br>A to-do list app using the Gemini Live API to let the user interact with Gemini via voice to update the todo list.<br><br><br><br> > Browse code<br><br>
<img src="samples/imagen-editing/imagen_editing.png" width="150" alt="Imagen Editing sample"> ๐Ÿ–ผ๏ธ๐Ÿ–Œ๏ธ Imagen Editing: <br>A sample using Imagen to generate images and editing images using the mask based editing capabilities of the model.<br><br><br><br> > Browse code<br><br>

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.
0 AIs selected
Clear selection
#
Name
Task