A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://cloud.google.com/endpoints/docs/frameworks/legacy/v1/java/migrating-android below:

Migrating Android projects to Cloud Endpoints Frameworks 2.0 | Cloud Endpoints Frameworks for App Engine

Migrating Android projects to Cloud Endpoints Frameworks 2.0

Stay organized with collections Save and categorize content based on your preferences.

This page describes migrating an existing Android Cloud Endpoints version 1.0 app to Endpoints Frameworks for App Engine. Note that this page refers to Endpoints version 1.0 as Endpoints Frameworks version 1.0 and new Endpoints Frameworks for App Engine as Endpoints Frameworks version 2.0.

Benefits

The new framework brings a number of benefits, including:

Endpoints Frameworks version 2.0 doesn't affect the interfaces to your API. Existing clients continue to work after migration without any client-side code changes.

Migrating Android multi-module projects to Endpoints Frameworks version 2.0

The following steps guide you through moving Android Studio Endpoints Frameworks version 1.0 projects to Endpoints Frameworks version 2.0. The guide migrates an Android Studio project with a Endpoints module.

Task list

Use the following high-level task list as you work through the migration guide. This migration guide assumes you have an existing Android project using a Google Cloud module.

  1. Before you begin.
  2. Setup the Google Cloud CLI.
  3. Optional: Download the sample code.
  4. Migrate to Endpoints Frameworks version 2.0.
  5. Deploy your backend module.
  6. Generate client libraries.
Before you begin
  1. Install Android Studio.
  2. Install Android SDK 26+.
  3. Install the gcloud CLI.
Set up the gcloud CLI

To setup the gcloud CLI:

  1. Initialize the gcloud CLI:

     gcloud init
    
  2. Use Application Default Credentials:

     gcloud auth application-default login
    
  3. Install the app-engine-java component:

     gcloud components install app-engine-java
    
Optional: Download the sample code

To clone the legacy and v2 sample projects from GitHub:

  1. Clone the sample repository to your local machine:

     git clone https://github.com/GoogleCloudPlatform/android-docs-samples
    
  2. Change to the directory containing the sample code for legacy and v2:

     cd android-docs-samples/endpoints-frameworks/
    
Migrate to Endpoints Frameworks version 2.0 Update the build.gradle file

Endpoints Frameworks version 2.0 dependencies use Guava 19 and Android Gradle build plugin com.android.tools.build:gradle:2.3.3 uses Guava 18. Add Guava 19 to the build script dependencies closure of the build.gradle to override this transitive dependency.

Note: The legacy changed sections are marked with LEGACY: and v2 sections are marked with V2:. Update the app/build.gradle file

In Endpoints version 1.0, you used the Gradle plugin, gradle-appengine-plugin, to generate an API Discovery Document. In Endpoints Frameworks version 2.0, you use the endpoints-framework-gradle-plugin to generate a Discovery Document.

This build script uses the client-side plugin, com.google.cloud.tools.endpoints-framework-client.

Update the backend/build.gradle file

The App Engine standard environment Gradle tooling was updated. Endpoints Frameworks version 1.0 projects used the gradle-appengine-plugin in com.google.appengine, and Endpoints Frameworks version 2.0 projects use appengine-gradle-plugin.

This build script uses the server-side plugin, com.google.cloud.tools.endpoints-framework-server.

Update the web.xml file

In Endpoints Frameworks version 2.0, the servlet-class changed from SystemServiceServlet to EndpointsServlet.

The URL pattern was updated from /_ah/spi/* to /_ah/api/*.

Rebuild project

Finally, use the Android Studio build list to clean and rebuild the Android Studio project with the new dependencies.

Deploy your backend module

The new Gradle App Engine plugin is now used to deploy the backend module by using the following Gradle task while in the backend module:

gradle appengineDeploy
Generate client libraries

To generate client libraries, use the following Gradle task while in the backend module:

gradle endpointsClientLibs

Learn more about the available tasks for the Endpoints Frameworks Gradle plugin.

Adding Endpoints API management

Endpoints Frameworks version 2.0 also lets you turn on API management features, including:

To get started using these and other Cloud Endpoints Frameworks 2.0 features, go to the Java page about Endpoints Frameworks for App Engine.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-08-07 UTC.

[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["This guide provides steps for migrating an Android Cloud Endpoints version 1.0 app to Endpoints Frameworks for App Engine (version 2.0)."],["Migrating to Endpoints Frameworks version 2.0 offers benefits like reduced request latency, better App Engine integration, and optional API management features without affecting existing client API interfaces."],["The migration process involves updating build.gradle files, switching from the `gradle-appengine-plugin` to the `appengine-gradle-plugin`, and updating the `web.xml` file with the new servlet-class and URL pattern."],["After migrating, the backend module can be deployed using `gradle appengineDeploy` and client libraries can be generated with `gradle endpointsClientLibs`."],["Endpoints Frameworks version 2.0 introduces optional API management features such as API key management, user authentication, API sharing, metrics, and logs."]]],[]]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4