| Writing Mobile Wireless Applications |
by Mike Pini (Nov. 1, 2003)
Overview: Mobile Developer Tools
With the growing popularity of mobile computing devices, including Personal Digital Assistants (PDAs) and handsets, there is increasing demand by developers to be able to write an application once that can be run across a range of devices.
This article provides an overview of the Microsoft .NET Compact Framework, as well as the Java alternative, Java 2 Micro Edition (J2ME). It also looks at some of the Intel performance and tuning tools for mobile wireless applications.
There are many sets of tools and libraries that developers can use to create rich applications for smart mobile devices like PDAs and handsets. The focus, however, will increasingly be on two main approaches: the .NET Compact Framework, which currently targets Microsoft Pocket PC and devices powered by Windows CE .NET, and J2ME, which is not limited to Microsoft operating systems.
The .NET Framework
The .NET Framework provides a robust and efficient way to write Windows applications for the PC. This approach replaces earlier approaches, where Windows operating system (Win32) APIs were accessed either directly or indirectly through language-specific libraries used by Visual Basic or Visual C++ developers.
There are a number of key advantages of using the .NET Framework: - It provides full support for writing rich-client or Web-based applications, as well as XML Web services.
- It provides a standard set of programming interfaces or operations across all of the 20 or so supported languages. In practice, however, most new .NET applications are written either in Visual Basic .NET or C#. Visual Basic .NET is based on Visual Basic 6 with some important enhancements like full support for object-oriented programming, and a few unavoidable backward compatibility issues. C#, like Java, is based on C++, and it resembles Java in many ways.
- The Framework includes a common runtime environment that checks an application's code as it is loaded and manages it while it executes, handling errors, garbage collection, and security, among other things.
- Applications are compiled to an intermediate language and converted to executable machine code just prior to execution by the runtime environment. Potentially, this means that the .NET Framework runtime could be ported to other operating systems and hardware platforms without needing to rewrite, or even recompile, existing applications. For more information on the .NET Framework, see Introducing Microsoft .NET, Second Edition, from Microsoft Press.
The .NET Compact Framework
The .NET Compact Framework is a subset of the full .NET Framework. It brings the advantages of a robust and secure environment for executing client-side code and XML Web services to smart devices such as PDAs, mobile phones, and set-top boxes. Specifically it supports the following: - Pocket PC (and Pocket PC 2002 Phone Edition, for users who want a PDA they can make phone calls with) currently based on the Windows CE 3.0 operating system.
- Embedded solutions running on Windows CE .NET, which is the latest version of Microsoft's operating system for smart mobile devices.
- Support is expected to follow for the Microsoft Smartphone 2002, which is used primarily for voice calls but also provides most PDA functions.
The .NET Compact Framework (like the full .NET Framework) is an abstraction of the underlying operating system facilities, and the vast majority of an application's requirements can be satisfied through its standard functionality. However, if access is required to a unique device feature, it can easily be supported because the .NET Compact Framework is designed to be extended.
Pocket PCs are available from more than 20 companies, including Casio, Dell, HP and Compaq, Fujitsu-Siemens, Packard Bell, Toshiba, T-Mobile, ViewSonic, and Zayo. In practice, Pocket PC runs on Intel architecture almost exclusively.
The Intel PCA Applications processors such as the Intel PXA250 Applications Processor (based on Intel XScale technology), are used in the newer devices. This raises the performance bar compared to microprocessors used on earlier devices, since they run at up to 400 MHz and with reduced power consumption.
Pocket PC core applications include Pocket Outlook e-mail and personal information manager (PIM), Pocket Internet Explorer (HTML and WAP), MSN Messenger, Pocket Word and Excel, Windows media player, and the ability to synchronize information with a PC. Input is through a stylus using the screen keyboard or by means of a handwriting-recognition program. They can support wireless LAN and cellular connections. Overall, Pocket PC is an attractive platform for running custom-developed applications.
Application Development Tools
Visual Studio .NET 2003 is the latest version of Microsoft's standard development environment and toolset. It incorporates support for developing applications for smart mobile devices using the .NET Compact Framework. Using Visual Studio .NET 2003, millions of existing desktop developers are presented with a consistent development environment across the desktop, PDA and other handheld devices.
This makes it easier and less costly to develop applications, facilitates code reuse, and thereby supports the production of more robust applications. Just as importantly, it encourages the development of "occasionally connected computing" applications, which dynamically adjust to the availability of a wireless connection and are able to usefully work offline until reconnected.
In this first release of the .NET Compact Framework and the Visual Studio .NET mobile developer tools, you can build applications in Visual Basic .NET or C#; a later release may support other Windows .NET languages. For applications that need a database, SQL Server CE, a compact relational database, runs on Windows CE devices and is compatible with Windows SQL Server.
Any .NET Compact Framework applications can be debugged using either an emulator running on the development machine or on the physical device attached to the development machine through a serial (or USB) port or over a network connection.
So far, we have discussed the development of rich-client applications. If browser-based applications are required, Microsoft ASP.NET Mobile Controls (formerly the Mobile Internet Toolkit), now part of Visual Studio .NET 2003, can be used to develop mobile Web applications that adapt their page rendering for a range of devices, such as micro-browsers on PDAs, smart phones, and WAP phones.
These applications execute on the Microsoft Internet Information Server (IIS) Web server. The devices need only a browser and do not require the .NET Compact Framework or any other downloaded application code. For more information on the Microsoft .NET Compact Framework, see Microsoft .NET Compact Framework (Core Reference), from Microsoft Press.
Java Solution
Now let's examine the Java solution. There are three editions: - The Java 2 platform, Standard Edition (J2SE) for building rich desktop or browser-based applications.
- The Java 2 platform, Enterprise Edition (J2EE), a superset of J2SE, for building server-based, scalable transactional components: Enterprise Java Beans (EJBs).
- The Java 2 platform, Micro Edition (J2ME), a subset of J2SE, for building embedded applications and applications for smart mobile devices.
These are specifications only; it is up to software vendors to produce actual implementations. Each specification defines a standard set of interfaces or libraries that Java applications can use. The resulting Java applications are compiled down to an intermediate byte-code language.
The runtime environment, the Java Virtual Machine (JVM), loads and executes the application, converting the byte code to executable machine code. The JVM is responsible for managing the applications as they run. There are many parallels with the .NET Framework.
The Java 2 Platform, Micro Edition (J2ME) is available in two main configurations that incorporate a Virtual Machine (VM) and core APIs: - The first is Connect Limited Device Configuration (CLDC) for low-end, resource-constrained devices with limited connectivity. There are two options, called profiles.
- The Mobile Information Device Profile (CLDC-MIDP) is widely used in hundreds of millions of phones today.
- The Personal Digital Assistant Profile (CLDC-PDAP) is intended for future low-end PDAs that function primarily as PIMs.
- The second configuration is the Connected Device Configuration (CDC) which is relatively new. It is intended for new, more sophisticated devices, including PDA devices. There are three profiles that build on each other and relate primarily to the increasing capabilities of the user interface. The most sophisticated of these is Personal Profile (CDC-PP) which equates to the capabilities in J2SE. It is also the natural competitor to the .NET Compact Framework.
There are also a whole set of optional packages that extend the profiles; these include Wireless Messaging API, Mobile Media API, J2ME RMI Optional Package, and the JDBC Optional Package for CDC Foundation Profile, as well as others still in the specification process, such as J2ME Web Services.
Intel Tools Optimize Existing Applications
Intel has a range of software tools that support the Intel Personal Internet Client Architecture (Intel PCA) and Intel XScale technology used on smart mobile devices: - Intel Integrated Performance Primitives (Intel IPP) libraries enhance application performance by optimizing a wide variety of image, audio, video, and speech functions for the Intel XScale microarchitecture, as well as the Pentium 4 processor, the Intel Xeon processor, and the Itanium 2 processor.
- Intel Graphics Performance Primitives (Intel GPP) is a set of powerful 3D graphics functions that support Microsoft Pocket PC 2002. It includes date-type conversion, arithmetic, trigonometric, vector, matrix, and raster primitives optimized for the Intel PCA Applications Processors.
- Intel VTune Analyzer update for Intel XScale technology, an add-on to the VTune Performance Analyzer 6.1, runs on a special target development platform to provide insight into how the Intel PXA250 Applications Processor is being utilized on Windows CE 3.0 (Pocket PC 2002) or Windows CE .NET. A knowledge base built into the Intel Tuning Assistant enables it to suggest optimization techniques.
- The Intel C++ Compiler for Intel XScale Microarchitecture running under Microsoft Windows CE .NET capitalizes on the proven Intel compiler technology used on other Intel processor families to support Intel PCA Applications Processor and Microsoft Windows CE .NET. The Compiler is compatible with Microsoft Windows CE and Microsoft eMbedded Visual C++.
Summary
The .NET Compact Framework offers a very good level of application portability for developers across Microsoft Windows server, desktop, and mobile device operating systems, while J2ME potentially offers a level of portability across any operating system—provided support has been developed for that operating system.
There is a natural tendency for companies to want to adopt a single approach so that developers need only learn and maintain one set of skills. However, both environments offer mature programming for mobile devices and offer excellent solutions for developing distributed applications across the enterprise, from server to desktop to PDA.
For applications or algorithms that must run efficiently on Intel processors, including the Intel PCA Applications Processors, Intel offers a robust set of optimization products.
About the author: Mike Pini has been in the IT industry for more than 20 years. He currently works as a full-time consultant for Content Master. His experience includes hardware design, embedded computer systems, system and application programming, databases, distributed enterprise systems, and various PC operating systems and server products. Mike has worked for Intel, as well as IT content development, training, and consultancy companies.
He has performed a number of roles, including principal consultant, and developed numerous seminars, technical courses, and white papers, as well as presenting at company and industry events. Mike received his BSc (Hons) in electrical and electronic engineering from City University, London. He is a member of the IEEE.
Copyright © Intel Corporation 2003. All rights reserved. Reproduced by DeviceForge LLC with permission. This article was originally published in Intel's Technology@Intel Magazine.
(Click here for further information)
|
|
|