我如何从一个Android应用的App Engine的后端请求? [英] How do I make requests from an Android app to an App Engine backend?

查看:187
本文介绍了我如何从一个Android应用的App Engine的后端请求?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图做的是有一个Android应用程序,连接到谷歌App Engine的后端,以便从存储在云中的数据库获取数据。我查阅了一些资料,并计算,谷歌云消息是最好的办法。我卡在试图谷歌应用程序引擎的Andr​​oid应用程序集成。

What I'm trying to do is have an Android app that connects to a Google App Engine backend in order to get data from a database stored in the cloud. I've looked up some documentation and figured that Google Cloud Messaging is the best way for this. I'm stuck on trying to integrate Google App Engine with the Android app.

推荐答案

GCM是伟大的,从GAE发送小消息的应用,特别是对于苏醒的应用程序,并得到一个消息,即使它没有运行。

GCM is great for sending small messages from GAE to the app, and particularly for waking the app and getting a message to it even if it isn't running.

从发送到Android的GAE通过GCM一个请求是新的,而不是提出请求的正常方式。在我与谷歌的新东西,个人的经验,我建议你留远,并坚持这是做一个HTTP / REST / JSON从Android要求在GAE上一个servlet的正常方式。

Sending a request from Android to GAE via GCM is new and is not the normal way of making requests. In my personal experience with new Google stuff, I would suggest you stay far away and stick to the normal way which is to do an HTTP/REST/JSON request from an Android to a servlet on GAE.

有许多Android库,从谷歌这样做,包括排球(这是在使用不久,就被释放,不那么可怕的事情GCM我提)。在服务器上,你可以与谷歌端点做更容易验证和跨平台的支持,但它也相当靠不住的(它没有完全释放),所以如果你不需要那些两个特点我会避免它。

There many Android libraries for doing this including Volley from Google (this was in use long before it was release so is not as scary as the GCM thing I was mentioning). On the server you could do it with Google Endpoints for easier authentication and cross-platform support, but it too is quite wonky (it is not fully released), so if you don't need those two features I would avoid it.

这篇关于我如何从一个Android应用的App Engine的后端请求?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