using gwt-dispatch. gwt and android

104 views
Skip to first unread message

Sky

unread,
Jan 8, 2011, 7:17:00 AM1/8/11
to GWT Dispatch
Hi there,

I have a GWT and Google App Engine Web application, which uses gwt-
dispatch and works fine. Now I built an Android app which needs to
connect to the data stored on App Engine. Searching the web, the best
and easiest way to connect Android to App Engine is to use Restlet
Webservices. This works ok, but has some disadvantages.
For example you can not reuse the Guice Code from Gwt-dispatch server
(or it is not documented at all).
Because a gwt-dispatch Action is built like a service, there should be
a possibility to connect to it.
So my question is simple: Is it possible, and are there any librarys
to connect Android directly to a gwt-dispatch service?

Thanks and best regards
Sky

Richard Vowles

unread,
Jan 8, 2011, 6:11:31 PM1/8/11
to gwt-di...@googlegroups.com
The problem with talking to your GWT services via Android is that you are effectively using serialization. If you server objects change, your client ones need to as well. This is fine with GWT as its just a webpage - chances are you deploy them together. Thats not true with Android - its a different app and as with Java serialization, there is no easy way to make sure they evolve together. Thats why most people go the JSON route when dealing with Android/GWT/GAE. 

Unfortunately (or fortunately, depending on your POV), I did go down this track before swapping back to JSON (and Restlet is awful, I can't stand it, as i tried it before swapping back to Jersey). and got GWT dispatch working against Android for a GWT service. It is a fork of another persons project who hadn't structured their maven project in a manner I would consider well designed and reusable so I needed to do this. If you still need to do this given the problems, let me know and I'll put it up on github (I am going away for a few days tho, so this may take me a few days to achieve).

Richard
--
---
Richard Vowles,
Grails, Groovy, Java
Consistency is the last refuge of the unimaginative - Oscar Wilde
ph: +64275467747, linkedin, skype:rvowles
get 2Gb shared disk space in the cloud - Dropbox, its incredibly useful! - http://tinyurl.com/cmcceh
podcast: http://www.illegalargument.com

Sky

unread,
Jan 9, 2011, 10:41:24 AM1/9/11
to GWT Dispatch
thanks for the reply. That serialization problem makes sense.
Another problem with Restlet is, that it does not support
Authentication with App Engine

Do you know a good tutorial for the Jersey way connecting Android to
GAE?

Best Regards
Sky


On 9 Jan., 00:11, Richard Vowles <richard.vow...@gmail.com> wrote:
> The problem with talking to your GWT services via Android is that you are
> effectively using serialization. If you server objects change, your client
> ones need to as well. This is fine with GWT as its just a webpage - chances
> are you deploy them together. Thats not true with Android - its a different
> app and as with Java serialization, there is no easy way to make sure they
> evolve together. Thats why most people go the JSON route when dealing with
> Android/GWT/GAE.
>
> Unfortunately (or fortunately, depending on your POV), I did go down this
> track before swapping back to JSON (and Restlet is awful, I can't stand it,
> as i tried it before swapping back to Jersey). and got GWT dispatch working
> against Android for a GWT service. It is a fork of another persons project
> who hadn't structured their maven project in a manner I would consider well
> designed and reusable so I needed to do this. If you still need to do this
> given the problems, let me know and I'll put it up on github (I am going
> away for a few days tho, so this may take me a few days to achieve).
>
> Richard
>

Richard Vowles

unread,
Jan 10, 2011, 10:06:27 PM1/10/11
to gwt-di...@googlegroups.com
Unfortunately I don't - I am using Guice/Jersey/Jackson/GAE on the server side and Android/Jackson on the client side. GWT I'm just using GWT and JavascriptObjects. Same factory pattern that is recommended by GWT 2.1 though.

I still don't have the infrastructure side of it fully clear though, so I'm not writing anything up :-)

Richard

On Mon, Jan 10, 2011 at 4:41 AM, Sky <skysoftw...@googlemail.com> wrote:
thanks for the reply. That serialization problem makes sense.
Another problem with Restlet is, that it does not support
Authentication with App Engine

Do you know a good tutorial for the Jersey way connecting Android to
GAE?

Best Regards
Sky


--
---
Richard Vowles,
Grails, Groovy, Java
Consistency is the last refuge of the unimaginative - Oscar Wilde
ph: +64275467747, linkedin, skype:rvowles

Eugene Popovich

unread,
Jul 26, 2012, 2:51:57 AM7/26/12
to gwt-di...@googlegroups.com, skysoftw...@googlemail.com
Hi

I love gwt-dispatch so i wanted something similar on Android platform.

Currently i reworked gwt-dispatch library for a little so i can use same command pattern approach on Android client side. You can find my work here http://code.google.com/p/http-dispatch/ . The logic is almost the same as in gwt-dispatch. But instead of GWT servlet i use my own. Also instead of GWT serialization i use native binary serialization. I know it is not the best approach so you should test it for you objects. Currently it is in alpha stage but i hope that with the developers feedback library can be significantly improved.

David Peterson

unread,
Jul 26, 2012, 6:19:49 AM7/26/12
to gwt-di...@googlegroups.com
Sounds good to me. I'm pretty rusty on the actual code in these libraries, but I've always felt that there are good principles for a more generic library in the API. Breaking out dependence on GWT is a good thing. Perhaps even creating a pure JSON transmission protocol, even if it's less efficient.

Regards,

David Peterson

Eugene Popovich

unread,
Jul 27, 2012, 3:04:59 AM7/27/12
to gwt-di...@googlegroups.com
You gave us a great library. The principles are really nice. Thanks for your work.

Papick G. Taboada

unread,
Jul 26, 2012, 6:26:16 AM7/26/12
to gwt-di...@googlegroups.com
Actually, the dispatch bean itself is framework agnostic. 
For instance, I used spring httpinvoker to export the dispatch service to other jvms by simply exposing the service.



brgds,

Papick

Daniel Kurka

unread,
Jul 29, 2012, 11:31:13 AM7/29/12
to gwt-di...@googlegroups.com
maybe you should take a look at AutoBeans as a transport mechanism: http://code.google.com/p/google-web-toolkit/wiki/AutoBean

-Daniel
Reply all
Reply to author
Forward
0 new messages