黑莓异步HTTP请求 - 如何? [英] Blackberry Asynchronous HTTP Requests - How?

查看:119
本文介绍了黑莓异步HTTP请求 - 如何?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的工作的应用程序有一个自包含的数据库。我需要的HTTP请求的唯一情况是当用户第一次加载应用程序。

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();

该XML返回的内容的列表,所有这一切有我想获取后,原始的请求完成并保存图像。

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();

既然不会把这个像一个异步请求。
我还没有发现添加回调HTT prequest,我也可以用它来确保运行2任何其他方法不执行,直到1操作完成的信息。

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.

任何帮助将是AP preciated。
谢谢

Any help would be appreciated. Thanks

推荐答案

有没有建在J2ME异步HTTP请求。你只需做它的线程手动的。
特别是看看这个例子在,做异步消息的链接的终点。

There is no built in asynchronous HTTP Request in J2ME. You just do it manually with threads. In particular take a look at the example at the end of the link that does asynchronous messaging.

这篇关于黑莓异步HTTP请求 - 如何?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