Let the mobile games begin, Part 1

A comparison of the philosophies, approaches, and features of J2ME and the upcoming .Net CF

1 2 3 Page 2
Page 2 of 3
 .Net Compact Framework J2ME Connected Device Configuration J2ME Connected Limited Device Configuration
User interfaceRich subset of Windows FormsRich subset of AWT (Abstract Windowing Toolkit), vendor-specific UI librariesMIDP liquid crystal display UI, PDA Profile subset of AWT, vendor-specific UI libraries
Database APISubset of ADO.Net, DataGridRich subset of JDBCVendor-specific JDBC-like APIs
Mobile databaseSQL Server CE, Sybase iAnywhere Solutions(coming soon)IBM DB2 Everyplace, iAnywhere Solutions, PointBase, Oracle9i LiteVendor-specific relational implementation over RMS, Oracle SODA
Remote databaseAny ADO.Net compatibleAny JDBC compatibleVendor-specific JDBC-like API bridge
Database synchronizationVendor specificVendor specificVendor specific
XML APIBuild into ADO.Net and other standard APIsThird-party tools (standards coming soon)Third-party tools (standards coming soon)
Web servicesBuilt-inThird party (standards coming soon)Third party (standards coming soon)
Web services toolsIntegrated with VS.NetkSOAP plug-ins for leading IDEskSOAP plug-ins for leading IDEs
Direct RPCNot recommendedRich subset of RMI (remote method invocation)N/A
Email and PIM (personal information manager)P/Invoke Outlook APIsJavaPhone and third-party APIsUpcoming PDA Profile and third party
SMSP/Invoke device SMS stackWireless Messaging APIWireless Messaging API
Instant messengerP/Invoke MSN (Microsoft Network) and other IM client APIsThird-party APIs for most IM clients including Jabber and JxtaThird-party APIs for most IM clients including Jabber and Jxta
Enterprise messagingP/Invoke MSMQProprietary JMS (Java Message Service) APIsJMS via third-party toolkits (e.g., WebSphere MQ Everyplace, iBus Mobile)
CryptographyThird-party APIsJCE (Java Cryptography Extension) and third-party librariesThird-party libraries
MultimediaP/Invoke Windows Media Player APIsSubset of JMFBuilt into MIDP plus J2ME multimedia APIs
GameIncluded Windows Forms UIDirect draw on Canvas GameCanvas support in MIDP
Location APIAPIs provided by carriersThird party (standards coming soon)Third party (standards coming soon)

Enterprise databases

To fully leverage smart clients' offline capabilities, an on-device mobile database is crucial. .Net CF supports a substantial subset of ADO.Net (Active Data Objects). The standard relational database access API on the Java platform is Java DataBase Connectivity (JDBC). The J2ME JDBC optional package supports most JDBC 3.0 APIs on the CDC platform. PersonalJava supports the JDBC 2.x API. On the CLDC platform, several vendors have devised proprietary database implementations over the record management system (RMS). Those implementations support limited JDBC-like methods.

Isolated mobile databases by themselves are hardly useful. They must be synchronized and consolidated with enterprise backend databases. Currently, no standard API for database synchronization exists in either .Net CF or J2ME. Each vendor's mobile database can synchronize only through its own synchronization engine. Mobile database vendors differentiate themselves by offering special optimization and additional features. In this section, you look at solutions provided by several leading mobile database vendors:

  • Microsoft SQL Server CE: The SQL Server CE provides full ADO.Net support for the .Net CF platform. Since the SQL Server CE is bundled with VS.Net, it is pervasive on .Net CF. However, SQL Server CE has a rather large (1.5 MB) memory footprint. Also, SQL Server CE only synchronizes with SQL enterprise databases, requiring the backend environment to be Microsoft only too.
  • Sybase iAnywhere Solutions: iAnywhere's SQL Anywhere Studio is currently the most popular mobile database. According to a 2002 Gartner survey, its market share is 78 percent. A core innovation of SQL Anywhere Studio is to automatically generate custom-built UltraLite databases that only contain the exact functionality your application requires. That drastically slashes the memory footprint without compromising features. SQL Anywhere Studio can currently generate UltraLite databases for CDC and PersonalJava. UltraLite support for .Net CF will surface in early 2003. Auto-generated UltraLite databases contain APIs to synchronize with Sybase and third-party enterprise databases through iAnywhere Solutions' MobiLink synchronization engine.
  • PointBase Micro: PointBase provides pure Java embedded databases that run on both the CDC and CLDC/MIDP platforms. SQL support on MIDP is impressive. PointBase UniSync synchronization engine synchronizes with any JDBC backend database with special optimization for Oracle and PointBase Embedded databases.
  • IBM DB2 Everyplace: DB2 Everyplace is a stripped-down version of DB2 Enterprise database. It supports JDBC and ODBC (Open Database Connectivity) APIs. DB2 Everyplace also contains a product called FastRecordStore, which provides a relational layer over the MIDP RMS. Through the IBM Sync, DB2 Everyplace databases synchronize with most popular backend databases.
  • Oracle9i Lite: Oracle9i Lite databases have footprints of 50 KB to 1 MB depending on their edition. Oracle9i Lite supports the JDBC and ODBC APIs. On MIDP, Oracle provides a mobile database implementation over RMS. Oracle's MIDP database is completely object oriented using the SODA (Simple Object Database Access) technology. For remote data access from MIDP, the Oracle J2ME SDK has a package that enables simple SQL access to backend databases through the Oracle9i wireless application server. Oracle9i Lite databases only synchronize with Oracle enterprise back ends.

Web services

XML Web services is the key to future enterprise integration. SOAP (Simple Object Access Protocol) is becoming the ubiquitous protocol for accessing componentized enterprise back ends. Being an early adopter and promoter of SOAP Web services, Microsoft has a head start on Web services integration with mobile devices. With the support from VS.Net, consuming Web services in .Net CF applications is easy. In many cases, developers do not need to write any code and can just treat the remote service as a local object.

On J2ME, SOAP client support is currently not standardized. We must rely on third-party J2ME SOAP libraries, such as the open source kSOAP, to build mobile SOAP clients. Popular J2ME IDEs such as Sun ONE Studio, CodeWarrior Wireless Studio, and WebSphere Studio Device Developer have recently added SOAP client stub generators for kSOAP. Oracle supports J2ME Web services clients through its upcoming 9i wireless application server. The server communicates with J2ME clients using a proprietary RPC (remote procedure call) protocol and relays SOAP messages. In the future, the J2ME Web Services Specification (JSR 172, available in third quarter 2003) will likely standardize J2ME Web services client APIs.

Support for the service gateway paradigm

Service gateway is not a part of either .Net CF or J2ME. But it is an important component in today's smart home or enterprise networks. In this section, I first give an overview of the service gateway architecture and then discuss options available from third-party vendors.

A service gateway integrates with backend servers, stores application data, and facilitates messaging on behalf of its thin or lightweight smart mobile clients. The service gateway architecture allows us to use small and pervasive devices while still leveraging rich functionalities. Asynchronous and cache-enabled messaging middleware in the gateway prove essential to ensuring mobile applications' quality of service. The gateway architecture also allows more efficient application designs. For example, the Model-View-Controller (MVC) design pattern can be easily applied.

Mobile gateways

Mobile gateways implemented on mobile platforms are very attractive. For example, a mobile gateway could be a set-top box for a home network, an auto-mounted device for a car network, or a Bluetooth PDA for a personal network.

Since .Net CF is brand-new, few gateway products are specifically designed for it. In addition, .Net CF presents some technical difficulties. .Net CF was not designed to run lightweight application servers required in mobile gateways. It does not directly support MSMQ (Microsoft Message Queuing) either.

On the more mature J2ME, the primary mobile service gateway product is from IBM: the WebSphere Everyplace Embedded Software Suite that runs on IBM's J2ME runtime known as the WebSphere Micro Environment (formally known as J9). WebSphere Everyplace Embedded Software Suite contains the IBM Service Management Framework (SMF), which is a lightweight server framework that runs on top of the CDC and the Foundation Profile. SMF is an implementation of the OSGi (Open Service Gateway Initiative) specification. OSGi defines a Java framework that runs managed service modules (bundles). One type of service OSGi provides is an HTTP service based on J2EE servlets. The SMF bundles interact with middleware components like IBM DB2 Everyplace and WebSphere MQ Everyplace.

Fixed gateways

Of course, service gateways can reside on fixed server computers too. In this scenario, the gateway computer runs a full-blown server framework such as ASP.Net (Active Server Pages) or J2EE. This architecture is suitable for heavy-duty gateways serving devices in a limited range (e.g., a factory floor or an office). .Net CF or J2ME devices are gateway clients in this scenario.

In the Microsoft camp, the Microsoft Mobile Information Server (MIS) is a powerful gateway, messaging, and synchronization server for Pocket PC as well as thin client devices. However, .Net CF lacks built-in APIs to interact with Microsoft MIS. I expect third-party vendors will provide such support soon after .Net CF 1.0 is released

In the Java world, Oracle has a complete line of gateway application server products running on top of J2EE. Together with Oracle J2ME SDKs, the upcoming Oracle9i wireless application server provides gateway integration points for mobile devices to many other Oracle or third-party application servers.

