10-15-2012 02:58 AM
i have to display images on the screen by downloading it,so if images are more i need to download the images for the field which is visible on the screen.
please any one give me the idea.
10-15-2012 03:01 AM
10-15-2012 05:08 AM
Thanks for reply
please can you give me a code example how to use isvisible() method to check visible field on the screen while scrolling up an down. actualy i am using it but every time it is showing false either by scroling field is visible or in visible.
10-15-2012 05:18 AM
10-15-2012 09:37 AM
In fact, isVisible is not exactly the best method to use if you want to download the pictures when needed. You don't want to constantly check it - it would be better to be notified by the system when your Field becomes visible. Fortunately, you have onVisibilityChange method to tell you that. Override it the way you want - check the parameter and, if it's true, initiate the download.
You want to serialize the download requests, however - downloading more than one file simultaneously from the same location is pointless. You can use producer-consumer design pattern for the downloads and subscribe-publish to display the images once the download is finished. Your Fields will "produce" download requests which will be "consumed" and processed by a separate download thread. On the other hand, your Fields with "subscribe" to the "download complete" events which will be "published" by that thread.
Make a Google search on those design patterns and try coding everything on your own - it will be a tremendously useful exercise which cannot be replaced by simply copying any code people might post here. If you have specific problems doing that, show what you've done and what's not working and we will help.