This week's book giveaway is in the Java in General forum.
We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line!
See this thread for details.
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Memory related stuff ...

 
Vassili Vladimir
Ranch Hand
Posts: 1585
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ranchers,

Is there a way to write a MIDlet that checks the amount of memory available ?
And, is there a way to check the amount of battery available ?

If anybody can guide me into a helpful tutorial, i will be more than thankful.

Regards ...
 
Eduardo Marques
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Methods freeMemory() totalMemory() in java.lang.Runtime are implemented (or should be) by CLDC devices (see http://java.sun.com/javame/reference/apis/jsr139/java/lang/Runtime.html)



In regard to battery power, I am not aware of a standard way to obtain it through the J2ME standard APIs (maybe a manufacturer specific API).

[ March 19, 2007: Message edited by: Eduardo Marques ]

[ March 19, 2007: Message edited by: Eduardo Marques ]
[ March 19, 2007: Message edited by: Eduardo Marques ]
 
Vassili Vladimir
Ranch Hand
Posts: 1585
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Eduardo,

It worked
I actually have used this API in my J2SE applications, but yesterday, when i was trying to program my MIDlet i was using the Properties class instead (which does not work for MIDlets), i always have a conflict in using these two classes

Thanks alot for guiding me

Best of luck ...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic