古詩詞大全網 - 成語故事 - 求壹篇有關J2ME的外文翻譯

求壹篇有關J2ME的外文翻譯

附錄 英文文獻及翻譯

What's New in the J2ME Wireless Toolkit 2.2

by Jonathan Knudsen

June 2004

The award-winning J2ME Wireless Toolkit has become the de facto standard toolkit for developing applications for Java 2, Micro Edition (J2ME). Since its debut in 2000, the toolkit has evolved to keep pace with the rapidly changing face of mobile Java technology. Don't be misled by the small change in version number from 2.1. The new toolkit supports new optional APIs specified through the Java Community Process (JCP) in four vital areas: 3D graphics, multimedia messaging, Bluetooth networking, and data management. In this article I'll describe these new APIs and show you how they're implemented in the toolkit.

Before I do, take a moment to admire the updated DefaultColorPhone emulator skin. Since version 2.1, this skin has gotten a larger screen (320 x 240, or QVGA) and far more colors (4096 instead of 256).

Mobile 3D Graphics

JSR 184, the Mobile 3D Graphics API for J2ME (M3G), provides three-dimensional graphics functionality in a compact package that's appropriate for devices that support the most widely adopted J2ME software stack, the Connected, Limited Device Configuration (CLDC) and the Mobile Information Device Profile (MIDP). The API provides two APIs for displaying 3D content. The immediate mode API makes it possible for applications to create and manipulate 3D elements directly. On top of this layer is a scene graph API, also called retained mode, that makes it possible to load and display entire 3D scenes you've designed ahead of time. Applications may use whichever API is most appropriate, or a combination of retained mode and immediate mode. The JSR 184 specification also defines a file format for scene graphs, .m3g.

The toolkit's emulator fully supports JSR 184 and you'll find several MIDlets that show off the API's capabilities in the Demo3D project.

Life3D demonstrates the use of immediate mode:

PogoRoo is an interactive demonstration that features a bouncing kangaroo:

Finally, retainedmode shows how to load and render a scene graph file:

Multimedia Messaging

The J2ME Wireless Toolkit has long supported JSR 120, version 1.1 of the Wireless Messaging API (WMA); the new release supports WMA 2.0 (JSR 205), which expands WMA's capabilities to include Multimedia Messaging.

In the toolkit, messaging takes place in a simulated environment. If you run the emulator multiple times, applications on the emulators can communicate with each other, and you can use the toolkit's handy WMA Console utility to exchange messages with the applications in the same environment. Messages may conform to any of three standard protocols: Short Message Service (SMS), Cell Broadcast Service (CBS), or - new in version 2.2 of the toolkit - Multimedia Messaging Service (MMS).

You can address MMS messages and add any collection of files to the message.

Furthermore, the network monitor now displays MMS messages that are sent or received by the emulator.

Bluetooth and OBEX

The J2ME Wireless Toolkit emulator supports JSR 82, the Java APIs for Bluetooth, which includes two independent APIs:

The Bluetooth API provides an interface to Bluetooth wireless

networking, including device discovery and data exchange.

The OBEX API allows applications to use the Object Exchange (OBEX)

protocol over Bluetooth or other communication channels.

The toolkit allows you to develop and test applications that use Bluetooth technology even if you don't have any actual Bluetooth hardware. The toolkit simulates a Bluetooth environment, in which you can run multiple emulator instances that can discover each other and exchange data using the Bluetooth API.

An example application, BluetoothDemo, shows how to transfer imagesfrom one emulator to another.

The J2ME Wireless Toolkit implements OBEX transfer over simulated Bluetooth and infrared connections. The simulated infrared connection

follows the IrDA standard defined by the Infrared Data Association. The toolkit simulates infrared transfers between multiple running emulators.

You can configure the Bluetooth and OBEX environment using the Bluetooth/OBEX tab in the toolkit preferences. This controls such

parameters as how long the emulator attempts to discover other devices in the simulated Bluetooth environment and the maximum packet size. See the toolkit's User's Guide for more details.

Local Files and Personal Information

The J2ME Wireless Toolkit supports JSR 75, the PDA Optional Packages for the J2ME Platform, which also includes two independent APIs:

The FileConnection API gives MIDlets access to a local file system on the device.

The Personal Information Management (PIM) optional package includes APIs for manipulating contact lists, calendars, and to-do lists.

