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: 90
Registered: ‎09-07-2010
My Device: Not Specified
Accepted Solution

Connector problem

Hi,

 

I'm very new here so sorry if my question is a bit stupid. I'm trying to download my file located in the web, but i'm having lots of problems.

 

connection = (HttpConnection) Connector.open(url, Connector.READ, true);
inputStream = connection.openInputStream();

 

The thing is that this code above gets connection time out, always.

 

Any idea? Please help.

 

Thank you very much.

Developer
Posts: 1,055
Registered: ‎01-25-2009
My Device: BlackBerry Bold 9650/BlackBerry Torch 9800

Re: Connector problem

Welcome to the forums!

 

Since you are new, I would recommend reading the following thread since it contains valuable information:

 

http://supportforums.blackberry.com/t5/Java-Development/Connecting-your-BlackBerry-http-and-socket-c...

 

It may seem overwhelming at first but the thread contains all the key components needed to connect successfully.

 

It sounds like you may be missing your connection suffix which is necessary dependent on the BlackBerry device's setup.

Jerome Carty - Follow jcarty on Twitter@jcarty | #webworks-dev / #BlackberryDev on irc.freenode.net | My Apps
Click "Accept as Solution" if post solved your original issue.. Give like/thumbs up if you feel post is helpful
Developer
Posts: 90
Registered: ‎09-07-2010
My Device: Not Specified

Re: Connector problem

Ok, thanks very much, i'll take a look.

One last question though: if i'm working with BlackBerry JRE 5.0, does that mean that i'm working with OS 5.0? Because that will mean that thread you suggested me it's not for me...

 

Thanks a lot!

Developer
Posts: 1,055
Registered: ‎01-25-2009
My Device: BlackBerry Bold 9650/BlackBerry Torch 9800

Re: Connector problem

What you asked is true. If you are working with JRE 5.0, you are developing for OS 5.0 or greater.

 

If your application works on OS 5.0, it should work on OS 6.0 with a few tweaks here or there.

 

Regardless, the thread that was posted is a great starting point no matter which OS you're developing for.

Jerome Carty - Follow jcarty on Twitter@jcarty | #webworks-dev / #BlackberryDev on irc.freenode.net | My Apps
Click "Accept as Solution" if post solved your original issue.. Give like/thumbs up if you feel post is helpful
Developer
Posts: 90
Registered: ‎09-07-2010
My Device: Not Specified

Re: Connector problem

Thanks for your fast answers! Smiley Happy