Thank you for visiting the BlackBerry Support Community Forums.
BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)
BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.
"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."
- Kevin Michaluk, Founder, CrackBerry.com
Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.
11-13-2010 03:16 AM
I am just using static method for streamconnection to retreive images over from server.
Now my problem is that it takes to much time to load.
so i want that at the first just insert null images to all the fields and there after as the thread retrieves the image same time it will update the field with that image.
Solved! Go to Solution.
11-13-2010 03:20 AM
Why don't you use the HttpConnection instead of StreamConnection.
And image Size is to Big or small. It should not take much time to download.
Press Kudo to say thank to developer.
Also Press the Accept as solution Button when u got the Solution.
11-13-2010 04:42 AM
if i am using httpconnection and if there are number of images then what?
so what i want is first initially load 5 or 10 images to the screen there after as the images retrieve draw them to the screen.
11-13-2010 10:41 AM
Not sure how we can help here. The approach you are suggesting is exactly what i would recommend. Start a background Thread, have it process a list of images, and as they arrive, advise the Ui Processing so that it can update the screen.
11-13-2010 11:28 AM
Get familiar with "observer pattern":
In your case, observer (or listener, in BlackBerry speak) will be your UI element which wants to paint the image. Initially, you will have null as the reference to the image and your paint() method will skip painting it.
Later, once the image is downloaded in a separate thread, that thread will notify your UI via some listening method registered to be notified about that image. That method will populate your internal reference to the image and call invalidate().
invalidate() will cause your paint() method to be called. At this point, paint() will notice a non-null reference to the image and will draw it as intended.
There might be other approaches - the above is one of the many. It is both object-oriented and efficient enough.
11-15-2010 01:42 AM