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
Regular Contributor
milan555
Posts: 52
Registered: ‎07-04-2011
My Device: Bold-3

Download image in custom list

Hello Friends,

 

I made 1 custom list field, in which I have to show image which I download from server.

But if I download all image at one time it took so much time.

So I want to do one thing that when user scroll the list & which items stay on screen/saw on device, only those images have been called for download.

Means one type of lazy loading.

 

So,can  any one help me that how can I resolve this issue.

 

Thanks,

 

 

Please use plain text.
Developer
peter_strange
Posts: 19,604
Registered: ‎07-14-2008
My Device: Not Specified

Re: Download image in custom list

Haven't you already asked this question?

 

http://supportforums.blackberry.com/t5/Java-Development/Lazy-Loading/td-p/2057629

 

The only difference between the answer given in that Thread and this Thread is that you don't add the images to be downloaded to the queue until they have been displayed on the device.  But in fact I suspect that is a little difficult and too late too.  Say you have a screen of 5 entries, and you have downloaded the images.  Then you might as well download the 6th one (that is off screen) so that when the user does scroll, they will see it immediately. 

 

Instead I would recommend two things:

a) paging your request, so that the user gets say the first 25, and then can request more of there are any. 

b) being able to cancel the downloads if the user leaves the page before the download has completed. 

 

I also recommend that you look at the option of caching the images on the device, so that you don't download them again - the SD Card is a good place for this. 

Please use plain text.