Skip to content

This repository outlines how you can use Android Studio to build an application that implements Generative AI using the Google AI SDK. It lays out the process in three steps. Before beginning, ensure that you are running the latest preview version of Android Studio.

Notifications You must be signed in to change notification settings

AkashKobal/Gemini-App-Starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

Build your first Generative AI app in Android Studio

This repository outlines how you can use Android Studio to build an application that implements Generative AI using the Google AI SDK. It lays out the process in three steps. Before beginning, ensure that you are running the latest preview version of Android Studio.

Step 1: Build on the New Project template for AI

Start Android Studio and open a new project using File > New Project. Select the new Gemini API starter template.

alt text
alt text

Step 2: Generate the API key

In the next step of the wizard, after you choose a project name and location, provide an API key for authentication to the Gemini API. If you don't have a Gemini API key, click the link provided in the wizard to navigate to Google AI Studio and request a new key. Once completed, copy your new API key back into the wizard. Click Finish.

alt text
alt text
alt text

Step 3: Start prototyping

Android Studio will automatically set up a project for you with a connection to the Gemini API, simplifying your workflow. Click Run to see the code in action in the Android Emulator. The app comes with a hard-coded prompt asking the model to "Summarize the following text for me"; you can edit or expand the prompt directly in the code to modify what it can do. You can learn more about creating prompts in the Google AI Studio documentation.

alt text
alt text
alt text

About

This repository outlines how you can use Android Studio to build an application that implements Generative AI using the Google AI SDK. It lays out the process in three steps. Before beginning, ensure that you are running the latest preview version of Android Studio.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages