如何使用 Android Studio 开发 Google App Engine 后端 [英] How to develop Google App Engine backend using Android Studio
问题描述
我正在尝试将 Google App Engine 功能添加到我的 Android 应用中.我正在使用 Android Studio,并查看了 Brad Abrams Google I/O talk 和另一个教程,但 Android Studio 似乎已经从去年的这个时候开始,并且 Google Cloud Endpoints 功能已被删除.我可以在 GitHub 上看到,菜单选项生成 App Engine 后端"已从 Android Studio 中删除,并替换为新 App Engine Gradle 模块".
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".
是否有任何选项允许我像在 Android Studio 中的那些示例中那样生成 App Engine 后端,或者我是否需要使用 Eclipse 来执行此操作?
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?
推荐答案
本回答基于 AndroidStudio 0.8.3.
This answer is based on AndroidStudio 0.8.3.
- 选择项目的最顶层,右键单击新建 > 模块,然后选择App Engine Java Endpoints
- 为您的模块设置名称,例如 mymodule
您的 build.gradle 文件现在将有一个新行:
- Select the top most level of your project, right click New > Module and select App Engine Java Endpoints
- set the name for your module, such as mymodule
Your build.gradle file will now have a new line:
编译项目(路径:':mymodule',配置:'android-endpoints')
现在您需要打开 mymodule/src/main/webapp/WEB-INF/appengine-web.xml 并将 myApplicationID 替换为您的 appengine PROJECT ID> 您可以从 cloud.google.com/console
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
您现在可以将配置更改为 myModule(工具栏)并按运行.它将启动一个本地服务器,或者您可以选择窗口右上角的 Gradle 并查找 :mymodule 并点击 appengineUpdate> 或 appengineUpdateAll.
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.
这篇关于如何使用 Android Studio 开发 Google App Engine 后端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!