Blackberry Asynchronous HTTP Requests - How?
- by Kai
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