Client provisioning and life cycle management

Device management is one of the most costly parts of today's mobile enterprise solutions. Ensuring that the right users get the right software and that the software is updated promptly is important. For general public mobile applications, wireless network carriers must build walled gardens to protect customers as well as revenue sources.

On .Net CF, applications are installed over ActiveSync or over the air (OTA) through the Pocket PC Internet Explorer. There is no standard way for the back end to control the client once the client deploys.

On J2ME, an application can be managed from the back end throughout its life cycle. For MIDP applications, a well-defined OTA provisioning specification mandates how a MIDlet suite is installed and updated. For mobile service gateway applications, the OSGi framework handles bundle life cycle management. On the server side, the J2EE Client Provisioning Specification defines a complete server framework that matches and deploys smart clients to a variety of devices. The J2EE client provisioning server integrates with customer relationship management modules to enable custom tracking, billing, and upgrading logics.

Developer is king

One of the most compelling reasons for choosing .Net CF or J2ME is to leverage existing developer skills. The list below summarizes available mobile application platforms and developer groups most likely to adopt them:

  • .Net CF: .Net desktop application developers; VB developers.
  • J2ME/CDC: J2SE client application developers; Java Web applet developers; J2EE server application developers for OSGi gateways.
  • J2ME/CLDC: All J2SE developers. To become familiar with javax.microedition APIs, especially the UI features, some learning is required.

.Net CF development tools

Microsoft's flagship IDE Visual Studio .Net is an excellent product that provides similar design interfaces for desktop and mobile applications. For example, to migrate a desktop UI design to .Net CF, you merely copy and paste visual components to a new designer window. VS.Net also features strong support for Web services integration and relational database access. I found that most auto-generated code snippets are easy to read and modify by hand. VS.Net is tightly integrated with Visio Enterprise Network Tools edition, which can generate C# or VB.Net code from your UML (Unified Modeling Language) diagrams. VS.Net supports debugging on both high-fidelity emulators and real devices. However, VS.Net is not cheap. As of today, no free command-line tool exists for .Net CF development. Nor does any third-party IDE product support .Net CF. More tools will be available in the future when .Net CF matures.

J2ME development tools

On the J2ME front, command-line tools and vendor-specific toolkits are readily available. Sun's J2ME Wireless ToolKit is a widely used MIDP development tool. Antenna is an open source project that extends Java's de facto Ant build tool to J2ME. But of course, for most developers, IDEs are still essential. All major Java IDEs now have J2ME modules or plug-ins:

  • Sun ONE Studio Community Edition with wireless modules is free and has excellent support for enterprise features.
  • JBuilder with MobileSet has a great visual UI designer and good UML design support.
  • CodeWarrior Wireless Studio is bundled with many useful third-party tools. It supports development on both CLDC and CDC/PersonalJava.
  • IBM WebSphere Studio Device Developer is based on the popular Eclipse IDE platform. It supports both on-device and emulator debugging. If you choose one of IBM's smart mobile middleware solutions, WebSphere Studio Device Developer is naturally the best tool.
  • Oracle9i JDeveloper IDE helps integration between Oracle mobile servers and J2ME clients.
  • Data Representation's Simplicity IDE has visual designers not only for UI components, but also for end-to-end communication logic components, such as an XML-based transaction engine. Simplicity supports integration with legacy (mainframe) information servers through a visual screen reader.

A big challenge for all J2ME IDEs is vendor SDK integration. Every device vendor provides SDKs for their device emulators and proprietary J2ME extensions. The Unified Emulator Interface (UEI) is designed to standardize the interfaces between IDEs and device SDKs. But the UEI is available only through a Sun licensing program. An open standard is needed.

Conclusions

.Net CF and J2ME are both excellent platforms for developing smart clients for mobile commerce applications. The .Net CF platform focuses on enterprise applications with rich UI, database, and XML Web services support. VS.Net is an excellent tool for .Net CF development. But .Net CF runs only on Windows-powered high-end PDAs. As a young platform, it currently lacks support for gateway servers and choices for mobile databases. Application life cycle management is also weak.

J2ME sports a modular design and is portable across a variety of devices. The platform provides balanced support for both enterprise and consumer applications. Most important, J2ME APIs undergo rigorous standardization processes to ensure wide industry support and minimum learning for developers. J2ME vendors offer excellent selections of mobile databases and gateway application server products. However, keeping the J2ME platforms simple and avoiding fragmentation proves challenging. J2ME Web services tools still need improvements and standardization.

1 2 3 Page 2
Page 2 of 3