Leverage Gemini in your Android apps

Leverage Gemini in your Android apps
Leverage Gemini in your Android apps



Posted by Dave Burke, VP of Engineering

Final week we unveiled our most succesful basis mannequin, Gemini. Gemini is multimodal – it might settle for each textual content and picture inputs. We launched a manner for Android builders to leverage our smallest mannequin Gemini Nano, on-device. That is obtainable on choose gadgets by means of AICore, a system service that handles mannequin administration, runtimes, security options and extra, simplifying the work for builders. And at the moment, we’re introducing new methods for Android builders to entry the Gemini Professional mannequin – which runs off-device, in Google’s knowledge facilities.

App growth with Gemini Professional

Gemini Professional is accessible by way of the Gemini API, and it’s our greatest mannequin for scaling throughout a variety of textual content and picture reasoning duties. To simplify integrating Gemini Professional, you should utilize the Google AI SDK, a consumer SDK for Android. This SDK permits direct integration from Android apps and removes the necessity for builders to construct and handle their very own backend infrastructure, decreasing growth prices and bettering velocity.

Google AI Studio gives a streamlined manner for builders to combine the Gemini Professional mannequin, craft prompts, create API keys, and effortlessly rework concepts into AI apps. Upon getting developed your immediate in Google AI Studio, you’ll be able to merely click on on the “Get code” motion to generate a Kotlin code snippet, and begin integrating Gemini at the moment utilizing the Google AI SDK for Android.

Generate Kotlin code for the Gemini API in Google AI Studio

Generate Kotlin code for the Gemini API in Google AI Studio

We’re additionally making it simpler for builders to make use of the Gemini API instantly within the latest preview version of Android Studio. We’re introducing a new project template for builders to get began with the Google AI SDK for Android straight away. You’ll profit from Android Studio’s enhanced code completion and lint checkers, serving to with API keys and safety.

New Project template for AI in Android Studio

New Mission template for AI in Android Studio

To leverage the brand new template in Android Studio, begin a brand new undertaking by means of File > New > New Mission and decide the Gemini API starter template. This template gives a pre-configured undertaking with the mandatory code to make use of the Gemini API. After selecting a undertaking identify and site, you can be prompted to generate an API key in Google AI Studio, and requested to enter it in Android Studio. Android Studio will routinely arrange the undertaking for you with the Gemini API connection, simplifying your workflow.

Alternatively, you’ll be able to import the generative AI code sample and set it up in Android Studio by means of File > New > Import Pattern, and trying to find “Generative AI Pattern”.

Generative AI sample app

Generative AI pattern app

Get began constructing AI-powered options and Android apps utilizing Gemini Pro.

Leave a Reply

Your email address will not be published. Required fields are marked *