˹á
 úҹ
  C/C++ new
  Java new
 Sourcecode.TV
  Android
  Blackberry
  C/C++
  Java
  Linux
  Windows Phone
  ͧͧ
 
  .NET
  Android
  Blackberry
  C++Builder
  Delphi
  Java
  Mobile
  Open Source
  Pocket PC
  Visual Basic
  Web
  Windows Phone
  Others
 Ẻ¹
  ASP
  ASP.NET Webmatrix
  C++
  eVB
  J2ME
  Java
  PHP
 
  Android
  ASP
  C++
  VC++
  CGI-Perl
  Delphi
  Java
  jQuery
  PHP
  Visual Basic
  .NET
 ԡèҡ
  Դ...
  DoodeeHosting
  Ѻ͡Ẻ Ѳ䫵
  Freeware
  ѵҤɳ
  ª١
  ʶԵԼ
 Ŵ
 Ң
 дҹʹ
  .NET
  C/C++
  Delphi
  Java
  Palm/PocketPC
  Visual Basic
  Web
 
 дҹҹ
 ԧ
 ǡѺ
 ѵҤɳ
Social Network

Facebook  Twitter  YouTube
 New Article
 Webboard
 Freelanceboard
Freeware
 (BerDee)
(Android)
駩غ
駩غ(Android)
WebcamMonitor
WebcamMonitor(Windows)
scSendMail
scSendMail(Windows)
MSN Caption
MSN Caption(Windows)
  Freelance comment
  ԴͺʹФѺ...
2015-07-29 13:35:58
  Ҽͧ纷ѲҴ HTML5 ...
2015-01-18 15:33:54
  Ҽͧ纷ѲҴ HTML5 ...
2015-01-18 15:32:51
  ԴͺФѺ
ҹ...

2014-01-06 12:47:38
  ѧҤ͹ ͧ֡ͧ...
2013-07-06 01:04:37
  ʹ觢ͺࢵҤҤҡ͹ФѺ...
2013-03-24 18:54:20
  ѧդѺҹԴѺ 08...
2012-12-16 19:18:14
  ʹ㨤 Դ 0905076277...
2012-11-12 11:07:46
  Ѻ礹ѡ֡ͺѷ
...

2012-10-29 03:10:46
  sukit_te34@hotmail.com...
2012-10-29 03:09:36
  Webboard comment
  Ѻ ͹ matlab ¹ matlab...
2017-06-03 16:27:23
  ੾зҧҴ ͧҢ...
2017-05-25 16:18:08
  ͧ˹Ѻ os ...
2017-05-25 16:12:47
  ¹ php curl ...
2017-04-20 01:04:20
  ¹ ...
2017-03-27 12:50:54
  ʧҷ ͧѾഷ...
2017-03-27 12:37:20
  ͺõͺ...
2017-02-22 13:10:24
  ͧաԸ¹ recursive f...
2017-02-14 13:11:03
  ҡ кͧشҡ...
2017-01-30 11:45:28
  for-loop ͹ѹ
...

2017-01-28 16:00:12
  Homework comment
  ͺسҡѺ...
2017-08-16 18:27:25
  ͧ ͧ ѧ ^^...
2017-04-18 18:40:46
  ͧ ͧ ѧ ^^...
2017-04-18 18:37:54
  á flowchart ѹ...
2017-04-18 17:43:33
  ҡ flowchart ...
2017-04-18 16:25:29
  kungking ӶäѺ ?...
2017-03-18 23:28:36
  ¹ʴͧ...
2017-03-06 10:56:25
  鴷ӧҹẺ ...
2016-09-06 01:00:12
  ҡҺ鴹Ѻѧ...
2016-09-05 09:31:27
  ͧ֡¹...
2016-04-22 00:47:49
  Article comment
  [b]
2017-08-11 22:39:58
  [b]
...

2017-08-11 14:46:33
  ҨѺ ͧ
...

2017-07-11 09:59:35
  ö͡Ѻ anycast ...
2017-07-05 10:12:35
  Ѻ س "Դ" ͧ֡...
2016-06-18 15:21:09
  vs2008 c# Ѻ ͺسѺ...
2016-06-17 14:39:30
  vs c# ӵآ鹵͹...
2016-06-17 14:37:44
  ͧѺ "Ҩԧ ...
2016-03-12 23:36:05
  觢ͤǧ LAN ੾Ф...
2016-03-12 18:25:42
  Terminal Mac ...
2016-02-16 11:02:01
  9Mcode comment
  ҡ...
2014-02-21 08:52:19

Link Exchange

ѵҤɳ
Statistics of Sourcecode in Thailand
 
 J2ME (Java Micro Edition) Tutorial  

