Phone model:bb curve 8520
Phone version:4.6.1.314
Carrier :airtel india
APN :airtelgprs.com
No username and password
I am using the following code:
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...
}
This code is throwing a "tunnel failed " exception. I am unable to understand the reason behind it. The APN is properly defined in the phone according to the network carrier. I am able to access internet through the browser also.
Please reply me if you know the reason for the tunnel failure or critical tunnel failure.
One more thing, the code is working fine when I append interface=wifi
in the place of deviceside=true
(this requires WIFI to be on and connected ).
[EDIT]
I checked the log in the BlackBerry Curve 8520 mobile and it looks like this:
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
Can any one guess whats wrong after seeing the log?
common problem and also answered many times
and
and
and
in this way specific extensions or available so this is not a good way to using extensions we have to classes 1)HttpConnectionFactory 2)HttpConnectionFactoryException
just import those classes into our project. HttpConnectionFactory class have to chose extension according to order by preference 1)class one is define different connection types
second class is
you just use following code to checking your url extension String url="YOur actual url"