Google Cloud Endpoints consists of tools, libraries and capabilities that allow you to generate APIs and client libraries from an App Engine application, referred to as an API backend, to simplify client access to data from other applications. Endpoints makes it easier to create a web backend for web clients and mobile clients such as Android or Apple's iOS.
For mobile developers, Endpoints provides a simple way to develop a shared web backend and also provides critical infrastructures, such as OAuth 2.0 authentication, eliminating a great deal of work that would otherwise be needed. Furthermore, because the API backend is an App Engine app, the mobile developer can use all of the services and features available in App Engine, such as Datastore, Google Cloud Storage, Mail, Url Fetch, Task Queues, and so forth. And finally, by using App Engine for the backend, developers are freed from system admin work, load balancing, scaling, and server maintenance.
It is possible to create mobile clients for App Engine backends without Endpoints. However, using Endpoints makes this process easier because it frees you from having to write wrappers to handle communication with App Engine. The client libraries generated by Endpoints allow you to simply make direct API calls.
Basic Endpoints architecture
Here's what using an Endpoints API allows you to do:
Endpoints libraries, tools, and samples
Google Cloud Endpoints provide the following libraries and tools:
- The Endpoints library in the SDK.
- Maven artifacts for creating new backend API projects, generating client libraries and generating discovery docs.
- Alternatively to Maven, the
endpoints.shcommand line tool (for Linux), or
endpoints.cmd(for Windows) that you can use to generate client libraries and discovery documents.
- Another alternative to Maven is Endpoints support in the Google Plugin for Eclipse.
Endpoints provides the Tic Tac Toe sample that demonstrates a backend API. Companion client samples for that backend are available:
For more samples, refer to the Getting Started tutorials.
To use Endpoints, be sure you're using the latest version of the Google App Engine Java SDK. If you are using the Google Plugin for Eclipse (GPE) to generate endpoints and client libraries, you'll need the latest GPE version.
The general workflow for developing an app using Endpoints is:
- Create your backend API project (using Maven to do this is the easiest method), then write your API backend code.
- Annotate your API backend code, so classes and client libraries can be generated from it. (Alternatively, use the Google Plugin for Eclipse, which can annotate for you.)
- Generate the client library using Maven, or alternatively, the
endpoints.shcommand line tool. (Another alternative is to use the Google Plugin for Eclipse to generate the client library.)
- Write your client app, using the client library when making calls to the API backend.
To get started, follow the tutorial for writing a backend API.