×

Discussion Board

Page 2 of 2 FirstFirst 12
Results 16 to 19 of 19
  1. #16
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,699

    Re: LWUIT: Loading Images on Background Thread

    It is important to remember that Asha is not Android. Built-in applications are not Java-based, so neither the functionality nor the performance is comparable with whatever a Midlet can do.

  2. #17
    Registered User
    Join Date
    Sep 2013
    Posts
    50

    Re: LWUIT: Loading Images on Background Thread

    I've found that I can avoid the "file not found" exception by inserting a Thread.sleep(1000) at the beginning of the scaleFinished() listener. Not sure why this helps, but it demonstrated something interesting. As the images slowing load on the grid, 1 per second, I am unable to scroll or interact with the grid in any way.

    Why is this locking up the UI?

  3. #18
    Nokia Developer Champion
    Join Date
    Mar 2013
    Posts
    686

    Re: LWUIT: Loading Images on Background Thread

    the ImageScaler API works Asynchronuasly which mean that you have a callback/listener mechanizm to know when the actual scale was finished and the file was created, it seems to me from your description that your "not finding file" and have to wait 1 sec to get file is that you try to use it in a synchronized way i.e. trying to read the file right after you made the call to the ImageScaler API.
    you should use the addListener(ImageScalerListener listener) to add a listener and know when the file is ready and only then read it.

  4. #19
    Registered User
    Join Date
    Sep 2013
    Posts
    50

    Re: LWUIT: Loading Images on Background Thread

    I'm already using the ScaleFinishedListener.

    In an effort to narrow down the cause of this problem I did some experiments. I removed everything from my background thread except Image.createImage(). If I do this, I experience the same problem. The UI locks up until all images have been loaded into memory. However, if I remove the calls to Image.createImage(), and throw a Thread.sleep(1000) in there, the problem disappears; I can freely scroll while the background thread runs.

    So clearly the problem is Image.createImage(). Maybe it is just using too much memory/CPU trying to load in these large images? The gallery app doesn't seem to have this problem. And I still don't understand why it's interfering with the UI.

Similar Threads

  1. Issue in loading images into command in lwuit for nokia s40
    By rchadalawada in forum Mobile Java General
    Replies: 13
    Last Post: 2013-03-08, 09:31
  2. Lwuit circle loading bar
    By mjagadeeshbabu in forum Mobile Java General
    Replies: 0
    Last Post: 2011-05-06, 13:17
  3. loading midlet from lwuit
    By simsimlhr in forum Mobile Java General
    Replies: 1
    Last Post: 2008-11-03, 19:56
  4. Tip: Loading modules in a background thread
    By bercobeute in forum Symbian
    Replies: 1
    Last Post: 2006-02-27, 05:19
  5. Loading 2 Images Loading Problem
    By nimbus_cloud in forum Symbian Media (Closed)
    Replies: 1
    Last Post: 2005-08-26, 05:51

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×