Results 1 to 1 of 1
  1. #1
    Join Date
    Mar 2014
    Posts
    30
    Rep Power
    0

    Question Lifecycle exception error occuring during Java app load

    Hello,

    I'm trying to create a basic program which is a game, I wanted to get some graphics moving down the screen and then loop it once it hits the bottom.

    When I tried loading it on the actual phone, which is an old classic Life's Good phone, KP170 model it then gave an error stating that an exception was thrown during the lifecycle.

    I bought a book which is from 2005 which explains how to create games in the Java language, so I'm hoping I can achieve my very basic goal of a one level space shooter game, a clone of the classic game Asteroids. It wasn't my first goal, but I wanted to try one path first.

    I would like to think this old book will be helpful for my goal and for such an old phone, i imagine it shouldn't be a problem, despite the age of the book. MIDI 2.0.


    Java Code:
    import javax.microedition.midlet.*;
    import javax.microedition.lcdui.*;
      
    public class AsteroidDestroyer extends MIDlet {
         Display mydisplay;
         Form myform;
         Image myImage;
     
        public void startApp() {
            mydisplay = Display.getDisplay(this);
            myform = new Form("Asteroid Destroyer");
            try {
                myImage = Image.createImage("/ico.jpg");
            }
            catch (Exception exc) {
                exc.printStackTrace();
            }
            myform.append(myImage);
            mydisplay.setCurrent(myform);
        }
     
        public AsteroidDestroyer() {
        }
     
        public void pauseApp() {
        }
     
        public void destroyApp(boolean unconditional) {
     
        }
    }
    My example code for the Jpeg file.

    Before I can go ahead, I'm enquiring with LG about the keypad codes, with out any information my goal ends without even getting anything working. LG has explained that by creating a textbox I can determine the exact names for the 1, 2, 3, and 6 keys. The game loads, 6 closes the app. 1 is for moving the rocketship left, 2 for right, and 3 for fire missile.

    There will be no menu's in the game. A basic one level game with the aim to destroy a bunch of asteroids before they reach a the bottom of the screen, if unsuccessful the game reloads with a loop indefinately until the game is closed again with 6 or if the battery goes if left on. If successful than a box loads explaining so, I could do that for the game over.

    This will be a more polished version of my first attempt on an old PDA in Visual basic. I'm not a computer programmer.

    Thank you.
    Attached Thumbnails Attached Thumbnails Lifecycle exception error occuring during Java app load-appforlgphone.jpg  

Similar Threads

  1. Replies: 2
    Last Post: 10-29-2013, 08:00 PM
  2. Replies: 1
    Last Post: 05-12-2012, 08:35 PM
  3. Error: Could not find or load main class Ops.java
    By Javasubbu in forum New To Java
    Replies: 4
    Last Post: 10-05-2011, 10:52 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •