Title: J2ME Programming
1J2ME Programming
Hiroyuki Akimoto
2Contents
- J2ME and its Technologies
- i-appli Programming
3Mobile Java
- We can run Java program in our mobile device
(such as mobile phone, PDA).
http//www.nokia.com/phones/9210/demo/intro_and_gu
ide.html
4about J2ME
- Java2 is divided into three platforms
- J2EE (Java2 Enterprise Edition)
- Business applications.
- J2SE (Java2 Standard Edition)
- General applications (In this lecture, using this
platform). - J2ME (Java2 Micro Edition)
- Small devices such as mobile phone, PDA, car
navigation.
5about J2ME
- J2ME Platform needs configuration and profile.
6CLDC (Connected Limited Device Configuration)
- Mobile Phone Java use this configuration
- Deleted features
- Floating Point
- Finalize
- Thread Group
- Java Native Interface (JNI)
- Reflection
- Weak References
7Profiles for mobile phone
8DoJa and MIDP
- Differences between DoJa and MIDP
9Detail of i-appli
- DoCoMo 503, 504, 505,.. 900, FOMA
- Limited capacity
- 503i 10Kbyte
- 504i 30Kbyte
- 505,506 100K
- 900 300K
- Nonvolatile Memory Size
- 503i 10Kbyte
- 504i 100Kbyte
- 505i 300K
- 900 - 500-1M
- Applications can connect to only downloaded server
10How to make i-appli
- API
- JavaTM 2 SDK, Standard Edition Version 1.3.0 or
later - CLDC
- Emulator
- J2ME Wireless SDK for the DoJa
- i-jade popular emulator to run i-appli
11How to make i-appli
Write i-appli Program
Compile
Preverify
gtjavac filename
gtpreverify classfile
Play i-appli with Your ke-tai!!
Make jar archive
Write jam and html
gtjar cfm classfile
12Form of i-appli program
- Need to extend IApplication class.
import com.nttdocomo.ui. public class
ClassName extends IApplication // Called
when this application is started public void
start() // Called when this application is
resumed public void resume()
13Hello World (Source Code)
import com.nttdocomo.ui. public class
HelloWorld extends IApplication public void
start() HelloCanvas canvas new
HelloCanvas() Display.setCurrent(canvas)
public void resume() class HelloCanvas
extends Canvas public void paint(Graphics
g) g.drawString("Hello world",0,20)
14Hello World (Compile)
- Compile
- javac bootclasspath CLDCAPI classpath DoJaAPI
HelloWorld.java - Run (in emulator i-jade)
- java jar i-jade.jar
- Preverify
- preverify classpath CLDCAPIDoJaAPI d .
HelloWorld - Make jar archive
- jar cfM HelloWorld.jar HelloWorld.class
HelloCanvas.class
15HelloWorld (Make jam file)
AppName My First i-appli PackageURL
HelloWorld.jar AppSize 235 AppClass
HelloWorld LastModified Sun, 9 Jun 2002 164554
16HelloWorld (Make html file)
- If you have DoCoMos 503i, 504i phone, or above,
you can visit this url and download this
application.
lthtmlgt ltOBJECT declare idiappli
dataHelloWorld.jam typeapplication/x-jamgt lt/
OBJECTgt ltA ijamiappli hrefindex.htmgtMy
First i-applilt/Agt lt/htmlgt
17References
- J2ME Technologies (English)
- http//java.sun.com/j2me/
- Java Technologies for WIRELESS (Japanese)
- http//jdc.sun.co.jp/wireless/
- i-appli Specification (Japanese)
- http//www.nttdocomo.co.jp/p_s/imode/java/index.ht
ml - i-jade (Japanese)
- http//www.zentek.com/i-JADE/ja/
- Tutorial to make i-appli (Japanese)
- http//www.kajas.com/tutorial/index.html
- Amateur creaters i-appli search site (Japanese)
- http//www.kajas.com/