/articles/dumbphone_programming
some time ago, a friend of mine traded his smartphone for a
dumphone, which made me think about how programmers made
applications back then. With Java unfortunately :(! but not the same
Java we're all familiar with, rather a special version of Java made for
mobile devices: Java ME (Micro Edition).
fortunately, San José State University has a series of articles
on this subject, so I decided to try myself.
links to the resources used:
- Java 2 Micro Edition (J2ME) by Jon Pearce
- Java SE Development Kit 5.0u22 (32-bit)
- Sun Java Wireless Toolkit 2.5.2_01
as the articles from SJSU teach, I installed JDK 5.0u22 (32-bit) and WTK 2.5.2,
then I created a new project through the Toolkit's interface called "Example",
with a midlet defined in the "HelloWorld" class. I opened the project folder in
Visual Studio Code and wrote the code snippet from the article:
import javax.microedition.lcdui.*; import javax.microedition.midlet.*; public class HelloWorld extends MIDlet { private Display theDisplay; private Screen mainScreen; public HelloWorld() { theDisplay = Display.getDisplay(this); mainScreen = new TextBox( "Example 1", "Hello World", 50, TextField.ANY ); } protected void startApp() { theDisplay.setCurrent(mainScreen); } protected void destroyApp(boolean unconditional) { } protected void pauseApp() { } }
i pressed Build
and Run
in WTK to open the emulator and launch the midlet:
↙ back