Join us from October 8-10 in New York City to learn the latest tips, trends, and news about GraphQL federation and API platform engineering.Join us for GraphQL Summit 2024 in NYC
Start for Free
You're viewing documentation for a previous version of this software. Switch to the latest stable version.

1. Configure your project

In this step, you'll import the starter project and add the Apollo Android SDK to it.

Clone the starter project

git clone
cd apollo-android-tutorial
git checkout initial

At any time, if you want to view a completed version of the project, checkout the main branch.

Open the project in Android Studio

Android Studio will take some time to index the contents of the project. Take some time to look around. You should see 3 :

  • LaunchListFragment is the first . You will display a list of there.
  • LaunchDetailsFragment will display details about a and give you the opportunity to book a seat.
  • LoginFragment will allow you to log in before booking the seat.

Now build and run the project. You should see an empty app:

The initial state of the project!

Now you will add Apollo Android to the project.

Get the latest version of Apollo Android

You can find the latest version of Apollo Android from the github releases page. It is also displayed at the top of the apollo-android repo.

This tutorial uses 2.5.9 because it is the latest version at the time of writing. Feel free to use a more recent version if one is available.

Apply the plugin

Apply the Apollo plugin in app/build.gradle.kts. There are two build.gradle.kts in the project. Make sure to use the one in the app directory this time. The Apollo plugin ID is com.apollographql.apollo.

plugins {
// ...

The plugin contains the compiler that will generate models from your queries when you build your project.

Configure Kotlin

Configure the Apollo plugin to generate Kotlin files instead of Java files. Put this at the end of app/build.gradle.kts:

apollo {

Add dependencies

Now add apollo-runtime and apollo-coroutines-support to the list of dependencies. This is the actual code that will run on the device and help schedule queries.

dependencies {
// ...
// ...

Android Studio will display a yellow banner, A project sync may be necessary for the IDE to work properly. Click Sync Now.

If everything goes well, Apollo Android is now added to your project. Next, you will add the GraphQL schema to the project.

0. Introduction
2. Add the GraphQL schema
Rate articleRateEdit on GitHubEditForumsDiscord

© 2024 Apollo Graph Inc.

Privacy Policy