Blackberry Java ConnectionFactory不可用
|
我正在Pearl 9100中测试一个应用程序。我的应用程序使用ConnectionFactory来获取可用的连接并执行HTTP请求。
我像这样设置ConnectionFactory
protected int [] preferredTransportTypes = {TransportInfo.TRANSPORT_TCP_WIFI,
TransportInfo.TRANSPORT_MDS,TransportInfo.TRANSPORT_TCP_CELLULAR};
protected int [] disallowedTransportTypes = {TransportInfo.TRANSPORT_BIS_B,
TransportInfo.TRANSPORT_WAP,
TransportInfo.TRANSPORT_WAP2};
因为我无法使用WAP或WAP2。然后我像这样打开连接:
ConnectionDescriptor connd = cf.getConnection(url);
conn =(HttpConnection)connd.getConnection();
如果我将WiFi设置为ON并连接到WiFi网络,则一切正常。但是,如果我仅使用3G离开移动网络,则传递行号1时变量\“ connd \”将为Null。
为什么会这样呢?
想要使用互联网服务的第三方应用程序的标准传输方式是什么?
谢谢!
埃泽奎尔
没有找到相关结果
已邀请:
1 个回复
庞协腿宛炯