Hello.
I wrote a simple BB app that does an HTTP Request and downloads some JSON encoded information. When I run it on the emulator with the ";deviceSide=true" after the URL it works OK. But when I tried it in my BlackBerry Storm actual device, I got the following exception:
java.io.IOException: No tunnels to open
Here's the code I use to do the HTTP Request:
public static String doHttpRequest(String addr) {
HttpConnection hConn = null;
DataInputStream dis = null;
String strData = "";
try {
hConn = (HttpConnection)Connector.open( addr );
dis = new DataInputStream(hConn.openInputStream());
//Get the string in the stream
int c;
while ( (c = dis.read()) != -1 ) {
strData = strData + (char) c;
}
}catch (Exception e) {
net.rim.device.api.ui.component.Dialog.alert( e.toString() );
} finally {
try{
if(dis != null) dis.close();
if(hConn != null) hConn.close();
} catch(Exception e) {
net.rim.device.api.ui.component.Dialog.alert( e.toString() );
}
}
return strData;
}