A real device may have a local file system which can be accessed using the FileConnection API. In the J2ME Wireless Toolkit emulator, a simulated file system is maintained as a directory on your hard disk.

The files your application can access using FileConnection are stored in subdirectories of <toolkit>\appdb\<skin>\filesystem., where <toolkit> is the installation directory of the J2ME Wireless Toolkit and <skin> is the name of the emulator skin. For example, the DefaultColorPhone emulator skin comes with a root directory installed called root1, which contains a file called Readme. The file's full path is <toolkit>\appdb\DefaultColorPhone\filesystem\root1\Readme.

You can manage the root directories that are available by choosing MIDlet > External events from the emulator window's menu. You'll see a small utility window for adding and removing roots. These actions will also generate events for a registered listener object.

In a real device, personal information might be stored in a proprietary

format in memory. The emulator uses a directory on your hard disk to

contain this information, accessible using the PIM API. All information is stored in <toolkit>\appdb\pim. Lists are stored in subdirectories of the contacts, events, and todo directories. For example, a contact list called Contacts is contained in <toolkit>\ appdb\ pim\ contacts\ Contacts.

Inside the list directory, items are stored in standard formats specified by the Internet Mail Consortium. Contacts are stored in vCard format, while calendar and to-do items are both stored in vCalendar format.

Summary

The J2ME Wireless Toolkit 2.2 is much more than an incremental update of an excellent tool. It includes support for four exciting new

specifications that together define six new APIs. As the world of wireless Java technology rapidly evolves, the J2ME Wireless Toolkit keeps pace and contains all the tools you need for

About the Author:

Jonathan Knudsen [e-mail] [home page] is the author of several books, including Wireless Java (second edition), The Unofficial Guide to LEGO MINDSTORMS Robots, Learning Java (second edition), and Java 2D Graphics. Jonathan has written extensively about Java and Lego robots, including articles for JavaWorld, EXE, NZZ Folio, and the O'Reilly Network. Jonathan holds a degree in mechanical engineering from Princeton University.

譯文

J2ME Wireless Toolkit 2.2 新改進

作者:Jonathan Knudsen

2004 年 6 月

屢獲殊榮的 J2ME Wireless Toolkit 已經成為 J2ME 開發應用程序的事實標準工具包。自從 2000 年初次亮相以來,該工具包壹直在發展以趕上移動 Java 技術外觀上快速改變的步伐。不要被從 2.1 版本以來的小改變所誤導。新的工具包在四個重要的領域支持 Java Community Process (JCP) 所指定的新的可選 API:3D 圖形、多媒體通信、藍牙連網(Bluetooth networking)和數據管理。本文將描述這些新的 API 並且向您展示如何在工具包中實現他們。

在這之前,讓我們贊美壹下更新後的 DefaultColorPhone 模擬器皮膚,自從 2.1 版本以來,該皮膚已有了壹個更大的屏幕(320 x 240, 或 QVGA)和更多的顏色(4096 色而不是 256 色)。

移動 3D 圖形

JSR 184, 即 Mobile 3D 圖形 API for J2ME (M3G) 在壹個集成軟件包中提供了三維圖形功能,適用於支持最為廣泛采用的 J2ME 軟件棧、有限連接設備配置(CLDC)和移動信息設備描述(MIDP)的設備。API 為顯示 3D 內容提供了兩種 API。立即模式 API 使應用程序能夠直接創建和操縱 3D 元素。這壹層之上是壹個場景圖 API,也稱為保留模式,能夠提早加載並顯示已設計的整個 3D 場景。應用程序可以采用最適合的 API,或保留模式與立即模式的組合。JSR 184 規範還為場景圖定義了壹種文件格式-.m3g。

該工具包的模擬器全面支持 JSR 184,並且有幾個 MIDlet 展示了 API 在 Demo3D 項目中的功能。Life3D 演示了立即模式的使用。PogoRoo 是壹個的交互的演示,特點是顯示壹只跳躍的袋鼠:

多媒體通信

J2ME Wireless Toolkit 長期支持 JSR 120、Wireless Messaging API(WMA)的1.1版本;新版本支持 WMA 2.0(JSR 205),其把 WMA 的功能擴展到包括多媒體通信。

在工具包中,通信發生於模擬的環境中。如果多次運行模擬器,模擬器上的應用程序能夠相互通信,並且可以使用工具包方便的 WMA Console 實用程序在同壹環境中與應用程序交換消息。通信可以遵照以下三種標準協議之壹:短消息服務(Short Message Service,SMS)、蜂窩廣播服務(Cell Broadcast Service,CBS)或工具包 2.2 版本中的新協議-多媒體通信服務(MMS)。