- - - - - - - - - - - - - - ʹѺʹع- - - - - - - - - - - - - -

 J2ME (Java Micro Edition)
 
 

3 MIDP Programming

 

3 MIDP Programming

MIDlet ...?

  • Java run MIDP environment
  • MIDlet class package ͧ java.microedition.midlet
  • ѲҢ鹨ҡ MIDP ׺ʹҡ MIDlet
  • class ׺ʹҡ MIDlet class Implements (¡) 3 method startApp(), pauseApp() destroyApp()

㹤繨ԧ þѲ MIDlet ѡɳǡѺþѲ Java Applet Java Applet 繡׺ʹҡ class Applet ǹ MIDP 繡׺ʹ ҡ class MIDlet

 

MIDlet 's Life Cycle

MIDlet's Life Cycle
ٻ 7 ʴǧá÷ӧҹͧ MIDlet

ҧ class ׺ʹҨҡ MIDlet Package javax.microedition.midlet.MIDlet , class ͧҨǧ ÷ӧҹҡҧ ѧҡ鹡ʶҹ Paused(ش) ͧա÷ӧҹԴ ҡͧ¡ method startApp() ʶҹТͧʡ¹ʶҹ Active(ӧҹ) ѧٻ, ҡͧ class ش÷ӧҹ ö ¡ Method pauseApp(), ش¡͡ ÷ӧҹ ¡ Method destroyApp() ʶҹ Destroyed(١)

ʶҹеҧͧ MIDlet ,ҡٻ 7 MIDlet 3 ʶҹд¡ѹ

- Paused state (ʶҹش÷ӧҹ) Դ ͹áҷӡ¡ run ¡ method startApp(), ա¡ method pauseApp() notifyPaused()

- Active state (ʶҹС÷ӧҹ) Դ ͹á, ա¡ method startApp() ա¡ method resumeRequest() 㹵͹ʶҹСáӧҹѧ pauseApp()

- Destroyed state (ʶҹж١) Դѧҡա method destroyApp notifyDestroy()

㹡¹ʶҹ (state) ͧ÷ӧҹ method 3 ѹ¡ѹ

- resumeRequest() Ѻʶҹ Active state ա

- notifyPaused() ش÷ӧҹ

- notifyDestroy() 觷 ͨ÷ӧҹ

MIDlet suites

MIDlet suites
ٻ 8 ʴͧСͺͧ MIDlet suites

MIDlet suites 繷Ǻͧ class ͧ MIDlet ٻҾҧ ǢͧѺ÷ӧҹ, MIDlet suites лСͺ 2 ѡ

- JAD File Text file ˹ҷ Application Descriptor (͡ѡɳ ФسѵԢͧ) ´ͧ MIDlet suite ҧ Ѻػó(Ͷ)Ŵ 价ӡõǨͺ ´ͧ ͹õԴ

- JAR File File MIDlet ҧ resource file Ǣͧ Manifest file

ҧ JAD File (HelloExamples.jad)

MIDlet-Name: HelloExamples
MIDlet-Vendor: Nokia Pte Ltd
MIDlet-Version: 1.0
MIDlet-Jar-Size: 7808
MIDlet-Jar-URL: HelloExamples.jar

JAD ҧ鹨繡ú֧͡´ͧ MIDlet suite ժ, Ѳºѷ, ˹, Ҵ, Ъ JAR 㹡õԴ駪 (çö url سͧ download JAR File )

ҧ Manifest File

Manifest-Version: 1.0
MIDlet-Name: HelloExamples
MIDlet-Vendor: Nokia Pte Ltd
MIDlet-Version: 1.0
MicroEdition-Profile: MIDP-1.0
MicroEdition-Configuration: CLDC-1.0
MIDlet-1: BouncingTextMIDlet, , example.hello.BouncingTextMIDlet
MIDlet-2: HelloWorldMIDlet, , example.hello.HelloWorldMIDlet

Ѻ Manifest File ҧ鹨к֧͡´ͧ JAR File Manifest , MIDlet , Ѳ, , MIDP Configuration ش¤ Сͺ MIDlet úҧ

 

MIDlet Development Steps

MIDlet Development Steps

鹵͹㹡áþѲ MIDlet բ鹵͹ѧ

  1. ӡҧ MIDlet ͧ ٻҾ, ͤ͹ҧ
  2. ҧ MIDlet Suite
  3. ҧ JAD File
  4. ͧ run ҹ emulator (ͧ)
  5. ӡõǨͺ ҡբͼԴҴѺ价ӵ 1-3 ա
  6. ش 繡÷ӵǵԴ ѺõԴ Ͷ

