07-18-2008 02:43 PM
Quote from the previous forums:
Please contact Airtel for their direct TCP APN settings. However, these are not required if you are on a BlackBerry Enterprise Server. The following article describes the different connection routes you can use.
What Is - Different ways to make an HTTP or socket connection
Article Number: DB-00396
07-21-2008 10:07 AM - edited 07-21-2008 10:11 AM
Hello MSohm,
I used the second method with following code
try {
HttpConnection httpConnection = (HttpConnection)Connector.open("http://wap.google.
httpConnection.setRequestMethod(HttpConnection.POS
httpConnection.setRequestProperty("If-Modified-Sin
httpConnection.setRequestProperty("User-Agent", "Profile/MIDP-1.0 Configuration/CLDC-1.0");
httpConnection.setRequestProperty("Content-Languag
InputStream inputStream = httpConnection.openInputStream();
int len = (int)httpConnection.getLength();
if (len > 0) {
byte[] data = new byte[len];
int actual = inputStream.read(data);
//process(data);
} else {
int ch;
while ((ch = inputStream.read()) != -1) {
//process((byte)ch);
}
}
}
catch(IOException e) {
Dialog.alert(e.toString());
}
finally {
Dialog.alert("Finally block.");
}
by just changing the WAPGatewayAPN=carrier.com.gprs into WAPGatewayAPN=rim.net.gprs
But I am getting java.io.IOException:Invalidurl parameter.
How can fix this error?
Please advice me.
I thank you.
07-21-2008 10:19 AM
07-21-2008 10:23 AM
Thanks for quick response buddy!
It's BlackBerry 8100 wireless Handheld (EDGE) v4.2.0.67(Platform 2.2.20.39)
07-21-2008 10:33 AM
When i am taking off space between http://wap.google.com; and WAPGatewayIP=127.0.0.1; it says
net.rim.device.cldc.io.wahttp.WAPIOException
And please let me know, if you need any further details from me.
I thank you.
07-21-2008 11:09 AM
There shouldn't be any spaces in the URL. Parameters are separated by semi-colons ';', spaces should not be entered. Please verify the WAP parameters you are using with your carrier.
Mark
07-21-2008 11:15 AM
Ok, i will call later today them for the correct parameters.
How can i make this working as a general one which will be working for all irrespective of carriers?
Thanks!!!
07-21-2008 11:19 AM - edited 07-21-2008 11:19 AM
07-21-2008 11:29 AM
Yes, i can understand that.
But how can i make an application which should be working for all users having different carriers?
Which one of the three way of making httpconnection will suit for that purpose?
Please advice me.
Thanks!!!
07-21-2008 12:44 PM
If the user's are on a BlackBerry Enterprise Server, you can make a connection using its Mobile Data Service. This won't require any carrier specific information.
The other alternative is a direct TCP connection. This requires the user to have entered their carrier's information under Options, TCP. Or you application can provide this information, but then you are in the same state you are now with the WAP gateway.
How To - Specify APN information for a direct TCP connection
Article Number: DB-00532