Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Posts: 51
Registered: ‎08-25-2008
My Device: Not Specified

Autometic APN settings

Hi,

I am developing the application in 4.5.0 which contains http connection. On device for getting http connection, we need to set APN in Options--> Advanced options --> TCP/IP. If we want to make http connection without doing any APN settings, we need to paas the parameters in url.

 

I am using the following url,

url = url + (";deviceside=false;apn=blackberry.net;tunnelauthusername=;tunnelauthpassword=");

conn = (HttpConnection) Connector.open(url);

 

This is working fine on Blackberry Bold 9000 even on airtel with wrong APN settings in Options--> Advanced options --> TCP/IP

But I am getting ioexception "Invalid URL parameter".

How to solve this problem. Please help me.

 

Thanks in advance.

 

 

 

Developer
Posts: 3,951
Registered: ‎07-15-2008
My Device: Not Specified

Re: Autometic APN settings

Little confusing, can you tell which settings are working and which one is not working on device.

 

If you are setting the parameters in url, it will overrride the default setting of device.


Use Search. "Accept Solution" If the problem is resolved.
Developer
Posts: 51
Registered: ‎08-25-2008
My Device: Not Specified

Re: Autometic APN settings

url = url + (";deviceside=false;apn=blackberry.net;tunnelauthusername=;tunnelauthpassword=");

conn = (HttpConnection) Connector.open(url);  working fine on Blackberry Bold 9000

But same url is not working for Curve 8800.

Yes, the default settings will be overriding, but how to solve the problem?

Developer
Posts: 19,612
Registered: ‎07-14-2008
My Device: Not Specified

Re: Automatic APN settings

Can you check your connection parameters using the information found in this KB article.  They don't look consistent to me.

 

What Is - Different ways to make an HTTP or socket connection
Article Number: DB-00396
http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800451/800563/What_Is...

Developer
Posts: 1,474
Registered: ‎04-14-2009
My Device: Not Specified

Re: Automatic APN settings

[ Edited ]

Yep, if you set deviceside=false, then you don't need any APN settings as the traffic will go via RIM's network infrastructure. If you set deviceside=true then you may need to specify APN settings if you don't want to use the ones provided by the user under Options -> Advanced Options -> TCP. So, first figure out whether you want Direct TCP (deviceside=true) or not (deviceside=false).

 

P.S. If you are going with Direct TCP, then the blackberry.net APN won't probably work for you because it is normally connected to the private network with only the RIM's network being reachable (Internet unreachable).

Message Edited by klyubin on 06-10-2009 02:19 PM
Developer
Posts: 51
Registered: ‎08-25-2008
My Device: Not Specified

Re: Automatic APN settings

Thanks both,

 

Yes, I already read this link, then I got to know what is the use of deviceside= false;

For the http connection which will not consider the APN settings, we need to conncet via MDS, by using deviceside= false;

 

But why it is not working on Vurve, and what we need to do for solving this problem.I found one application which is using the HTTP connection, and with wrong APN settings it is working on any device. Then how can it will be possible in my application?

Developer
Posts: 1,474
Registered: ‎04-14-2009
My Device: Not Specified

Re: Automatic APN settings

[ Edited ]

Connections via MDS disregard the APN settings specified in the connection URL as well as in Options -> Advanced Options -> TCP. If MDS connections don't work on your device, you should check whether this device is: (1) registered with a BES, (2) whether there is sufficient coverage for communicating with the MDS, and (3) whether your MDS is actually working fine.

 

You can cover 1 and 2 with CoverageInfo.isSufficientCoverage...

 

P.S. Get rid of the apn, tunnelauthuser and tunnelauthpassword connection URL parameters -- they are extraneous for MDS connections.

Message Edited by klyubin on 06-10-2009 02:35 PM
Developer
Posts: 51
Registered: ‎08-25-2008
My Device: Not Specified

Re: Automatic APN settings

Hi,

 

If I have to check above 3 conditions, then how the other application is working on my deive?

 

The other application without APN settings is working fine on my device, and at same time mine is throwing the exception.Then might be that working application is following some other logic?

 

Any suggestion?

Developer
Posts: 1,474
Registered: ‎04-14-2009
My Device: Not Specified

Re: Automatic APN settings

The exception you described is thrown because the connection URL contains parameters (apn, tunnelauthuser, tunnelauthpass) that shouldn't be there. Remove these extraneous parameters and see whether the connection starts working.
Developer
Posts: 3,951
Registered: ‎07-15-2008
My Device: Not Specified

Re: Automatic APN settings

Are the other devices are of same carrier and use the same connection parameters?

Use Search. "Accept Solution" If the problem is resolved.