㹡þѲ MIDlet ѧҡسӡ¹鴢 سеͧӡ Compile 鴹鹴 Javac (Java Compiler) 觷 class 鹵͹仡ͤسͧ class ͧس价ӡ Preverifier ա ͹ ѺͶ ͧ run ͵Ǩͺ÷ӧҹ Ҷ١ͧҧͧ (ٻ 9 Сͺ)

Two-Phase Class File Verification Process
ٻ 9 ʴ鹵͹ Compile Verification

ͧҡҡ 㹡÷¹ оѲ MIDet ѡ ˵ع ֧ԴþѲ Tools 㹡þѲ MIDlet Ѳ դдǡ ҧоѲ MIDlet

 

MIDP Tools

ͧ㹡þѲ MIDlet ͡¤´¡ѹ շ駵ͧԹ Download ҧ

- J2ME Wireless Toolkit
- Nokia Developer's Suit for J2ME
- MIDP for Palm
- Simplicity for Mobile Device
- Metroworks Code Warrior
- Motorola SDK
- IBM Visual Age for Java Micro edition
- Whiteboard from Zucotto Wireless

ҢͧҨ J2ME Wireless Toolkit Ѻ Emulator ҧͧҧ Nokia ѡ, Ѻ㹢з¹˹ѧ Java ͡ J2ME Wireless Toolkit 2.0 version ͧѺѺ MIDP 2.0 ,Wireless Messaging 1.1 Mobile Media 1.0 觡ѧ Ͷ ͧ ͧѺѺ MIDP 2.0 ͡Ҩ˹㹷ͧҴ

J2ME Wireless Toolkit
ٻ 10 ʴ˹ҵҢͧ KToolbar
J2ME Wireless Toolkit

J2ME Emulator
ٻ 11 ʴ˹ҵҢͧ Emulator
J2ME Wireless Toolkit

 

Getting Start

ѧҡɮաѹ͹ ¹ ҨзسԴ㨡ѹ͹ Ǥسʧ ҧҡҧ ҡǹͧɮշҹ س ӵҧ ǹѺҹա зӤ¢

觷㹡þѲ MIDlet MIDlet Tool Ҩй ͤдǡ㹡ҾѲ سöѲ MIDlet ҧǴ ҧسͧ Ѻ㹺¹ Ҩҡ õԴ դӤѭ͡þѲ 駡õԴ Nokia Emulator ͧ÷ӧҹ ͧͶ 蹵ҧ

õԴҹ J2ME Wireless Toolkits(WTK)

- ͹õԴ سеͧӡ Download Java 2 SDK, SE ҡ http://java.sun.com/j2se/downloads.html (㹢з¹ ˹ѧ vesion 1.4.2), ǷӡõԴ

- õԴ J2ME Wireless Toolkits(WTK),ö Download ҡ http://java.sun.com/j2me/download.html ǷӡõԴ Դ Path ͧ C:\WTK20 㹹 Folder 纷 library document ͧ ¹ J2ME

- ¡ҹö ͡ Start->Programs->J2ME Wireless Toolkit 2.0->Ktoolbar лҡ˹ҵҧ ѧٻ

J2ME Wireless Toolkit
ٻ 12 ʴ˹ҵҢͧ KToolbar
J2ME Wireless Toolkit

- ԡ New Project лҡ˹ҵҧ ͹ Project Name Example MIDlet Class Name HelloWorld, ѧٻ 13 Ǥԡ Create Project

New Project Window
ٻ 13 ʴ˹ҵҧ ҧ Project

ͤس ԡ Create Project зӡҧ Folder Example ͧ͢ Project ҵ駢 ¨ Path C:\WTK20\apps\ , 駨 Folder ˹ҷ红ŵҧ bin = ҹ complie make , lib = library ,res = resource src =

- ӡ Ңͧ MicroEdition-Profile MIDP-1.0 ѧʴٻ 14 Ǥԡ OK

Settings for project window
ٻ 14 ʴ˹ҵҧ Settings for project

- ӡҧ HelloWorld.java 鴴ѧҧҹҧ, Ǻѹ֡ Path C:\WTK20\apps\src

import javax.microedition.lcdui.*;

import javax.microedition.midlet.*;



public class HelloWorld extends MIDlet

{
	private Display display;
	private TextBox t = null;

	public HelloWorld(){}

	public void startApp(  )

	{
		display = Display.getDisplay(this);
		t = new TextBox("Simple MIDlet","Hello World",256,0);		
		display.setCurrent(t);

	}



	protected void pauseApp(  ){}

	protected void destroyApp( boolean unconditional ){}

}

 

- 价˹ҵҧ Ktoolbar Ǥԡ Run, MIDlet ¹ʴ Ǣͧ Emulator ѧٻ 15

