140 likes | 292 Views
Overview of J2ME. Framework of Java Solution. J2ME Software Layers. PDAP. 選擇性規範 Optional Packages. 應用程式規範 Profiles. 硬體最小規範 Configurations. 虛擬機器 Virtual Machine. Configurations. 硬體最小規範分兩種 CDC (Connected Device Configuration) 連結式裝置規範
E N D
Overview of J2ME • Framework of Java Solution
J2ME Software Layers PDAP 選擇性規範 Optional Packages 應用程式規範 Profiles 硬體最小規範 Configurations 虛擬機器 Virtual Machine
Configurations • 硬體最小規範分兩種 • CDC (Connected Device Configuration) • 連結式裝置規範 • 適用於記憶體與電源支援度較高的裝置如: Set-top Box, Pocket PCs, Communicator • CLDC (Connected Limited Device Configuration) • 限制式連結式裝置規範 • 適用於記憶體與電源支援度較低的裝置如: 手機, PDA, 呼叫器 • 目前有CLDC 1.0 與 CLDC1.1兩種版本
Profiles • 應用程式規範 • Mobile Information Device Profile (MIDP) • 手機專用之應用程式規範 • 現有MIDP 1.0 與 MIDP 2.0 兩種版本 • Foundation Profile • Personal Profile • RMI Profile • Multimedia Profile • Gaming Profile • Personal Basis Profile
J2ME Software Layers 應用程式規範 Profiles 硬體最小規範 Configurations 虛擬機器 Virtual Machine CDC CLDC
First MIDlet MIDlet, Mobile Information Device small program • 引入套件 • import javax.microedition.midlet.*; • 繼承抽象MIDlet類別 • public class FirstMIDlet extends MIDlet • 實作三個抽象方法 • public void startApp() • public void pauseApp() • public void destroyApp(boolean)
See: FirstMIDlet.java 實作三個抽象方法 First MIDlet 繼承抽象MIDlet類別 套件封裝 引入套件 建構子(不一定要有)
Lifecycle of MIDlet • 程式啟始後, KVM自動呼叫建構子然後進入Paused狀態 • KVM自動呼叫startApp()進入Active狀態 • 若有來電或按暫停鍵KVM呼叫pauseApp()進入Paused狀態 • 解除暫停, KVM呼叫startApp()重新進入Active狀態 • 關閉程式, KVM呼叫destroyApp()進入Destroyed狀態
See: HiSmallWorld.java Display
See: CompulsiveMIDlet.java Compulsive notifying • 強制狀態轉移
To Do After Class • Read Chapter 2, 3, 4 • Discuss your project with your teammatesPS: Final list of teammates and project topic will be due on 2006/3/16小組名單與題目於3/16前e-mail給老師
High-Level User Interface Display List TextBox Alert Form TextField StringItem ChoiceGroup Spacer Next Week... • DateField • Gauge • ImageItem • CustomItem