简体   繁体   English

Google App Engine(GAE)和Android

[英]Google App Engine (GAE) and Android

I already have a website running off of Google App Engine (Python), and I am trying to connect an Android app to my GAE datastore and blobstore. 我已经有一个运行Google App Engine(Python)的网站,并且正在尝试将Android应用程序连接到我的GAE数据存储区和Blob存储区。

I followed the tutorial here , but when I deployed the Module to App Engine (via Android Studio), my webpage was redirected to a page similar to this: 我在这里按照本教程进行操作,但是当我将模块部署到App Engine(通过Android Studio)时,我的网页被重定向到类似于以下的页面:

端点截图

This obviously means that deploying the Module to App Engine is changing my deployment from python to Java and overriding my app.yaml which specifies which .py file to load and subsequently which HTML page to load as my index page. 显然,这显然意味着将模块部署到App Engine会将我的部署从python更改为Java,并且覆盖了我的app.yaml,后者指定要加载的.py文件以及随后要加载的HTML页面作为索引页面。

I have seen lots of documentation on GAE Endpoints (like here and here ), but it seems like many of these are different methodologies than the one on the github tutorial. 我已经看到了很多关于GAE端点的文档(例如herehere ),但是似乎其中许多是与github教程中的方法不同的方法。 I would like to follow the github tutorial since it seems to be the only option utilizing the built-in Android Studio App Engine Module, but I am confused as to how I am to allow Endpoint connection from my app while maintaining my python27 version for the web. 我想遵循github教程,因为它似乎是利用内置Android Studio App Engine模块的唯一选择,但是我对如何允许我的应用程序进行Endpoint连接,同时保持python27版本的使用感到困惑。网页。

Any suggestions? 有什么建议么? Thanks! 谢谢!

This obviously means that deploying the Module to App Engine is changing my deployment from python to Java 显然,这意味着将模块部署到App Engine会将我的部署从python更改为Java

Short answer: yes. 简短的回答:是的。 But not only that. 但不仅如此。 It stopped the python backend from running at that domain, and started running the java backend instead. 它停止了在该域上运行python后端,并开始运行java后端。

What happened? 发生了什么? When you deployed your appengine module that you created with android studio to the project-id that you also used for the python project, the appengine server started running the java appengine on your domain instead of the python one. 当您将使用android studio创建的appengine模块部署到也用于python项目的project-id时,appengine服务器开始在您的域而不是python上运行Java appengine。

When you create an appengine module with android studio, it creates a java appengine project. 当您使用android studio创建一个appengine模块时,它将创建一个Java appengine项目。 This should be seen as a completely different project than what you already had in python. 这应该被视为与python已经完全不同的项目。 You can do your thing with it, but when you deploy it to the same project-id as the python one, it will just shove aside python that was deployed before, and run the java module instead . 您可以使用它来做事,但是当将它部署到与python相同的project-id时,它只会将之前部署的python推开,然后运行java模块。

If you want to connect your android app to an already existing python appengine backend, I suggest you just make an android app without an appengine module in android studio, and use regular HTTP requests to communicate with the python backend. 如果您想将android应用连接到已经存在的python appengine后端,建议您在android studio中制作一个没有 appengine模块的android应用,并使用常规HTTP请求与python后端进行通信。

I believe it's possible to import an existing java appengine backend into android studio and connect it to your android app, but that is not the case for python backends. 我相信有可能将现有的Java AppEngine后端导入android studio并将其连接到您的android应用,但是python后端并非如此。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM