"However, that approach can still lose responses or duplicate network usage if the Activity is destroyed/created while the AsyncTask is doing its job"
Is that an issue with the Droid-fu or with AsyncTask? I don't have that issue. When configuration changes take place, no new requests are duplicated and existing ones just keep going, as long as you put the AsyncTasks in a static context (not an (activity) instance context). On Jun 8, 3:44 pm, Andrew Brampton <[email protected]> wrote: > On 8 June 2010 20:25, Streets Of Boston <[email protected]> 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- Hide quoted text - > > - Show quoted text - -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

