At Google I/O '24, we unveiled a vision of Android reimagined with AI at its core. Find the top 3 updates for building with AI on Android for Android developers in this video.
Choose the generative AI solution that's right for you
This document gives an overview of generative AI on Android, including available Gemini models and associated SDKs.
High performance on-device AI
On supported Android devices you can deliver rich generative AI experiences without needing a network connection or moving data off-device. On-device generative AI models such as Gemini Nano are great solutions for use-cases where low latency, low cost, and privacy safeguards are your primary concerns.
Use cases
- AI-enhanced content consumption: text summarization, document question answering, and entity extraction.
- AI-assisted content generation: proofreading, grammar correction, writing assistance, and contextual smart replies.
- Classifying text: sentiment or mood analysis
- Privacy: unlocks generative AI features while keeping data on-device
Solution
Use the Google AI Edge SDK to leverage Gemini Nano inference on-device. Gemini Nano is now publicly available for experimental access.
Multimodal Cloud AI with Google's most capable models
You can create multimodal generative AI experiences in your apps by taking advantage of foundation models running inference in the cloud like the Gemini Pro models. These models are a great solution when you want to support the widest possible range of Android devices.
Use cases
- Image and video description and captioning: identifying objects and describing them in text
- Multimodal reasoning: processing text, image, and video content
- Text generation: summarize articles, answer questions about textual content, extract entities.
- Response formatting: format the model response to JSON or Markdown
Solutions
For prototyping your generative AI features, you can start with the Google AI client SDK. This SDK gives you access to the Gemini API and helps to simplify your app's interactions with the Gemini models. The Google AI client SDK is in preview and should be used for prototyping only.
Learn more about the Google AI client SDK
For bringing your AI experiences into production, use Vertex AI in Firebase. Similar to the Google AI client SDK, this Firebase SDK provides access to Gemini models but also offers security and configuration options that are critical for production apps. In addition, Firebase includes production-level support and features across various mobile platforms.
Learn more about Vertex AI in Firebase
AI for Enterprises
Vertex AI is Google's fully-managed, unified AI development platform for AI. Enterprises can use Google's Vertex AI platform to deliver customized AI experiences to Android devices using backend integrations. Build, train, and deploy AI applications on Google's scalable, world-class infrastructure. It's a great solution for enterprise-scale AI, with access to over 130 models and tools including AI Studio, Agent Builder, and Gemini models.
Use cases
- Custom model training and delivery
- Image and video generation
- Virtual agents, customer support
- Speech to text, natural language processing
Solution
Use Google's Vertex AI platform to build custom AI applications and connect Android apps to the service layer.
Additional resources
Responsible Generative AI Toolkit
AI models should be aligned with safety policies, evaluated for fairness and accuracy, and designed to be transparent. The Responsible Generative AI Toolkit provides help and guidance for you to design, build, evaluate and deploy open AI models responsibly.
Gemini in Android Studio
Gemini in Android Studio is a coding companion for Android development. It's powered by artificial intelligence and can understand natural language. It helps you be more productive by answering your Android development queries. Gemini can help you find relevant resources, learn best practices, and save time.
Gemini API Starter template
The Gemini API Starter template closely follows the online quickstart for getting started with Gemini in Android. It leverages the Google AI client SDK for Android and shows how to work with text prompts and model responses.
Reference
Google APIs and SDKs for Gen AI on Android
Environment |
API or SDK |
Supported Model(s) |
Availability |
Recommended usage |
Android integration with on-device inference |
Gemini Nano |
Public experimental access |
Experimental |
|
Android integration with cloud inference |
Gemini 1.5 Flash |
Public preview |
Prototyping only |
|
Gemini 1.5 Flash |
Generally available (GA) |
Recommended for production |
||
Backend integration with cloud inference |
130+ foundation models (including Gemini 1.5 models) |
Generally available (GA) |
Recommended for production |
|
Android integration with on-device inference |
Gemma 2B |
Experimental |
Google generative AI models
Google offers multiple generative AI models that you can use in your Android app.
Environment |
Model |
Type (Cost) |
Supported input formats |
Output data |
On-device |
Gemini Nano |
No-cost |
Text, image |
Text |
Cloud |
Gemini 1.5 Flash |
No-cost/Paid |
Text, image, video, audio |
Text |
Gemini 1.5 Pro |
No-cost/Paid |
Text, image, video, audio |
Text |
|
Gemini 1.0 Pro |
No-cost/Paid |
Text |
Text |
|
On-device, cloud |
Gemma & Gemma 2 |
No-cost (open model) |
Text |
Text |
For complete details on each model's capabilities, including token and rate limits, see Gemini models.