How to develop Google App Engine backend using And

2019-03-09 23:59发布

I am trying to add Google App Engine functionality to my Android App. I am using Android Studio, and have had a look at Brad Abrams Google I/O talk and another tutorial, but Android Studio seems to have moved on from where it was at this time last year, and the Google Cloud Endpoints functionality has been removed. I can see at GitHub that the menu option "Generate App Engine Backend" was removed from Android Studio and replaced with "New App Engine Gradle Module".

Are there any options to allow me to generate the App Engine Backend like in those examples from Android Studio, or do I need to use Eclipse to do this?

1条回答
手持菜刀,她持情操
2楼-- · 2019-03-10 00:41

This answer is based on AndroidStudio 0.8.3.

  1. Select the top most level of your project, right click New > Module and select App Engine Java Endpoints
  2. set the name for your module, such as mymodule
  3. Your build.gradle file will now have a new line:

    compile project(path: ':mymodule', configuration: 'android-endpoints')

  4. Now you will want to open mymodule/src/main/webapp/WEB-INF/appengine-web.xml and replace myApplicationID with your appengine PROJECT ID which you can get from cloud.google.com/console

  5. You can now either change the configuration to myModule (toolbar) and press run. It will launch a local server, or you can select Gradle on the upper right hand side of the window and look for :mymodule and click on appengineUpdate or appengineUpdateAll.

More detail here and GitHub

查看更多
登录 后发表回答