Re: How are you all doing asynchronous network calls?

32 views
Skip to first unread message

Tad

unread,
Jan 30, 2013, 7:12:10 PM1/30/13
to andro...@googlegroups.com
I wrote an IntentService to do this, but it appears RoboSpice is a more featureful solution.


On Wed, Jan 30, 2013 at 2:05 PM, Robb Shecter <ro...@weblaws.org> wrote:
I.e., for the simple case of using an https/json web service. It looks like the best solution is Robospice. 

--
You received this message because you are subscribed to the Google Groups "androidpdx" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidpdx+...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at http://groups.google.com/group/androidpdx?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

C Shipley

unread,
Jan 30, 2013, 7:18:41 PM1/30/13
to andro...@googlegroups.com
Hi Rob,

I just put the synchronous calls into an async task. That allowed me to use the newer apache http libraries because I had to use some multipart http posts, which at the time, I believe were not supported by the http clients in android.

If you're interested, I can throw some source up on github.

Robb Shecter

unread,
Jan 30, 2013, 8:05:53 PM1/30/13
to andro...@googlegroups.com
> If you're interested, I can throw some source up on github.

That'd be great. I'd like to see how you did this.

marissa anderson

unread,
Jan 31, 2013, 2:32:38 PM1/31/13
to andro...@googlegroups.com
I also usually use AsyncTasks for my network calls. I wrote a blog post awhile ago comparing different methods (and arguing for the use of AsyncTasks in most cases). There's some sample code in there as well.
http://electrozoic.com/asynctasks-runnables-handlers-and-threads-oh-my/

On Wed, Jan 30, 2013 at 5:05 PM, Robb Shecter <ro...@weblaws.org> wrote:
> If you're interested, I can throw some source up on github.

That'd be great. I'd like to see how you did this.

--

Paul A. Steckler

unread,
Jan 31, 2013, 2:45:18 PM1/31/13
to andro...@googlegroups.com
I've mostly used AsyncTask for that purpose, and use the Apache HTTP libraries.

Because the HTTP calls are in their own thread, it seems to be OK to use the blocking versions, i.e., no need to deal with the response in a separate handler. 
I put in timeouts for the socket so in the event of network failure, the call won't block forever.

-- Paul
Reply all
Reply to author
Forward
0 new messages