Gidlet
 
 


Installation of the Gidlet library:

  1. Download the latest version of Java SE from java.sun.com. Look at the homepage for ->Popular downloads -> Java SE.

  2. Install the JDK in any folder (below called <jdkroot>)

    (If you want to use J2ME on the NetBeans IDE, follow the installation instructions here.
    )

  3. Add the <jdkroot>/bin directory to the application path environment variable. (You should be able to call java, javac, jar from within a command shell.)

  4. Download the latest version of the Java Wireless Toolkit (WTK) from java.sun.com. Look at the homepage for
    -> Popular downloads -> Java ME -> Sun Wireless Toolkit. (The following guidelines refer to WTK version 2.5.2)

  5. Install the WTK in any folder (below called <wtkroot>).

  6. Download the latest version of the Gidlet distribution from www.aplu.ch/gidlet and unpack the zip archive in any folder.

  7. Now you should decide whether you want to use the WTK to compile, pack and emulate your MIDlets or you want to use your favorite IDE only. In the latter case, go to step 10.

  8. Create directory <userhome>\j2mewtk\2.5.2\apps\lib and copy gidlet.jar in this directory. (userhome is the home directory of the current user.)

  9. Check your installation by starting the WTK. Click New Project and enter
    Project Name: GidletTest
    Midlet Class Name: MyGidlet
    Click: Create Project

    In dialog API Selection choose
       Target Platform: JTWI
       Configuration: CLDC1.1
    Additional APIs:
       Wireless Messaging API 2.0 (JSR 205)
       PDA Profile for J2ME (JSR 75)
       Bluetooth/OBEX for J2ME (JSR 82) 

    Use any editor and create MyGidlet.java in directory
    <userhome>\j2mewtk\2.5.2\apps\GidletTest\src 

    // MyGidlet.java

    import ch.aplu.gidlet.*;

    public class MyGidlet extends Gidlet
    {
      public void main()
      {
        MPanel p = new MPanel();
        p.move(0.5, 0.5);
        p.fillCircle(0.4);
      }
    }

    Click: Build then click Run. The Default Color Phone should appear. Click the button below the OK label. The black circle should be drawn. Consult the Java documentation of class www.aplu.gidlet.MPanel and play around with some other graphics methods.

  10. If you want to develop MIDlets with your favorite IDE, look for possible Java ME plugins for your IDE and install them. Add gidlet.jar to your archive classpath. If there are no such plugins available, you may download and install the packaging tool MidPak. Follow the installation hints given at the distribution site.

If you do not need all classes in gidlet.jar, just extract them in order
to keep your MIDlet jar as small as possible. To further optimize it,
use any optimizer/obfuscator. (e.g. ProGuard at proguard.sourceforge.net).
If you pack with MidPak, optimize with ProGuard is an option.

The Gidlet distribution contains many typical examples. Study and execute them in order to gain a deeper insight in the Gidlet framework.

In any case, if you have a problem or merely a question, send an e-mail to

or post a FAQ at www.aplu.ch/faq.