Hi guys, I'm weak in j2me and I've tried to create my first application and I've faced with a issue, it's not really a issue it's more like a question, anyway, I'd would to know, what is the most heavy class(interface implemented) in j2me classes? such a Ticker or Alert, I don't know. so please help me out with this issue. thanks
What do you mean by the most heavy ? The most used class ? If you use high level GUI, i think it's Form, if you use low level GUI then Canvas. Or actually, i think CommandListener is the most used class.
Post any questions here, i will answer them if i can.
It might not seem clear, but actually String is using up the most memory.
For example, creating Strings like this:
is very bad practice. When using very long Strings, you might encounter problems.
Strings should be created like this:
You don't really have to worry about memory so much. Using large Images or doing complex operations (like constructing an Image from pixel data) is the only thing you should be carefull with.
You can always read how much memory you have by using:
Lorand Komaromi wrote:Compile it, then decompile it with jad. You will be surprised...
I know it as a fact (search StringBuffer). Strings are immutable, every time you use one, memory is allocated, while StringBuffer can change it's value, therefore you avoid creating multiple temporary Strings.