×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Oct 2009
    Posts
    7

    App freezes when downloading photos

    Hi
    Ive been on this site for sometime now and I guess its time to get out of the woodwork. I have an app that downloads images one at a time and displays them on the phone. The problem is, it is unpredictable n the number of image it will load before hanging. It works fine on the emulators (both s40 5th and 6th edition and s60 emulators) but it hangs on the phone. Problem is, it does not throw any erros, it simply freezes and stops working.

    Ive traced the problem to Image.createImage(Inputstream) (where the app freezes). Substituting this with Image.createImage(byte, int, int) or Directutils.createImage(byte[], int, int) still doesn't work. Ive tried looking for answers but they all point to memory errors and exceptions, which is not my case.

    Am using the Nokia e61i, anybody know a possible solution to this?

  2. #2
    Nokia Developer Expert
    Join Date
    Aug 2007
    Posts
    1,595

    Re: App freezes when downloading photos

    Hello frank_d_man,

    and welcome to Forum Nokia Discussion Boards!

    How large are those images which the application downloads?

    In case of large images, one way of resolving the issue is to download in smaller data chunks instead of downloading the whole picture at once.

    Regards,
    r2j7
    [URL="http://library.forum.nokia.com/java"][B] >>> Java Developer's Library <<<[/B][/URL]
    [URL="https://www.developer.nokia.com/Resources/Support/Technical_support.xhtml"] [B]>>> Technical Support for Java ME development <<<[/B][/URL]
    [URL="https://publish.ovi.com/info/"][B]>>> Nokia Publish: reach millions of Nokia users worldwide through Nokia Store <<<[/B][/URL]

  3. #3
    Registered User
    Join Date
    Oct 2009
    Posts
    7

    Re: App freezes when downloading photos

    Hi, sorry for taking so long to respond. The images are between 21 - 35 kb jpeg. I tried downloading png but it had the same result. Just found out that the problem is on some particular photos. The photos are not any different from the others. If I download these photos first, then the app freezes on the next download. But if I download others first, the app freezes when downloading these particular photos. Other photos download ok. I will be adding more photos with time. Problem is how do I know which photos can bring problems and which ones will not?

  4. #4
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: App freezes when downloading photos

    Hello,
    Just found out that the problem is on some particular photos. The photos are not any different from the others. If I download these photos first, then the app freezes on the next download.
    Well I wonder after reading these lines, that some photo's are creating the issues and some are not.Please share the size of the photo's those are not creating the issues.


    As you are saying that...
    It works fine on the emulators (both s40 5th and 6th edition and s60 emulators) but it hangs on the phone. Problem is, it does not throw any erros, it simply freezes and stops working.
    So please share that on which device are you testing the application?
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  5. #5
    Super Contributor
    Join Date
    Apr 2007
    Posts
    2,708

    Re: App freezes when downloading photos

    jsut out of curiosity : how big are those photos ? And with that I mean it's resolution in pixels not it's compressed jpeg size ?

  6. #6
    Registered User
    Join Date
    Oct 2009
    Posts
    7

    Re: App freezes when downloading photos

    Quote Originally Posted by Tiger79 View Post
    jsut out of curiosity : how big are those photos ? And with that I mean it's resolution in pixels not it's compressed jpeg size ?
    The resolution is 72 pixels per inch. They are between 300X225 to 300X229. That means between 67500 - 68700 pixels.Some new developments.

    1. Im sorry I misled myself and you there. The photos used in the emulator were different form the ones online. When I realized it only freezes on particular photos, I configured the emulator to get the images online, it died with IllegalArgumentException: invalid frameWidth or frameHeight.

    2. I am using KUIX. Here is the excerpt:

    Image displayImage = Image.createImage(input);
    System.out.println("image downloaded");
    System.out.println("Image size: "+displayImage.getHeight()+"X"+displayImage.getWidth()); [added yesterday ]
    display.removeAll();
    display.setImage(displayImage);

    The exception
    image downloaded
    Image size: 207X275 ---------> previous Image this displays fine
    image downloaded
    Image size: 209X275
    java.lang.IllegalArgumentException: invalid frameWidth or frameHeight
    at javax.microedition.lcdui.game.Layer.setTileImage(Layer.java:118)
    at javax.microedition.lcdui.game.Sprite.setImage(Sprite.java:125)
    at org.kalmeo.kuix.widget.Picture.doLayout(Unknown Source)
    at org.kalmeo.kuix.widget.Widget.setBounds(Unknown Source)
    at org.kalmeo.kuix.layout.InlineLayout.measure(Unknown Source)
    at org.kalmeo.kuix.layout.InlineLayout.doLayout(Unknown Source)
    at org.kalmeo.kuix.widget.Widget.doLayout(Unknown Source)
    at org.kalmeo.kuix.widget.ScrollPane$1.doLayout(Unknown Source)
    at org.kalmeo.kuix.widget.Widget.setBounds(Unknown Source)
    at org.kalmeo.kuix.layout.BorderLayout.measure(Unknown Source)
    at org.kalmeo.kuix.layout.BorderLayout.doLayout(Unknown Source)
    at org.kalmeo.kuix.widget.Widget.doLayout(Unknown Source)
    at org.kalmeo.kuix.widget.Widget.setBounds(Unknown Source)
    at org.kalmeo.kuix.layout.GridLayout.measure(Unknown Source)
    at org.kalmeo.kuix.layout.GridLayout.doLayout(Unknown Source)
    at org.kalmeo.kuix.widget.Widget.doLayout(Unknown Source)
    at org.kalmeo.kuix.widget.Widget.setBounds(Unknown Source)
    at org.kalmeo.kuix.layout.BorderLayout.measure(Unknown Source)
    at org.kalmeo.kuix.layout.BorderLayout.doLayout(Unknown Source)
    at org.kalmeo.kuix.widget.Widget.doLayout(Unknown Source)
    at org.kalmeo.kuix.widget.Screen.doLayout(Unknown Source)
    at org.kalmeo.kuix.widget.Widget.setBounds(Unknown Source)
    at org.kalmeo.kuix.layout.GridLayout.measure(Unknown Source)
    at org.kalmeo.kuix.layout.GridLayout.doLayout(Unknown Source)
    at org.kalmeo.kuix.widget.Widget.doLayout(Unknown Source)
    at org.kalmeo.kuix.widget.Desktop.doLayout(Unknown Source)
    at org.kalmeo.kuix.widget.Desktop.revalidate(Unknown Source)
    at org.kalmeo.kuix.core.KuixCanvas.forceRevalidate(Unknown Source)
    at org.kalmeo.kuix.core.KuixCanvas.access$10(Unknown Source)
    at org.kalmeo.kuix.core.KuixCanvas$2.run(Unknown Source)
    at org.kalmeo.util.worker.Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

    At least I now know the error comes from Kuix, but how do resolve it?

    2. I am using PHP to resize the images to fit any requesting screen size. However, even the resized image still freezes on these particular images.

  7. #7
    Registered User
    Join Date
    Oct 2009
    Posts
    7

    Re: App freezes when downloading photos

    Solved!
    Hey thanks guys. Talking about this issue has really given me perspective about it. This issue disturbed me for more than 2 weeks. Giving me direction. When I realized it was all in Kuix, I simply did:
    display.setFrameWidth();
    display.setFrameHeight();
    display.setImage();

    Good day to you all

Similar Threads

  1. N95 - Signed app gives 'Unable to Install'
    By ariejan in forum Mobile Java General
    Replies: 46
    Last Post: 2010-02-21, 20:47
  2. J2ME App Signing
    By kristian82 in forum Mobile Java Networking & Messaging & Security
    Replies: 3
    Last Post: 2010-01-25, 18:03
  3. Replies: 6
    Last Post: 2008-08-07, 10:31
  4. Downloading problem after signing an app
    By sunil.dce in forum Mobile Java General
    Replies: 5
    Last Post: 2006-12-08, 07:26
  5. downloading photos from 7650 to PC
    By mjamericano in forum Mobile Java General
    Replies: 2
    Last Post: 2002-09-16, 12:02

Posting Permissions

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