Develop state-of-the-art mobile games
Trends in mobile games and a survey of related J2ME APIs
By Michael Juntao Yuan, JavaWorld.com, 11/07/03
Throughout the IT industry's history, computer games have been one of the drivers behind technology innovations. Computer
gamers are hungry for more hardware computing power; they are eager to push the limits of various software—from compelling
graphics to artificial intelligence (AI) to network security. Game developers and players are often the earliest adopters
of leading-edge computer technologies. Due to their innovative nature, games are not in danger of becoming technology commodities
controlled by big outsourcing corporations—there is always plenty of room for talented individual innovators in this space.
The market for games will continue to grow as the technology enhances the playing experience. As the enterprise IT revolution
improves our work life by saving time and money, we spend more time and money on games to improve the general quality of life.
Even in today's difficult economic times, gaming remains a fast growing and profitable industry sector. Java developers should
not overlook the tremendous opportunities here.
As in the rest of the IT industry, the latest buzz in the game industry is mobility. Mobile games have brought together many
unlikely players from traditional enterprise companies (e.g., Sun Microsystems' new game division), equipment manufactures
(e.g., Nokia's N-Gage and Qualcomm's Brew devices), and network operators (e.g., Vodafone's content services).
As Java developers, we are well suited to enter this profitable new industry sector because the Java 2 Platform, Micro Edition
(J2ME) is emerging as one of the most widely supported mobile gaming platforms. In this article, I discuss the opportunities
and challenges of mobile gaming from a Java developer's perspective. I also survey state-of-the-art mobile Java technology
through important J2ME specifications.
Mobile game characteristics
Mobile games' financial appeal comes from their wide reach. Mobile phones have become tightly integrated into the modern lifestyle.
They are second only to keys and wallets as the most commonly carried personal items. Unlike traditional console games that
target geeks and teenagers, mobile games are accessible to anyone—anywhere, anytime. Although each mobile game is inexpensive,
the projected large volume (e.g., a new game per week per person) will make this market immense and profitable. However, for
developers, mobile games present a big paradigm shift from console games due to the vastly different target audience, lifestyle,
and distribution models. Let's start with mobile games' requirements.
Requirements
A successful mobile game will likely have one of the following characteristics:
- Easy to learn: Since mobile games target general consumers not computer-savvy techies, they cannot have steep learning curves. Consumers
will not spend hours studying an operation manual of a game. The game must be playable the moment it is downloaded. It is
essential to keep the game simple.
- Interruptible: Multitasking is a basic characteristic of the mobile lifestyle. A mobile user often has small chunks of free time available
between tasks (e.g., while waiting for an email or a taxi to arrive). The same device is used for games, calendar management,
messaging, and work data access. A good mobile game should provide entertainment value for short time periods and allow users
to switch smoothly between game and work modes.
- Subscription based: Mobile games' financial success depends on their large volume. It is expensive to design and develop each game from scratch.
For a mobile game developer to make money, it is important to offer multiple titles from the same game engine along similar
basic storylines. Subscription-based games are the best way to generate sustained revenue.
- Rich social interactions: No matter how good a game design is, it quickly becomes boring when the player figures out the underlying pattern or has
exhausted all the play routes. For subscription-based games, it is important to incorporate other human players to increase
the intelligence and randomness of the game play. Games with rich social interactions have proven successful in many of today's
massively multiplayer games.
- Take advantage of mobile innovations: A huge amount of mobile technology research dollars have been spent on improving the usability and reliability of devices
and networks. As a result, the mobile device hardware and network protocols are very different from the desktop/console world
(e.g., Global Positioning System (GPS) extensions, barcode scanner, and Short Message Service (SMS)/Multimedia Message Service
(MMS) messaging). Good mobile games should take advantage of those innovative device features and network infrastructures.
- Nonexplicit content: Since all age/gender groups play mobile games and often in public/work settings, you should avoid explicit violent or sexual
content.
Types of mobile games
Based on the above criteria, the most successful future mobile games are casual games that provide entertainment value to
a broad range of players in all social settings. In particular, the following types of games are emerging as tomorrow's killer
games:
- Multiplayer games: Those games could provide mobile access to established online game communities. Or, they could create completely different
social structures taking advantage of mobile-specific features such as the multimedia messaging and location-based services.
Good game design and management are crucial to this type of game's success.
- Content-based games: Those games deliver copyrighted multimedia entertainment content, such as celebrity photos, video clips, voice ringtones,
and personalized sports games to music/movie/sports fans. The key to success is to provide a flow of high-quality content
that justifies the subscription cost.
- High-impact visual games: PC and console games have evolved from 2D to 3D. Mobile games will follow this trend too. There are already several mobile
3D toolkits and handsets available. However, 3D games are very resource intensive. They require expertise from both developers
and graphic designers. Professional shops will most likely develop these games.
During mobile games' early days, most developers were enthusiasts who wanted to play with their devices, learn new skills,
and make a quick buck. However, as more developers enter this space, mobile games have evolved into major productions that
involve professional designers, architects, developers, business dealers, lawyers, and artists. This is an inevitable trend
as the industry matures. For developers, this change poses both challenges and opportunities. While it is harder to develop
and sell simple games in one's spare time, more pro shops will offer better employment opportunities for many people.
The mobile value chain
To fully understand the mobile game landscape, you must understand how the money flows. This business's value chain is considerably
different from traditional games or enterprise applications:
- Developers: Software developers drive the value chain by creating great applications. However, most developers do not have the capacity
to handle mass marketing. They also lack the distribution channels to reach consumers.
- Publishers: Game publishers aggregate titles from developers. They build a brand name, certify the game for technical correctness, promote
the game, and build business relationships with wireless carriers. Publishers also handle billing on the developer's behalf
and typically share revenue with the developer.
- Wireless carriers: Wireless carriers are at the center of mobile game distribution channels. Carriers not only control the network but also
own the customer information. It is up to them to decide what devices and services to support. Carriers take a big chunk of
money out of the overall profit. Carriers can also bill the customers through existing service agreements.
- Wireless device manufacturers: Device manufacturers drive the technical innovation. They make new hardware and support development platforms. In fact, J2ME's
success is largely due to major device manufacturer adoption. Device manufacturers represent an independent force between
carriers and consumers.
- Consumers: Consumers eventually pay for the costs and margins incurred for the providers along the chain. A consumer can purchase games
from the publisher's Website or through content provisioning systems provided by the carrier.
Figure 1 shows the value chain.

Figure 1. The mobile value chain. Click on thumbnail to view full-size image.
J2ME smart clients
The J2ME platform has emerged as the most prominent mobile gaming platform widely accepted by developers, device manufacturers,
network carriers, and consumers. It has some very important features that benefit all parties.
Smart client characteristics
J2ME devices are smart. They can process information on their own. These are the most important characteristics differentiating
J2ME smart phones from previous generations of mobile phones:
- For users, a smart mobile phone's most appealing feature is that you can play games without always-on network connections.
Offline mode is necessary in today's 2-2.5G networks where the coverage is sporadic and data traffic is expensive. The ability
to cache data and queue network operations into transactions also significantly reduces the wireless network and improves
application reliability.
- Smart clients can integrate with backend game servers and peers (both wireless peers and Internet peers) using various protocols.
- Smart clients support rich user interface (UI) features crucial for visually appealing games.
- Smart clients can access mobile-specific network (e.g., SMS and MMS) or device extension (e.g., GPS) features. This makes
it possible to develop games that take full advantage of the mobile lifestyle.
- Smart clients offer stronger and more flexible security through advanced encryption and digital signature algorithms. With
smart clients, it is possible to transport sensitive user privacy data over the Internet and build effective online societies.
A portable platform
Compared with other smart client platforms, J2ME has a unique advantage: it is designed for mobility. J2ME applications run
on various devices from numerous vendors. That is extremely important in the highly competitive mobile device business due
to the large number of different devices. All major smart phone manufacturers have committed to support the J2ME platform.
Code portability is crucial for developers who want to maintain a single codebase yet still reach the maximum number of consumers.
J2ME solves the "lowest common dominator" problem, which has plagued desktop Java before, by defining a multilayer architecture
consisting of configurations, profiles, and optional packages. So far, in the mobile game industry, the most popular J2ME
platform is Mobile Information Device Profile (MIDP) and the optional packages built on top of MIDP. In this article, I focus
on the MIDP v2 platform.
Figure 2 shows the J2ME architecture.

Figure 2. The J2ME architecture. Click on thumbnail to view full-size image.
Since J2ME applications are portable across various devices, they are often downloaded and executed over the network. Without
proper precaution, that can open enormous security risks for both users and wireless carriers. Fortunately, Java is a secure
language by design. All byte-code applications are verified before execution; the JVM monitors the applications for security
and memory violations during the execution. The MIDP v2 runtime includes a fully featured, domain-based security manager that
grants API-level permissions to applications based on the identity of their digital signer.
Thanks to J2ME's wide adoption, mobile Java developer support has grown into a sizable market. Almost all popular Java development
tools have been adapted to fit J2ME developer needs. J2ME libraries and components are readily available from third-party
providers. Many of those libraries provide similar features to their Java 2 Platform, Standard Edition (J2SE) counterparts.
For example, the IBM Service Management Framework (SMF) supports Java servlets on PDAs; the PointBase Micro Edition provides
a Java Database Connectivity (JDBC)-like access method for mobile relational databases; and the IAIK JCE-ME supports a lightweight
version of Java Cryptography Extension (JCE). Those tools and libraries make it easy for J2SE developers to migrate their
skills to the mobile world. In turn, that creates a large developer base for J2ME vendors to leverage. The positive feedback
cycles will help J2ME's growth.
Discuss
Start a new discussion or jump into one of the threads below:
Resources
- Michael Yuan's new book Enterprise J2ME covers many of the end-to-end application design, data management, and provisioning topics discussed in this article
http://www.enterprisej2me.com/books.php
- If you just started learning J2ME, Jonathan Knudsen's Wireless Java, Second Edition is an excellent book that covers both MIDP v1 and v2 specifications
http://www.amazon.com/exec/obidos/ASIN/1590590775/javaworld
- The MIDP v2 specification and the Sun J2ME Wireless ToolKit
http://java.sun.com/products/midp/
- More information on kSOAP
http://www.ksoap.org
- The Wireless Messaging API (WMA)
http://java.sun.com/products/wma/
- The J2ME Multimedia API
http://java.sun.com/products/mmapi/
- The Nextel Open Source J2ME Toolkits
http://nextel.sourceforge.net/
- The Synclast UI for MIDP
http://www.synclast.com/
- JSR 184 (Mobile 3D Graphics API for J2ME)
http://www.jcp.org/en/jsr/detail?id=184
- SuperScape provides JSR 184-complaint solutions for device vendors and developers
http://www.superscape.com/
- Nokia N-Gage is the first dedicated mobile phone game device
http://www.n-gage.com/R1/en/developers.html
- Forum Nokia is the best resource for information on Nokia J2ME handsets and developer tools
http://www.forum.nokia.com/main.html
- JSR 172 (J2ME Web Services Specification)
http://www.jcp.org/en/jsr/detail?id=172
- JSR 230 (Data Sync API)
http://www.jcp.org/en/jsr/detail?id=230
- JSR 177 (Security and Trust Services API for J2ME)
http://www.jcp.org/en/jsr/detail?id=177
- JSR 75 (PDA Optional Packages for J2ME)
http://www.jcp.org/en/jsr/detail?id=75
- The J2EE Client Provisioning page
http://java.sun.com/j2ee/provisioning/
- JSR 124 (J2EE Client Provisioning Specification)
http://www.jcp.org/en/jsr/detail?id=124
- JSR 135 (Multimedia API)
http://www.jcp.org/en/jsr/detail?id=135
- "Access Web Services From Wireless Devices," Michael Yuan (JavaWorld, August 2002)
http://www.javaworld.com/javaworld/jw-08-2002/jw-0823-wireless.html
- "Data Security in Mobile Java Applications," Michael Yuan (JavaWorld, December 2002)
http://www.javaworld.com/javaworld/jw-12-2002/jw-1220-wireless.html
- "High-Availability Mobile Applications," Michael Yuan (JavaWorld, June 2003)
http://www.javaworld.com/javaworld/jw-06-2003/jw-0606-wireless.html
- View all of Michael Yuan's Wireless Java columns
http://www.javaworld.com/columns/jw-wireless-index.shtml
- Michael Yuan also authored the following JavaWorld articles:
-
- 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
- Sign up for JavaWorld's free weekly Micro Java email newsletter
http://www.javaworld.com/subscribe
- Visit the Device Programming dicussion
http://www.javaworld.com/javaforums/postlist.php?Cat=&Board=DeviceProgramming