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
New Developer
lilbyrdie
Posts: 11
Registered: ‎08-21-2009
My Device: Not Specified

Reading Gallery images on OS 5 beta 4 - new issue?

In OS 4.x, I had the following code that would read in images from the default pictures directory. It worked fine:

 

 

FileConnection fileConn = (FileConnection)Connector.open(file);InputStream input = fileConn.openInputStream(); // TODO: available now returns 0 bytes. Why?int available = input.available();byte[] encodedData = new byte[available];input.read(encodedData, 0, available);

 

The available size now returns 0 bytes so, of course, the read doesn't actually read anything. Is this a new bug in OS 5 or was there some change that I'm not yet aware of? Is there some new setting I need to configure? 

 

Thanks for any info or insight! 

 

Please use plain text.
Developer
BBDeveloper
Posts: 3,951
Registered: ‎07-15-2008
My Device: Not Specified

Re: Reading Gallery images on OS 5 beta 4 - new issue?

You mean, you trying to read the default pictures shipped in device photo gallery?

Use Search. "Accept Solution" If the problem is resolved.
Please use plain text.
New Developer
lilbyrdie
Posts: 11
Registered: ‎08-21-2009
My Device: Not Specified

Re: Reading Gallery images on OS 5 beta 4 - new issue?

No, that's not what I mean.

 

I mean I'm trying to read images the user (in this case, me) has saved to the direct. These usually end up there via the camera.

 

As stated in the previous post, this reading worked fine in OS 4.x. The files are still found there; the file names are correct.  The issue is that the available bytes is listed as zero. The default gallery application has no trouble reading the images, so they're valid.

 

Thanks! 

Please use plain text.
Developer
BBDeveloper
Posts: 3,951
Registered: ‎07-15-2008
My Device: Not Specified

Re: Reading Gallery images on OS 5 beta 4 - new issue?

Check with some other read methods withour using available method.

Use Search. "Accept Solution" If the problem is resolved.
Please use plain text.
New Developer
lilbyrdie
Posts: 11
Registered: ‎08-21-2009
My Device: Not Specified

Re: Reading Gallery images on OS 5 beta 4 - new issue?

I know there are a bunch of other possible ways of doing this. 

 

That's not really the point. The point is that it's not the same anymore.

 

The question is:

 

Is that by design? If so, everyone affected will have to create a work around.

 

Is that a bug in OS 5? If so, I can leave my code alone and let the platforms developers fix it before OS 5 is out of beta.

Please use plain text.
Developer
BBDeveloper
Posts: 3,951
Registered: ‎07-15-2008
My Device: Not Specified

Re: Reading Gallery images on OS 5 beta 4 - new issue?

Absolutely, that was not the problem, what I felt was If you find a way that works with different module, you could escalate the issue to RIM with the details and it will be good for them to trace it. For other users it will be a workaround till the bug is fixed.

 

We could wait till RIM give back the reason.


Use Search. "Accept Solution" If the problem is resolved.
Please use plain text.
New Developer
lilbyrdie
Posts: 11
Registered: ‎08-21-2009
My Device: Not Specified

Re: Reading Gallery images on OS 5 beta 4 - new issue?

Right, I understand your meaning now. Thanks for clarifying. :smileyhappy:
Please use plain text.