School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!
Welcome to Dream.In.Code
Become an Expert!

Join 307,097 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 2,042 people online right now. Registration is fast and FREE... Join Now!



's Contributions
Below are the tutorials, code snippets, and resources has submitted to dream.in.code. For more information on Kudos and contributing to dream.in.code visit: http://home.dreamincode.net/?p=about#kudos.
Tutorials
Quick tip on timing in J2ME in Java Tutorials (Last Comment: fooboo, Views: 4,675)
Code Snippets
Submitted: August 21, 2006        Views: 1506
If you are running code in a phone emulator and manually debugging it this can help keep the final build small. The usual method to gain info about the code while it runs would be to use System.outs to write to the emulators console window. The trouble with this is that they take up memory. If you are trying to shoehorn a jar onto a phone with very little memory such as a Nokia 7210 you'll need to remove all the System.outs once you've done debugging to keep the jar size small. If you use the code below all you need to do is comment out one line (#define DEBUG) and the System.outs are removed from all of your code automatically. The beauty of this is that if you need to go back to debugging you just need to put the line back in and all your debugging lines are back again.
Submitted: August 21, 2006        Views: 2862
This is only a little tip but it's one I've found useful. When porting J2ME games etc. from phone to phone you'll find that different phones have their keys mapped to either negative or positive values. For example Motorolas in particular, of all the phones with a 176*220 screen they all can use the exact same code bar the keymap. Half are mapped to positive values and half the range are mapped to negative values...I've no idea why, it doesn't make sense but if you use the line of code below you will find that one ported jar will work on the whole range without the need to re-port the code.