手机型号:bb曲线8520
电话版本:4.6.1.314
承运人:印度的airtel
APN:airtelgprs.com
没有用户名和密码
我使用以下代码:
String url="http://<address>:<port>/path;deviceside=true";
HttpConnection conn =(HttpConnection)Connector.open(url,Connector.READ_WRITE,true);
int response=conn.getResponseode();
if(responsecode==HttpConnection.HTTP_OK)
{
//...code for handling the response...
}
Run Code Online (Sandbox Code Playgroud)
此代码抛出"隧道失败"异常.我无法理解它背后的原因.根据网络运营商,在电话中正确定义了APN.我也可以通过浏览器访问互联网.
如果您知道隧道故障或严重隧道故障的原因,请回复我.
还有一件事,代码在我附加interface=wifi
到位时工作正常deviceside=true
(这需要打开并连接WIFI).
[编辑]
我检查了BlackBerry Curve 8520 mobile中的日志,它看起来像这样:
E net.rim.tcp-TNLf 0
a net.rim.tunnel-pdp2 1
a net.rim.hrtRT-EPRj 0x2100000001
a net.rim.tunnel - STnc-00000000
a net.rim.tunnel- Open - airtelgprs.com
a net.rim.tcp-open
Run Code Online (Sandbox Code Playgroud)
看到日志后有人猜错了吗?