Setup
Before starting this tutorial, you need to set up your environment with the necessary requirements.
Building and deploying the Backend API
This tutorial assumes that you have completed the API backend tutorial and that you have deployed it to production App Engine. If you haven't done that yet, follow the link and complete that task first.
Generating the client library for the backend API
You must generate the backend API client library.
To do this:
-
Change directory to the directory containing your backend API's
app.yaml
file and API service classes. -
Invoke the Endpoints command line tool as follows:
/appengine-sdk-path/endpointscfg.py get_client_lib java -o . helloworld_api.HelloWorldApi
-
When successful, the tool displays a message similar to:
API client library written to ./helloWorld-v1.zip
-
Unzip the
.zip
file and at the top level of the resulting/helloworld
subdirectory, locate the file named something similar to:<your_project_id>_appspot_com-helloworld-v1-20140113220645-java-1.17.0-rc-sources.jar
Make a note of the location of this file: you'll need to copy it into your Android project later.
Downloading and installing Android Studio
This client tutorial uses Android Studio, so you need to download and install it following the instructions on the download page.
Installing Android SDKs and required packages in Android Studio
You must install the API package for each API level you want to support in your app, and you must install required packages.
To install the SDKs:
-
Start Android Studio. (In Linux, you do this by invoking
studio.sh
.) - Close any projects currently open ( File > Close Project .)
- Click Configure > SDK Manager in the Quickstart pane to display the Android SDK Manager.
-
Select the following items in the Android SDK Manager, under
Tools
:
- Android SDK Tools
- Android SDK Platform-tools
- Android SDK Build-tools (19.0.1)
-
Select the following items under
Android 4.4.2 (API 19)
:
- SDK Platform
- Google APIs
-
Select the following items in the Android SDK Manager, under
Extras
:
- Android Support Repository
- Android Support Library
- Google Play Services
- Google Repository
- Click Install Packages and wait for the install to finish.
Enabling your Android device for debugging
In this tutorial, we'll run the app on a real Android device, so you need to enable your Android device for debugging .
You should also become familiar with the process of deploying an app to an Android device .
Next
Create and configure your Android Endpoints project.