HelloWorld MIDlet
ٻ 15 ʴ˹ҵҧ run HelloWorld

 

õԴҹ Sun ONE Studio 4 update 1, Mobile Edition

Ѻ Sun ONE Studio 4 update 1, Mobile Edition MIDlet Tool дǡ㹡ҹ Editor 㹡¹ º ѧöѲǹͧ Server þѲ Servlet ӧҹѺ MIDlet

- ͹õԴ سеͧӡ Download Java 2 SDK, SE ҡ http://java.sun.com/j2se/downloads.html (㹢з¹ ˹ѧ vesion 1.4.2), ǷӡõԴ

- õԴ Sun ONE Studio 4 update 1, Mobile Edition ,ö Download ҡ http://wwws.sun.com/software/sundev/jde/index.html,͹ Download سеͧŧ¹Ѻҧ ҡ͹ ӡõԴ

- ¡ҹö ͡ Start->Programs->Sun Microsystems->Sun ONE Studio 4 ME->Sun ONE Studio лҡ˹ҵҧ ѧٻ ҹҧ سӡû͹ Path ͧ Directory سͧ Project ҧͧس (㹷 C:\J2ME)

Enter User Directory
ٻ 16 ʴ˹ҵҧѺ Path Project ͧ

ͨҡ س͡ Ẻͧ window mode سͧҹ س͡ Ǥԡ Finish лҡ˹ҵҧ ͧ

Explorer
ٻ 17 ʴ˹觢ͧ MIDlet suite Folder ҧ

- 鹵͹ ҡҧ HelloWorld Sun One Studio ѹ, ҡ ӡâҷ Local Directory ͡ New->MIDP->HelloMIDlet

Create new MIDP
ٻ 18 ʴ鹵͹ҧ HelloMIDlet

- лҡ˹ҵҧ New Wizard, ӡû͹ Name HelloWorld ѧٻҹҧ, ԡ Finish

New Wizard window
ٻ 19 ʴ˹ҵҧ͹ MIDlet

- зӡҧسѵѵ ѧٻ 20

Work space
ٻ 20 ʴ˹ҵҧ ʴ鴷١ҧ

- 鹵͹شسͧ run ¡ F6, MIDlet ж١ run ʴ͡ҧ Emulator ѧٻ 21

Emulator
ٻ 21 ʴš run MIDlet

 

㹺 ǡѺ ѡɳС÷ӧҹͧ MIDlet Сҹ MIDlet Tool 㹡þѲ MIDlet Ѻҵ ҨǶ֧ ѡɳ ͧ GUI (Graphic User Interface) ͧ MIDP

 

BACK

µͨ Ѻͧ macbook pro 2016 (usb-c to HDMI)
µͨ Ѻͧ macbook pro 2016 (usb-c to HDMI) ´дѺ 4K
ŧ Mini DisplayPort to HDMI Adapter ŧ Mini DisplayPort to HDMI Adapter Ѻͧ macbook air/pro, mac mini
ŧ Mini DisplayPort to HDMI Adapter Ѻͧ macbook air/pro, mac mini
µٿѧ Ъ Ѻ iPhone 7  7 Plus
µٿѧ Ъ Ѻ iPhone 7 7 Plus
ŧҡ USB-C Type  USB 3.1 Ѻ MacBook
ŧҡ USB-C Type USB 3.1 Ѻ MacBook
䢤ǧѺͧ Macbook Air/Pro
䢤ǧ Ѻͧ Macbook Air/Pro (300ҷ)
HDMI  3 ͡  1
HDMI 3 ͡ 1 (350ҷ)
Ի͹¹
¹¹ͷ
¹¹͹´
¹¹
¹¹ վʾ
¹¹
¹ҹԹء
¹¹Թ⿹
¹¹Ϊ ʤ
9M Blog ͧ͡ ¹ͧ
ԡ ҾѺԭ
OrmSin.com: ˹ѧͧҹ--չ (country crafts)
ѵҤɳ
 
Tutorial
eVB Tutorial
ASP.NET Webmatrix Tutorial
J2ME Tutorial
C++  Tutorial
Java  Tutorial
PHP Tutorial
ASP Tutorial
 
ẺǨ
Freelance ѺѲ

Home - Article - Tutorial - Sourcecode - Dev Handbook - Search - WebBoard - Links - About Us

ʧǹԢԷ Ѵ͡ ӫ Ѵŧ ٻẺ Ѻ͹حҵѡɳѡ
Ţ¹ҳԪ硷͹ԡҡзǧҳԪ: 7100503002000
Copyright 2001 SourceCode.in.th