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: 58
Registered: ‎07-09-2009
My Device: Blackberry Bold
Accepted Solution

Loading web images on actual BB device issue

[ Edited ]

I have been developing my first Blackberry app for the past month or two and everything works well and good in the simulator. However I have been encountering several problem on actual devices. Most of them I can debug in one way or another however one has got me pretty baffled. 

 

In my application I load images from the web via the "WebBitmapField" which I found online and hastily used (maybe regrettably now). This works fine on the numerous simulators I have installed on my computer. I have also installed the application on several co-workers phones which include: Bold, Curve, 8900, Storm. However the images do not load on my particular Blackberry Bold. At first I believed this to be an application permission setting somewhere, however I have set all the permissions to "Allow" for my application on my phone.  

 

What makes it more baffling is my application receives data perfectly fine from a restful web service. The only difference between the data and the images is they are retrieved from akamai servers, which needs to be done based upon the architecture of our site.  I went to these image urls from the phone's browser, and they load fine. 

 

Does anyone have any ideas? Or run into similar issues?

 

Any help is appreciated.

Thanks.

Message Edited by ksykulev on 07-27-2009 11:12 AM
Developer
Posts: 173
Registered: ‎06-11-2009
My Device: Not Specified

Re: Loading web images on actual BB device issue

Are you using signed APIs, line MapField ?
Developer
Posts: 58
Registered: ‎07-09-2009
My Device: Blackberry Bold

Re: Loading web images on actual BB device issue

I am using signed APIs.. But I do request signatures before I load it onto my device.
Developer
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: Loading web images on actual BB device issue

What type of connection parameters are you using?

 

Here is why I ask:

 

On the simulator, you are running your request via MDS-CS, which will handle things like re-directs and cookie caching for you. 

 

If you are using a Direct TCP connection on the device, and you get a link re-direct, then you would have to perform the redirection from your code (detect the "relocated" response and re-launch on the redirected URL).

 

Just a suggestion: try tracing (System.out.println) out all of your response codes and HTTP headers and run this on the device, tethered to the debugger. This might point you in the right direction.

 

Developer
Posts: 58
Registered: ‎07-09-2009
My Device: Blackberry Bold

Re: Loading web images on actual BB device issue

I'm just doing a basic connection nothing fancy:

 

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

 

I also do a trace already for this:

                if (responseCode != HttpConnection.HTTP_OK) {
                    throw new IOException("HTTP response code: "
                    + responseCode);
                }

 

 

And I don't really get any exceptions thrown in my debugger. But maybe i'll do a system.out.println there as well just in case to see if the response codes differ.

 

Thanks for your help.

Developer
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: Loading web images on actual BB device issue

[ Edited ]

Are all of these test devices on a BES network?

 

I ask because without connection parameters, and without BES, you won't get very far on most networks.

 

 

 

 

Message Edited by RexDoug on 07-27-2009 01:54 PM
Developer
Posts: 58
Registered: ‎07-09-2009
My Device: Blackberry Bold

Re: Loading web images on actual BB device issue

Yes all of these test devices are connecting through BES.

 

Interestingly enough, all data communication(GET/POST) through application works, all except for the images.

 

Developer
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: Loading web images on actual BB device issue

I think you need to coordinate some testing with your BES security administrator.  Smiley Happy

 

Developer
Posts: 58
Registered: ‎07-09-2009
My Device: Blackberry Bold

Re: Loading web images on actual BB device issue

While I am on the subject.. i might as well ask this question as well.

 

What kind of parameters do I need to pass to my http connection if say my phone is not on BES?

Highlighted
Developer
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: Loading web images on actual BB device issue

That depends on your carrier, network, and device. 

 

Check the Peter Strange sticky thread at the top of the forum.