4

This is not really a problem, more like a general X vs. Y question.

So I'm experimenting with c2dm on android using a server written in google app engine. At the moment I'm using the "App Engine Connected Android Project" as a template with some added code myself. So the generated code use RequestFactory for a bunch of stuff, like registering/unregistering devices, sending messages, etc.

My previous experiences with backend communication has existed of setting up a connection to a servlet, writing to it (json) and reading the response (json).

So here's the question: What are the benefits (if any) with using the RequestFactory for communication with the app engine instead of just writing/reading from an URLConnection's input/outputstreams? Or is it really just a matter of taste?

Tomas
  • 1,399
  • 1
  • 14
  • 19

2 Answers2

1

One disadvantage of request factory is that it is very slow in retrieving objects.. A custom servlet and http request are MUCH faster(10x-20x faster!).

Check out this post for more details RequestFactory slow on Android

Community
  • 1
  • 1
Vincent Vettukal
  • 1,031
  • 11
  • 15
0

I haven't used it myself yet, but the main benefit, as I understand it, is that it makes it really easy to authenticate against the App Engine app with your Android credentials. Doing that by hand is a bit of a pain.

Nick Johnson
  • 100,655
  • 16
  • 128
  • 198
  • Actually I find it quite simple to authenticate against the App Engine. I just tried and set the authCookie (retrieved via some built-in Android functionality) in the header of the request (as header: "Cookie") and it works. That was just when doing a quick test, so I don't know how well that would actually work, but I get authenticated and all is well. I guess maybe it all comes down to personal choice, which one, one feel is more comfortable using? – Tomas Jul 25 '11 at 09:45
  • @Tomas It's relatively straightforward to hack up, yes, but still more trouble than just using the provided functionality. Once you're using the cookie solution, too, you need to worry about cookie and token expirations. – Nick Johnson Jul 26 '11 at 01:41