-3

How to add images asynchronously on every row of an ListField?

Rupak
  • 3,674
  • 12
  • 23
VK.Dev
  • 801
  • 3
  • 11
  • 24
  • do u want load then from WEB / Local ? – Aditya Apr 19 '12 at 13:47
  • do u mean that u need to load these Images from Web ? 1. You can use Vector to quee D/L urls. 2. Load them in seperate threads. 3. After each Bitmap is D/L add it to another Vector. (This is for cache) – Aditya Apr 19 '12 at 14:01
  • break the problem in smaller parts, and from those parts specify only the parts on which you need help. – Rupak Apr 19 '12 at 18:20

1 Answers1

1

Follow these steps.

  1. Use Model-View-Controller (MVC) pattern to plan your class hierachy and relationships.
  2. Use additional threads to load images and notify view listener (in MVC-notation) when an image has been loaded.

Note, that a single application can create up to 16 threads. The total number of threads that can exist on a BlackBerry device from all applications is 128.

Therefore, if an application has already created 16 threads, the 17th attempt fails and a TooManyThreadsError exception is thrown.

Similarly, if there are 128 threads already created on the BlackBerry device and an application attempts to create another thread, a TooManyThreadsError exception is thrown.

  • Would you please provide the link where I can get the specification about number of permissible concurrent threads (device specific information). And If I use a Thread pool then what is the practical value of the pool size? – Rupak Apr 19 '12 at 18:51
  • Might be worth asking a new question for that – donturner Apr 19 '12 at 18:55
  • There is no ThreadPool class support in RIM API SDK. And here is the link to developer knowledge base about threads qty limitation: http://goo.gl/CukYy –  Apr 19 '12 at 18:57
  • @RafaelOsipov, Thank you, but the article was last updated on `07 June 2006` :(. I'm using a custom ThreadPool, and sometimes I have to adjust (decrease) the thread pool size for some earlier BlackBerry devices. @donturner, thank you, I will ask a new question if I didn't find anything useful. – Rupak Apr 19 '12 at 20:00
  • For now nothing changed regarding threads limitation. It is BlackBerry device OS architecture limitation. You can try to make 17 threads on the most recent device with RIM OS 7.1 installed. –  Apr 20 '12 at 02:25