×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Apr 2009
    Posts
    3

    Problem in creating image in nokia s40

    hi everybody,

    I used this line of code to create an image:

    offScreenImage = Image.createImage(getWidth(), 20 * bitmapFont.getHeight());

    I ran this code in 6270. But when application reachs this line it throws OutOfMemory error.
    This occurs only on s40 phones.
    It is OK on Nokia s60, SE and emulator.

    Can anybody help how I can fix this problem?

    thanks in advance!

  2. #2
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Problem in creating image in nokia s40

    What are the height and width?

  3. #3
    Registered User
    Join Date
    Apr 2009
    Posts
    3

    Re: Problem in creating image in nokia s40

    its around :

    width: 217
    height: 380

  4. #4
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Problem in creating image in nokia s40

    Well... it throws an OutOfMemoryError because you don't have enough memory. In this case, you probably need around 320k free to create the image.

    You need to use less memory.

    Cheers,
    Graham.

  5. #5
    Registered User
    Join Date
    Apr 2009
    Posts
    3

    Re: Problem in creating image in nokia s40

    thanks!

    could you please help me how i can resolve this issue?
    is there any better way or a solution for memory managment?

  6. #6
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Problem in creating image in nokia s40

    There's no magic. You just have to keep fewer images in memory. Discard any images you don't need. Avoid creating large double-buffer images like you are doing here.

    My other top-tip: when you write a game or application for mobile devices, start with a the lowest specification device you want to support. Then you won't have nasty surprises like this one.

    Cheers,
    Graham.

Similar Threads

  1. What is the real problem to receive data calls with Nokia TDMA cel modems?
    By jackal_jr in forum PC Suite API and PC Connectivity SDK
    Replies: 1
    Last Post: 2002-12-09, 09:02
  2. What is the real problem to receive data calls with Nokia TDMA cell modem?
    By jackal_jr in forum PC Suite API and PC Connectivity SDK
    Replies: 0
    Last Post: 2002-12-04, 16:05
  3. Http connection problem in 6310i
    By teahola in forum Mobile Java General
    Replies: 1
    Last Post: 2002-10-03, 18:46

Posting Permissions

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