Let the mobile games begin, Part 2
J2ME and .Net Compact Framework in action
By Michael Juntao Yuan, JavaWorld.com, 05/16/03
- Digg
- Reddit
- SlashDot
- Stumble
- del.icio.us
- Technorati
- dzone
In Part 1 of this series, I overviewed the two leading platforms for smart device development: Java 2 Platform, Micro Edition
(J2ME) and .Net Compact Framework. The two platforms' ultimate goals are the same: to enable rich clients for users and to
improve developer productivity. Both platforms offer similar benefits:
- Well-designed programming languages for development (Java for J2ME, and C#/Visual Basic .Net (VB.Net) for .Net Compact Framework): Compared with older device development languages such as C/C++ and eVB (eMbedded Visual Basic), these new languages are easy
to learn and have a large pool of qualified developers.
- Managed runtime environments: Applications for both platforms run inside virtual machines that manage security, memory usage, and runtime optimization.
Managed memory access improves developers' productivity by freeing them from the error-prone chore of memory management.
- Rich libraries and components: Object-oriented programming languages like Java, C#, and VB.Net allow developers to reuse software modules. Both platforms
come with a rich set of libraries for advanced UI (user interface), network connectivity, data management, and XML Web services.
Libraries for accessing common device extensions (e.g., the GPS (global positioning system) or scanner module) are also available.
- Familiar APIs from standard frameworks: J2ME and .Net Compact Framework allow desktop developers to migrate their skills to mobile development. For example, the
Java AWT (Abstract Window Toolkit) UI can be directly used in certain J2ME profiles, and the Windows Forms controls can be
used in Compact Framework applications. The IBM Service Management Framework (an OSGi (Open Services Gateway Initiative) implementation)
even brings common J2EE (Java 2 Platform, Enterprise Edition) APIs and patterns to devices.
- Extensive development tools: More than a dozen generic IDEs, development toolkits, and command-line tools are available from leading vendors in the J2ME
space. Microsoft's flagship development tool, Visual Studio .Net, is also fully integrated with Compact Framework.
Despite those similarities, the differences between the two platforms are profound. In a nutshell, J2ME is a specification
shaped by industry consensus, while .Net Compact Framework is a polished and fast-paced implementation driven by a single
powerful vendor. Below, I describe the two platforms' hardware support:
- J2ME runs on a range of devices from smart phones to set-top boxes from all major vendors, while .Net Compact Framework runs
only on devices from Microsoft Pocket PC licensees.
- Since Microsoft has control over Pocket PC hardware vendors, .Net Compact Framework developers have a specific hardware specification
to program against (e.g., screen size) and can assume the availability of certain native software (e.g., Windows Media Player).
- J2ME is also moving toward reducing the device market fragmentation via specifications like Java Specification Request (JSR)
185 (Java Technology for the Wireless Industry), which specifies the minimum hardware requirement for certain J2ME profiles.
Due to the requirements of uniform and powerful mobile devices, .Net Compact Framework is suitable for cash rich customers
with controlled mobile environments. It was initially focused on the enterprise mobile market, especially for Microsoft-centric
IT shops, while J2ME was originally active in the consumer sector. However, in the long run, most experts expect both platforms
to coexist in all market sectors. As developers, we must choose the right tools and make them all work in heterogeneous environments.
For example, we need to make J2ME clients work with .Net backend servers and vice versa. In this article, I walk through an
end-to-end mobile GIS (geographic information system) application that mixes Java and .Net on client, server, and middleware
layers. However, before we can dive into the sample application's technical aspects, we need to step back and look at the
business aspects critical to our architecture design.
- Digg
- Reddit
- SlashDot
- Stumble
- del.icio.us
- Technorati
- dzone
Resources
- "Let the Mobile Games Begin," Michael Juntao Yuan (JavaWorld)
- IBM WebSphere Studio Device Developer is an excellent J2ME IDE
http://www-3.ibm.com/software/wireless/wsdd/
- CodeWarrior Wireless Studio provides a J2ME visual GUI builder
http://www.metrowerks.com/MW/Develop/Wireless/Wireless_Studio/default.htm
- Microsoft Visual Studio .Net is the primary .Net Compact Framework development tool
http://msdn.microsoft.com/vstudio/
- The Microsoft Website has an excellent collection of how-to guides and sample code for simple tasks in .Net Compact Framework.
Please note that the site has two examples of MapPoint. However, the examples use a different architecture than the article's
http://smartdevices.microsoftdev.com/Learn/Code+Samples/QuickStarts/default.aspx
- For a tutorial on how to use kSOAP to access Web services, please refer to "Access Web Services from Wireless Devices," Michael
Juntao Yuan (JavaWorld, August 2002)
http://www.javaworld.com/javaworld/jw-08-2002/jw-0823-wireless.html
- JSR 172, J2ME Web Services Specification, is a JAX-RPC alternative to kSOAP
http://www.jcp.org/en/jsr/detail?id=172
- "Track Wireless Sessions with J2ME/MIDP," Michael Juntao Yuan and Ju Long (JavaWorld, April 2002) explains J2ME client-side session-tracking techniques
http://www.javaworld.com/javaworld/jw-04-2002/jw-0426-wireless.html
- JSR 185, Java Technology for the Wireless Industry, specifies a uniform requirement for J2ME handsets
http://www.jcp.org/en/jsr/detail?id=185
- JSR 179, Location API for J2ME, specifies an optional package for location-based services on J2ME handsets
http://www.jcp.org/en/jsr/detail?id=179
- JSR 209, Advanced Graphics and User Interface Optional Package for the J2ME Platform, could add Swing and Java 2D imaging
APIs to future editions of the Personal Profile
http://www.jcp.org/en/jsr/detail?id=209
- "Microsoft Trains Staff in Linux and Java," Peter Williams, (vunet.com, May 6, 2003)
http://www.vnunet.com/News/1140635
- For more articles on J2ME and wireless development, browse the Micro Java section of JavaWorld's Topical Index
http://www.javaworld.com/channel_content/jw-micro-index.shtml
- More of Michael Yuan's Wireless Java articles
http://www.javaworld.com/columns/jw-wireless-index.shtml
- Michael Yuan also authored the following JavaWorld articles