Blackberry Asynchronous HTTP Requests - How?

Posted by Kai on Stack Overflow See other posts from Stack Overflow or by Kai
Published on 2010-04-20T17:26:12Z Indexed on 2010/04/22 23:33 UTC
Read the original article Hit count: 247

The app I'm working on has a self contained database. The only time I need HTTP request is when the user first loads the app.

I do this by calling a class that verifies whether or not a local DB exists and, if not, create one with the following request:

HttpRequest data = new HttpRequest("http://www.somedomain.com/xml", "GET", this); data.start();

This xml returns a list of content, all of which have images that I want to fetch AFTER the original request is complete and stored.

So something like this won't work:

HttpRequest data = new HttpRequest("http://www.somedomain.com/xml", "GET", this); data.start();
HttpRequest images = new HttpRequest("http://www.somedomain.com/xmlImages", "GET", this); images.start();

Since it will not treat this like an asynchronous request. I have not found much information on adding callbacks to httpRequest, or any other method I could use to ensure operation 2 does not execute until operation 1 is complete.

Any help would be appreciated. Thanks

© Stack Overflow or respective owner

Related posts about blackberry

Related posts about httprequest