您可以標記 MMS 消息,並向消息添加任何文件集合。

而且,現在網絡監視器能夠顯示模擬器發送或接收的 MMS 消息。

藍牙和 OBEX

J2ME Wireless Toolkit 模擬器支持 JSR 82,即 Java API for Bluetooth,包括兩個獨立的 API:

藍牙 API 為藍牙無線網絡提供了接口,包括設備恢復和數據交換。

OBEX API 允許應用程序在藍牙或其他通信信道上使用對象交換(Object Exchange,OBEX)協議。

該工具包允許在即使沒有實際藍牙硬件的情況下,也可以開發和測試采用藍牙技術的應用程序。該工具包模擬藍牙環境,您可以在該環境中運行可相互發現的多個模擬器實例和使用藍牙 API 交換數據。

應用程序實例 BluetoothDemo 顯示了如何從壹個模擬器將圖像傳輸到另壹個模擬器。

J2ME Wireless Toolkit 通過模擬的藍牙和紅外連接上實現 OBEX 傳輸。模擬的紅外連接遵循 Infrared Data Association 定義的 IrDA 標準。工具包在多個運行的模擬器之間模擬紅外傳輸。

您可以使用工具包參數中的 Bluetooth/OBEX 標簽來配置藍牙和 OBEX 環境。其控制了諸如模擬器在模擬的藍牙環境中試圖用多長時間去發現其他設備,以及最大數據包大小等參數。請參見工具包的用戶指南獲取更多的詳細信息。

本地文件和個人信息

J2ME Wireless Toolkit 支持 JSR 75,即 PDA Optional Packages for the J2ME Platform,它也包括兩個獨立的 API:

FileConnection API 提供了 MIDlet 對設備上本地文件系統的訪問。

Personal Information Management (PIM) 可選軟件包包括用於操縱聯系人列表、日程安排和計劃列表的 API。

壹臺真實的設備可能有壹個能通過使用 FileConnection API 訪問的本地文件系統。在 J2ME Wireless Toolkit 模擬器中,模擬的文件系統作為硬盤上的壹個目錄存在。

應用程序使用 FileConnection 可訪問的文件都存放在子目錄 <toolkit>\appdb\<skin>\filesystem.中,此處 <toolkit> 是 J2ME Wireless Toolkit 的安裝目錄,<skin> 是模擬器皮膚的名稱。例如,DefaultColorPhone 模擬器皮膚隨安裝根目錄 root1 而產生,包含壹個 Readme 文件。文件的完整路徑為<toolkit>\appdb\DefaultColorPhone\filesystem\root1\Readme。

您可以從模擬器窗口的菜單種選擇 MIDlet > External events 來管理可用的根目錄。您將看到壹個添加和刪除根目錄的小的實用程序窗口。這些操作也將為 registered listener 對象生成事件。

在真實的設備上,個人信息可能以專有格式存儲在內存中。模擬器使用硬盤中的壹個目錄來存放這些信息,可使用 PIM API 來訪問。所有的信息存儲在 <toolkit>\appdb\pim 目錄中。列表存儲在聯系人、事件和計劃目錄的子目錄中。例如,聯系人列表 Contacts 位於 <toolkit>\appdb\pim\contacts\Contacts 目錄中。

在列表目錄內,列表項以 Internet Mail Consortium 指定的標準格式存儲。聯系人以 vCard 格式存儲,日歷和計劃項都以 vCalendar 格式存儲。

結束語

J2ME Wireless Toolkit 2.2 不僅僅是壹個出色工具的增量更新。它包括了對令人激動的四項新規範的支持,同時定義了六種新的 API。隨著無線 Java 技術世界的快速發展,J2ME Wireless Toolkit 緊緊跟隨發展的步伐並且包含您所需的全部工具。

關於作者

Jonathan Knudsen[電子郵件] [主頁],有多本著作,包括:Wireless Java (second edition)、The Unofficial Guide to LEGO MINDSTORMS Robots、Learning Java (second edition) 和 Java 2D Graphics 。Jonathan 在 Java 和 Lego 機器人領域編寫了大量的文章,包括 JavaWorld、 EXE、 NZZ Folio 和 the O'Reilly Network 方面的文章。作者擁有普林斯頓大學的機械工程學位。