J2ME

The Micro Edition is for running Java software, midlets, on cell phones, PDA's and other devices. The easiest way to build and test j2me applications is by installing Sun's J2ME Wireless Toolkit

Having done this, start KToolbar
, click 'New Project' and name the project, say, 'JL' and the midlet 'com.javalessons.Les1' . Choose 'MIDP 1.0' on the first 'Settings' page presented ('API selection') as target platform and confirm. The WTK has now generated the directory structure and files needed. You will find apps/JL/src/com/javalessons where you can create the file Les1.java . Copy the source code given below to that file and in KToolbar you can 'Build' and 'Run' the application. The application is shown in a cell phone emulator, that you can only control through its keys (or your keyboard's keys), no use clicking its display.

By clicking 'Settings' in KToolbar you can find the page 'Required', where you see part of the contents of the generated plain text file JL.jad . Such a file has to be included in every midlet suite. You can find it in the apps/JL/bin directory.

Take a look at KToolbar's 'Settings' again and go to the 'Midlets' page. Here you can 'Add' each new midlet that you want to build and run. Take care to specify the full class name.


Double-click to select or


JavaLessons.com

Copyright © 2000-2013 SEMM (NL) All rights reserved

Terms, conditions, disclaimer