This Android sample app demonstrates how to use state-of-the-art generative AI models (like Gemini) to build AI-powered features and applications. It includes both gnerative AI SDK for prototyping as well as VertexAI Firebase SDK for production-grade applications.
This guide assumes that you're familiar with using Android Studio to develop apps for Android.
Make sure that your development environment and Android app meet the following requirements:
- Android Studio (latest version or Koala canary)
- Your Android app must target API level 21 or higher.
Google AI Studio Key (for prototyping)
- Get API Key by following this guide from Google AI Studio
- Add
apiKey=YOUR_KEY
inlocal.properties
- Follow complete guide here for Quickstart: Get started with the Gemini API in Android apps (client SDK)
Gemini API using the Vertex AI for Firebase SDK (for production-grade VertexAI powered Applications)
- Setup a irebase project and connect your app to Firebase by following this guide
- File -> New -> Import Project -> Specify the root
io_extended_24
folder. - Choose the app from the run configuration dropdown list.
- Click Run.
This sample showcases the following API capablilites:
- Chat Prompts
- Function Calling