08-13-2008 10:48 AM - edited 08-13-2008 01:42 PM
Hello Sir,
i am developed an application in BlackBerry 8100 .
That application is connect the network and get response from server .
i was run my code in BlackBerry device that time i got IOException is - Open Tunnel max timeout .
What can i do sir, My network service provider unable to provide APN setting for me.
StreamConnection s = null;
try {
s = (StreamConnection)Connector.open(getUrl());
InputStream input = s.openInputStream();
byte[] data = new byte[256];
int len = 0; StringBuffer raw = new StringBuffer();
while ( -1 != (len = input.read(data)) ) {
raw.append(new String(data, 0, len));
}
//convert raw data to
String format String text = raw.toString();
//invoke updateContent method to display retrieved text
updateContent(text);
//close the input stream
input.close();
//close the stream connection
s.close(); }
atch (IOException e)
{
System.err.println(e.toString());
updateContent(e.toString());
}
That is my code.................
My application is work well on MDS Simulator.
Please help me...................
08-13-2008 03:09 PM
Do you mean that your account does not allow for direct TCP connections, or that you do not know the APN settings to create a direct TCP connection? This is required for a direct TCP connection.
Or you can make a connection through a BlackBerry Enterprise Server (deviceside=false) or the carrier's WAP gateway (although this also requires information from the carrier). This link explains the connection routes available on BlackBerry.
http://www.blackberry.com/DevMediaLibrary/view.do?