×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Dec 2003
    Posts
    5

    App written for 3650 will not run on 7210?

    Hello,

    I have written an application which will run on all series 60 and 90 devices, and even the 3410, however it will not run on series 40 phones.

    I recieve the error : Unable to run application

    Is there something simple that I am missing here?
    The application in only 27K, and is very simple using only MIDP 1 and no 3rd party API's.

    Thanks in advance

    --
    Last edited by Nokia Ron; 2008-10-08 at 22:35. Reason: Remove address

  2. #2
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395
    Series 40s tend to be more fussy than 60s. Check that your JAD and manifest content are right. If you've built with WTK2.0, your manifest may contain 2.0 version tags that 40s won't like, for example.

    Does it run on the 7210 emulator? The emulator does not perform all the same checks on the JAD and JAR content that the phone does, except when started with the -provisioning option. If your app runs without the -provisioning option, but not with, then your JAD/manifest are almost certainly causing the problem.

    On OTA downloads, 60s aren't bothered about content-type header tags, but 40s are; for 40s (and, I think, 30s) the header must show the correct MIME types for both JAD and JAR.

    Graham.

  3. #3
    Registered User
    Join Date
    Dec 2003
    Posts
    5

    Memory Issues

    Thanks for replying...

    I spent a while watching the classes loading and the exceptions etc.
    It seems that the App loads on the 7210, but falls over with an out of memory exception when I try to instantiate an object I've written to display on the screen.

    Is it just that the 7210 doesn't have enough memory?

    --
    Last edited by Nokia Ron; 2008-10-08 at 22:35.

  4. #4
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395
    Could be... that would explain why it works on the 3410.

    The 3410 has a smaller heap than the 7210, so in case that doesn't make much sense, I'll explain. When Nokia phones load images, they get expanded from PNGs into the device's native format. For a monochrome phone (like the 3410), images expand to a pair of 1 bit per pixel bitmaps, one for the image and one for the transparency mask. On the 4096-colour phones (like the 7210), images expand to two bytes per pixel - four bits for each of red, green, blue and alpha (opacity).

    In both cases, this is irrespective of the original image format. The 3410 loads all images with a transparency mask, even if the image does not contain transparent pixels. And the 7210 will load an image in 4096 colours even if it's monochrome.

    (The same goes for images created with createImage(int width, int height).)

    The result is that an application that will load on a mono phone may fail on a colour phone with a larger heap size, because of the increase in its memory requirement.

    If you are loading large (or many) images (which would surprise me from a 27k JAR) or creating sizable in-memory image objects, then this would explain things.

    If you're testing with the emulator, you can increase the heap size by adding to the command line:
    Code:
    7210.exe -heapsize 300000 myapp.jad
    where 300000 is the size in bytes of the heap you want. (It must be in bytes, and can be from 0 to 1048576.) Standard heap size is about 200k. Of course, you can't increase the heap on the real phone, but it will at least give you an opportunity to test whether memory is the problem.

    Graham.

  5. #5
    Registered User
    Join Date
    Dec 2003
    Posts
    5
    Thanks again,

    I upped the heap size but that didn't seem to make a difference.
    However, I think you're right about this.....

    I have extended the canvas object so that it effectively contains an array of objects (which I call gItems), each of which has a 'paint' method that draws onto the canvas. So the canvas paint method actually calls the paint methods of all visible gItems in the array.

    The out of memory error seems to occur twice in my app.
    Once when I call the splash screen (which is a gItem), and once when the 'top scores' item is displayed (again a gItem)

    Both gItems use createImage.

    I've read the PDF which explains how to optimise your images for display, however that doesn't seem to help..

    I can use System.getProperty to determine whether I'm on a series 40 and drop the splash screen..... But I can't really live without the top scores table.

    What do you suggest?

    --
    Last edited by Nokia Ron; 2008-10-08 at 22:34.

  6. #6
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395
    Do you keep all the images, all the time? If possible, discard any images you don't want anymore, and recreate/reload them if you need them again.

    Or are you using images as buffers for drawing onto? If so, draw directly onto the screen.

    Graham.

  7. #7
    Registered User
    Join Date
    Dec 2003
    Posts
    5
    I can't really draw directly onto the canvas. It messes up the object model. I don't really know what to do next. I suppose I could just remove the top scores screen when on a phone which isn't a 60 series.

    I'll stick at it.. and if I find a solution I'll let you know.. Thanks for your help..

Posting Permissions

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