×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Oct 2003
    Location
    Bangladesh
    Posts
    41

    Games Development Tips For Series 40

    GAMES DEVELOPMENT TIPS FOR SERIES 40

    What are the things to consider to develop games for series 40.

    For example, we all know that the maximum jar size can be 64kb for series 40.

    Not all programmers know about all the limitations and special cases. Like any limitation of

    the graphics dimension, or size, or color? Any special bugs? Any performance tips? Or anything that might be useful for series 40 developers.

    Now i have a specific question. What should the maximum dimension of an image? Can it exceed the resolution of the mobile screen?

    Thanks .
    Asif.

  2. #2
    Super Contributor
    Join Date
    Mar 2003
    Location
    Israel
    Posts
    2,280
    Yes, images can be bigger than the screen. The only limitation I am aware of is available heap memory. An image takes (2 * [number of pixels] + [some overhead for the header(probably constant)]) bytes when loaded. As long as there is enough (unfragmented) memory available you shouldn't have any problems.

    shmoove

  3. #3
    Registered User
    Join Date
    Oct 2003
    Location
    Bangladesh
    Posts
    41

    heap usage information

    i have made 2 games for series 60, and they are both below 64kb, one of them is 48kb, and the other one is 56kb.
    But none of them can be run on series 40.

    When i run it on the series60 emulaor, the top of the screen shows that both the game takes around 112kb of heap.

    Now is there any specific way of knowing what is the max amount of heap my games are using?

    What are the other possible factors that i should consider?

  4. #4
    Super Contributor
    Join Date
    Mar 2003
    Location
    Israel
    Posts
    2,280
    Notice the "unfragmented" comment in my last post. Nokia garbage collector in Series 40 are non-compacting. This means that if you are creating and destroying objects, specially big objects like images, you're memory is going to get fragmented pretty quickly. Then, even if you have enough memory to load an image, the memory isn't in a contiguous block so you get an out of memory error. So the first rule is to load all your big images in the beginning and keep them in memory to prevent the fragmentation.
    To monitor the memory usage of you app you can use the Runtime.freeMemory() and Runtime.totalMemory() functions. Don't trust totalMemory() on Series 60, though, because these phones have a dynamic heap so the value for totalMemory() can increase in time. On Series 40 phones you have a little over 200KB. Try to keep memory usage below 200KB and you should be fine (except for the aforementioned fragmentation issue).

    shmoove

  5. #5
    Regular Contributor
    Join Date
    Jun 2003
    Location
    Hungary
    Posts
    414
    There is a maximum image width on certain devices and as I remember it apply to the/some S40 too (~256px).

  6. #6
    Super Contributor
    Join Date
    Mar 2003
    Location
    Israel
    Posts
    2,280
    Really? I've never seen it. But then again, all my filmstrips are vertical so I never had any images that wide.

    shmoove

  7. #7
    Regular Contributor
    Join Date
    Jun 2003
    Location
    Hungary
    Posts
    414
    I encountered this bug on other device (?Sharp GX-10?) and metioned to a Nokia developer who had a strange bug use vertical strip. It solved his problem.

Posting Permissions

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