×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Regular Contributor
    Join Date
    Mar 2007
    Posts
    104

    Max filesize for recordstore?

    Hello everyone,

    I am writing a little game for my java mobile and was wondering if there is a maximum filesize for files i want to save in the recordstore.

    I know there is a maximum of space i can use in the recordstore but what i would like to know is if i have enough space in the recordstore, is there another limit about filesize?

    My little game is tilebased and i would like to save all the tiles in one file

    i could use more files if there were a maximum filesize but i have no clue if there is one:-)

    Thx a lot for any hints anyone could share:-)

  2. #2
    Regular Contributor
    Join Date
    Aug 2006
    Posts
    307

    Re: Max filesize for recordstore?

    The capacity of RecordStore is always platform specific, and varies from phone to phone.

    Use the method RecordStore.getSizeAvailable() in order to get the number of bytes you can add to existing record store.

    The method RecordStore.getSize() will return you the amount of bytes that the record store already occupies.

    Also, if tales are stored in file(s), you can simply store the last tale index or it's offset in the RMS.

    The reason for such implementation is quite simple: the RMS is usually much slower than file I/O, and it probably will slow the game performance.
    Last edited by axs; 2007-05-09 at 07:26.

  3. #3
    Regular Contributor
    Join Date
    Aug 2006
    Location
    Rawalpindi, Pakistan
    Posts
    486

    Re: Max filesize for recordstore?

    AXS is right. recordstore will slow the process and as far as i have seen from my experience i dont think record store will allow u store data more than IMB and that also if ur lucky because as AXS said it is also paltform specific.
    Regards
    Nouman

  4. #4
    Regular Contributor
    Join Date
    Mar 2007
    Posts
    104

    Re: Max filesize for recordstore?

    IMB == 1 MB?

    The problem is that the size of the image files exeeds my maximum size of the jar file.

    Because of this i was going to store the images in the recordstore since i thought this was the only option other than downloading them on demand.

    I didnt think i had access to the filesystem with j2me other than the recordstore.

    Are you saying i have other options than the recordstore?
    Last edited by Rozik; 2007-05-11 at 14:56.

  5. #5
    Regular Contributor
    Join Date
    Aug 2006
    Location
    Rawalpindi, Pakistan
    Posts
    486

    Re: Max filesize for recordstore?

    Have checked file connection API. it allows you to read and write files from specific folders. may be you can store your image in the mobile phone an then read it from midlet. and yes 1 MB
    Regards
    Nouman

  6. #6
    Regular Contributor
    Join Date
    Mar 2007
    Posts
    104

    Re: Max filesize for recordstore?

    Well i did read about the file connection api too.

    But since my application isnt signed its not guaranteed to work on any device:-(

    I guess i am stuck with the recordstore:-) Or is there soemthing like a private folder for midlets like there is for symbian applications?
    Last edited by Rozik; 2007-05-14 at 13:45.

  7. #7
    Regular Contributor
    Join Date
    Aug 2006
    Posts
    307

    Re: Max filesize for recordstore?

    Quote Originally Posted by Rozik

    ...The problem is that the size of the image files exeeds my maximum size of the jar file...

    Just my 2 cents. The problem(s) of image sizes are quite common for the Java games.

    Here you can find some information about the topic, MIDP 2.0: Game API Developer's Guide (with Example) v2.0: http://www.forum.nokia.com/info/sw.n..._0_en.zip.html

    Also if you have to use images (with character faces, landscapes, etc.), then the only way to solve this problem is optimization.

    For example, try different image formats: gif, png, jpeg. Try different resolutions and compressions. Simple graphics may be stored in gif format; png and jpeg are better for complicated graphics.

    Also one tip for you: don't forget, that you can place images on top of each others. This way you'll be able to use the same landscape images, and put different character faces on top of them, and so, to reduce the amount of data in your images.

    Also don't forget about transparency and optimized image sizes. For example, a jpeg file of 64*64 size may occupy less space than 60*60 pixels one, because jpeg format attitudes graphical content to the 8*8 pixels grids.

    And by the way, can you simply hardcode tales inside the Java code or JAR? This way you could simply put nicely and optimizelly composed graphics on the screen, and draw text on top of it by using Graphics methods, not the image files.
    Last edited by axs; 2007-05-15 at 11:10.

  8. #8
    Regular Contributor
    Join Date
    Aug 2006
    Location
    Rawalpindi, Pakistan
    Posts
    486

    Re: Max filesize for recordstore?

    nice tips AXS

    thanx
    Regards
    Nouman

Similar Threads

  1. 6230 JAR max filesize
    By Wontar in forum Mobile Java General
    Replies: 3
    Last Post: 2007-01-30, 12:31
  2. OTA max jar size
    By lewsterin in forum Mobile Java General
    Replies: 4
    Last Post: 2006-01-27, 09:47
  3. The correct meaning of MAX JAR size
    By bigrio in forum Mobile Java General
    Replies: 1
    Last Post: 2004-11-16, 10:30
  4. max filesize of wallpaper/screensaver
    By auffi in forum General Development Questions
    Replies: 0
    Last Post: 2004-01-19, 11:24
  5. max. filesize
    By slemper in forum Digital Rights Management & Content Downloading
    Replies: 1
    Last Post: 2002-09-13, 06:58

Posting Permissions

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