简体   繁体   中英

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.

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:

端点截图

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.

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. 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.

Any suggestions? Thanks!

This obviously means that deploying the Module to App Engine is changing my deployment from python to 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.

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.

When you create an appengine module with android studio, it creates a java appengine project. This should be seen as a completely different project than what you already had in 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 .

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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