Google has unveiled its latest tool, the Google AI SDK, designed to facilitate the seamless integration of Gemini Pro – the company's most advanced model to date – into Android applications. This development aims to relieve developers of the burden of constructing and maintaining their own backend infrastructure. Gemini Pro, touted as Google's premier model, boasts capabilities for an extensive array of text and image reasoning tasks. Operating remotely from users' devices in Google's data centers, Gemini Pro is accessible through the Gemini API. Google suggests utilizing the Google AI Studio, a web-based tool, for the most straightforward implementation of Gemini. This tool allows developers to prototype and execute prompts in a browser. Once satisfied with the results, the model can be exported to code and integrated into the preferred language, such as Python, running on the backend.
For Android applications, Google offers the Google AI client SDK for Android, wrapping the Gemini REST API into an idiomatic Kotlin API. This eliminates the necessity for developers to interact directly with the REST API or establish a server-side service to access Gemini models in their Android applications. To showcase the capabilities of the Google AI SDK, a code snippet demonstrates generating text from a text-only prompt. The SDK includes a specific Kotlin API for interacting with the Gemini REST API, enabling developers to integrate Gemini models seamlessly into their Android applications.
In addition to its text-only model, Gemini also features a multimodal model capable of generating text from both text and image inputs (gemini-pro-vision). It supports streaming for accelerated interactions, utilizing the generateContentStream method. Simplifying the development process even further, the latest preview of Android Studio introduces a new project template guiding developers through the steps of using Gemini Pro, starting with generating an API key in Google AI Studio. Beyond Gemini Pro, Google introduces Gemini Nano, a smaller model designed for on-device usage. This allows applications to retain data locally, ensuring predictable latency, even in the absence of a network. Gemini Nano is available on select devices through AICore, a new system service for Android 14, streamlining the incorporation of AI into Android apps by managing model logistics, runtime, safety, and more.