This week's giveaway is in the Programmer Certification (OCPJP) forum.
We're giving away four copies of Java Mock Exams (software) and have David Mayer on-line!
See this thread for details.
Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How many records can we store

 
Ransika deSilva
Ranch Hand
Posts: 524
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I am planning to wirte an application for the MIDP 2.0 enabled phones. I want to store some names in a RM Store. What I want to store is some words, but each character should be stored in unicode value. For Example, if I want to save "Hello", I would be saving the Unicode value of H,e,l,l,o so that the enter string SAVED would be some thing like this. (The UNICODE values are not accurate) \u0001\u1234\u3455\u3455\u4563. When saved how many bytes it would take for each unicode character. For example, how many bytes are needed to save \u0001 ? and second question is, how many number of words like this can be stored in a MIDP 2.0 device(atleast the average) in one single RM Store?
Thanks and regards...
 
Niklas Junel
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can call the method java.lang.Runtime freeMemory(), to see how much memory is available in your device. I think that is your limit.
 
Mark Spritzler
ranger
Sheriff
Posts: 17309
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well if Unicode is 16 bits, then that is two bytes. I think.

Mark
 
Ransika deSilva
Ranch Hand
Posts: 524
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
Many thanks for all the replies. I think I got an idea about how many records I can store.
Regards
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!