Hi, I had reecently apperaed for a J2ME interview and here are a few questions which I could not answer. Can anyone help me with the answers.
1. How would you reduce the size of a jar file so that it does not exceed the device specifications.
2. In a J2ME gaming application you have added code for detecting a collision between 2 objects. But while testing you see that the objects have not actually collided but still your code has detected a collision. What could be th epossible reason for this.
3. How do you port a J2ME application on a cell phone.
Any other tips or some interview questions would be really helpful.
posted 12 years ago
1) Many discussion on this forum before, do a search 2) Your picture is not full size of the png file. 3) Make the phone specific code in a directory, and shared code in a common directory. Then you can build your jar by using the specific code. Using ant and antenna can automate the process.
1. Use an Obfuscator. 2. The clossion is based on the square of the sprite rather than the actual visual pixels that make up the sprite image. For example say your sprite is a circle. You can detect collision based on the circle itself, or the bounding box. 3. Depends on whether you have device specific code or not, and sometimes it just takes testing on the other device and fixing the stuff that doesn't work.