Android Studio provides several types of App Engine backend templates for you to choose from:
|App Engine Java Servlet Module||Uses a standard App Engine Java servlet, requires the Android client app to build requests and send data using
|App Engine Java Endpoints Module||Uses Google Cloud Endpoints, allows your Android client app to make direct API calls to the backend; OAuth 2.0 support is built-in.|
|App Engine Backend with Google Cloud Messaging||This is similar to App Engine Java Endpoints Module but with the addition of Google Cloud Messaging (GCM) support. GCM lets you provide features such as push notifications to your Android app.|
Most Android developers will use either the Endpoints backend or the Endpoints backend with GCM due to OAuth support and the simpler method of accessing the backend.
Choosing a backend template
In Android Studio, you select the templates as follows:
Start Android Studio and open the project for the Android app that needs the new backend.
Right-click on your project and select New > Module.
Select Google Cloud Module from the list and then click Next.
Select the desired backend type; for example choose App Engine Java Endpoints Module, and then supply the remaining information in the New Google Cloud Module form:
Supply a module name for your backend; this name will be displayed and used in your Android Studio project.
Supply a package name. This package name will be used for all classes imported from this template.
Select the client module (containing your Android app) in this project. This module will be automatically set up to have the right compile and build dependencies to be able to call your newly generated backend.
Click Finish to generate the new backend.
Select Tools > Android > Sync Project with Gradle Files to sync the project.
At this point, you've created a new buildable and runnable backend module for
your Android Studio project and added it as an additional dependency in your
In particular, a new Gradle module with your specified module/package name has been added to your project containing your new backend. All of the required dependencies/permissions have been automatically set up for you.
Using the App Engine backend modules
For detailed instructions on how to connect your Android app to the backend,
how to debug and test locally, and how to deploy, see the
README at the
appropriate GitHub repository:
- App Engine Java Servlet Module
- App Engine Java Endpoints Module
- App Engine Backend with Google Cloud Messaging
Suggesting changes or enhancing the backend module templates
If you want to make suggestions to improve or enhance these templates, you are welcome to visit the GitHub repo and submit a pull request.