On 8 June 2010 20:25, Streets Of Boston <flyingdutc...@gmail.com> wrote:
> I still need to watch this talk... when i get some time :-)
>
> Right now i'm working on a project for my job that involves a REST-ful
> client on Android and a REST server.
>
> I have not implemented the REST-communication on the client using a
> ContentProvider and Service. I did do that a good year ago with
> another project (Smugmug REST) and it's elegant, but I found that it
> is not really necessary.
>
> In my current project, I've implemented the REST-communication using
> AsyncTask and the 'Restlet for Android' library. The AsyncTask holds
> on to an application-context (not the context of an activity, since
> that could introduce memory leaks) and keeps track of pending REST-
> requests in an object passed around by through 'last-configuration-
> instance'. By not using a ContentProvider/Service, the callback
> mechanisms has been simplified a *lot*.
>
>

Thanks for your input. Holding onto the application context is
actually the way I'm doing it now, using the Droid-fu[1] library which
simplifies things a lot. However, that approach can still lose
responses or duplicate network usage if the Activity is
destroyed/created while the AsyncTask is doing its job.

I would be interested to hear other people's opinions on this matter.
But for no reason other than it be interesting to see how well it
works I am going to try the Service/ContentProvider approach.

Andrew

[1] http://github.com/kaeppler/droid-fu

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to