Devices Devices Devices

Appportunity

Build your own Android App Dev Empire

Get Instant Access

Android is not locked into a single hardware ecosystem. Many prominent handset manufacturers such asHTC, Motorola, and Samsung have jumped onto the Android wagon and offer a wide range of devices running Android. Besides handsets, there's also a slew of tablet devices coming to the market that build upon Android. Some key concepts are shared by all devices, though, which makes our lives as game developers a little easier.

Hardware

There are no hard minimum requirements for an Android device. However, Google has recommended the following hardware specifications, which virtually all available Android devices fulfill and most often surpass significantly:

ARM-based CPU: At the time of writing this book, this requirement was relaxed. Android now also runs on the x86 architecture. The latest ARM-based devices are also starting to feature dual-core CPUs.

128MB RAM: This specification is a minimum. Current high-end devices already include 512MB RAM, and 1GB RAM devices are expected in the very near future.

256MB flash memory: This minimum amount of memory is for storing the system image and applications. For a long time, this lack of memory was the biggest gripe among Android users because third-party applications could be installed only to flash memory. This changed with the release of Froyo.

Mini or Micro SD card storage: Most devices come with a few gigabytes of SD card storage, which can be replaced with bigger SD cards by the user.

16-bit color Half-Size Video Graphics Array (HVGA) TFT LCD with touch screen: Before Android version 1.6, only HVGA screens (480x320 pixels) were supported by the operating system. Since version 1.6, lower- and higher-resolution screens are supported. The current high-end devices have Wide Video Graphis Array (WVGA) screens (800x480, 848x480, or 852x480 pixels), and some low-end devices sport Quarter-Size Video Graphics Array (QVGA) (320x280 pixels) screens. Touch screens are almost always capacitive and are only single-touch capable on most older devices.

Dedicated hardware keys: These keys are used for navigation. Most phones to date have at least a menu, search, home, and a back key. Some manufacturers have started to deviate from this and are including a subset of these keys or no keys at all.

Of course, there's a lot more hardware in actual Android devices. Almost all handsets have GPS, an accelerometer, and a compass. Many also feature proximity and light sensors. These peripherals offer game developers new ways to let the user interact -with the game, and we'll have a look at some of them later on. A few devices have a full QWERTY keyboard as well as a trackball. The latter is most often found in HTC devices.

Cameras are also available on almost all current devices. Some handsets and tablets have two cameras, one on the back and one on the front for video chat.

Especially crucial for game development are dedicated graphics processor units (GPUs). The earliest handset to run Android already had an OpenGL ES 1.0compliant GPU. More-modern devices have GPUs comparable in performance to the Xbox or PlayStation 2 and support OpenGL ES 2.0. If no graphics processor is available, a fallback in the form of a software renderer called PixelFlinger is provided by the platform. Many low-budget handsets rely on the software renderer, which is often sufficiently fast for low-resolution screens.

Along with the graphics processor, any currently available Android device also has dedicated audio hardware. Many hardware platforms also have special circuitry to decode different media formats such as H.264 in hardware. Connectivity is provided via hardware components for mobile telephony, Wi-Fi, and Bluetooth. All these hardware modules of an Android device are most often integrated in a single system on a chip (SoC), a system design also found in embedded hardware.

First Gen, Second Gen, Next Gen

Given the differences in capabilities, especially in terms of performance, Android developers usually group devices into first-, second-, and next-generation devices. This terminology comes up a lot, even more so when it comes to game development for Android. Let's try to define these terms.

Each generation has a specific set of characteristics, mostly a combination of the Android version(s) used, the CPU/GPU, and the screen resolution of the devices within a generation. Although the hardware specifications are static, this might not be the case for the Android version used on a device.

In the Beginning: First Generation

First-generation devices are the current baseline and are best described by examining one of their most prominent specimens, the HTC Hero, shown in Figure 1-3.

Figure 1-3. The HTC Hero

This was one of the first Android phones that was said to be an iPhone killer, released in October 2009. The Hero was first shipped with Android version 1.5 installed, which was the standard for most Android handsets for most of 2009. The last official update for the Hero was to Android version 2.1. Newer updates can be installed only if the phone is rooted, a process that grants full system access.

The Hero has a 3.2-inch HVGA capacitive LCD touch screen, a 528MHz Qualcomm MSM7201A CPU/GPU combination, an accelerometer, and a compass, as well as a 5-megapixel camera. It also has the typical set of navigational hardware keys that most first-generation devices exhibit, along with a trackball.

The Hero is a prime example of first-generation devices. The touch screen has only limited support for multi-touch gestures such as the pinch zoom and no true multi-touch capability. Note that multi-touch gestures are not officially supported by the device and are also not exposed through the APIs of the official Android version 1.5. In this regard, the Hero was a major diasppointment for game developers who had hoped for similar multi-touch capabilities as those found on the iPhone.

Another common trait of first-generation devices is the screen resolution of 480*320 pixels, the standard resolution up until Android version 1.6.

In the CPU/GPU department, the Hero employs the very common MSM7201A series by Qualcomm. This chip does not support hardware floating-point operations, another feature of high importance to game developers. The MSM7201A is OpenGL ES 1.0 compliant, which translates to a fixed-function pipeline as opposed to a programmable, shader-based pipeline. The GPU is reasonably fast but outperformed by the PowerVR MBX Lite chip found in the iPhone 3G, which was available at the same time. HTC used the same chip in a couple of other first-generation handsets, such as the famous HTC Dream (T-Mobile G1). The MSM7201A is considered the low end when it comes to hardware-accelerated 3D graphics and is thus your greatest enemy when you want to target all generations of Android devices.

First-generation devices can thus be identified by the following features:

■ A CPU running at up to ~500MHz without hardware floating-point support

■ A GPU, mostly in the form of the MSM7201A chip, supporting OpenGL ES 1.x

■ A screen resolution of 480x320 pixels

■ Limited multi-touch support

■ Initially deployed with Android 1.5/1.6 or even earlier versions

This classification is of course not strict. Many low-budget devices just coming out share a similar feature set. Although they are not exactly first generation, we can still put them in the same category as the Hero and similar devices.

First-generation devices still have a considerable market share at the time of writing this book. If we want to reach the biggest possible audience, we have to consider their limitations and adapt our games accordingly.

More Power: Second Generation

At the end of 2009, a new generation of Android devices entered the scene. Spearheaded by the Motorola Droid and Nexus One (released in January 2010), this new generation of handsets demonstrated raw computational power previously unseen in mobile phones.

The Nexus One is powered by a 1GHz Qualcomm QSD8250, a member of the Snapdragon family of chips. The Motorola Droid uses a 550MHz Texas Instruments 0MAP3430. Both CPUs support vector hardware floating-point operations via the Vector Floating Point (VFP) and NEON ARM extensions. The Nexus One has 512MB RAM, and the Motorola Droid has 256MB RAM. Figure 1-4 shows their designs.

Figure 1-4. The Nexus One and Motorola Droid

Both phones have a WVGA screen, an 800^480 pixel Active-Matrix Organic Light-Emiting Diode (AMOLED) screen (in the case of the Nexus One) or a 854x480 pixel LCD screen (in the case of the Motorola Droid). Both screens are capacitive multi-touch screens. Although both devices were advertised as multi-touch capable, they do not work as expected in a couple of situations. The most common problem is the reporting of false touch positions when two fingers are close on either the x- or y-axis on the screen.

The Nexus One was first shipped with Android version 2.1, and the Motorola Droid was shipped with version 2.0. Both phones have received updates to Android version 2.2.

Of special interest to game developers are the built-in GPUs. The PowerVR SGX530 is a very potent GPU also used in the iPhone 3GS. Note that the screen size of the iPhone 3GS is actually half that of the Motorola Droid, which gives the iPhone 3GS a slight performance advantage, because it has to draw fewer pixels per frame. The Adreno 200 chip used in the Nexus One is a Qualcomm product and slightly slower than the PowerVR SGX530. Depending on the rendered scene, both chips can be nearly a magnitude faster than the MSM7201A found in many first-generation devices.

Second-generation devices can be identified by the following features:

A CPU running between 550MHz and 1GHz with hardware floating-point support

A programmable GPU supporting OpenGL ES 1 .x and 2.0

A WVGA screen

Multi-touch support

Note that a few first-generation devices received updates to Android version 2.1, which has some positive impact on overall system performance but does not, of course, change the fact that their hardware specifications are inferior to second-generation devices. The distinction between first- and second-generation devices can thus be made only if all factors such as CPU, GPU, or screen resolution are taken into account.

Over the course of 2010, many more second-generation devices appeared, such as the HTC Evo or the Samsung i9200 Galaxy S. Although they feature some improvements over the Nexus One and Motorola Droid such as bigger screens and slightly faster CPUs/GPUs, they are still considered second-generation devices.

The Future: Next Generation

Device manufacturers try to keep their latest and greatest handsets a secret for as long as possible, but there are always some leaks of specifications.

General trends for all future devices are dual-core CPUs, more RAM, better GPUs, and higher screen resolutions. One such future device is the Samsung i9200 Galaxy S2, which is rumored to have a 1280x720 pixel AMOLED 2 display, a 2GHz dual-core CPU, and 1GB RAM. Not much is known about the GPU this handset will use. A possible candidate would be the new NVIDIA Tegra 2 family of chips, which promises a significant boost in graphics performance. The next generation is also expected to ship with the latest Android version (2.3).

Although mobile phones will probably remain the focus of Android for the immediate future, new form factors will also play a role in Android's evolution. Hardware manufacturers are creating tablet devices and netbooks, using Android as the operating system. Ports of Android for other architectures such as x86 are also already in the making, increasing the number of potential target platforms. And with Android 3.0, there's even a dedicated Android version for tablets available.

Whatever the future will bring, Android is here to stay!

Game Controllers

Given the differences of input methods available on various Android handsets, a few manufacturers produce special game controllers. Because there's no API in Android for such controllers, game developers have to integrate support separately by using the SDK provided by the game controller manufacturer.

One such game controller is called the Zeemote JS1, shown in Figure 1-5. It features an analog stick as well as a set of buttons.

Figure 1-5. The Zeemote JS1 controller

The controller is coupled with the device via Bluetooth. Game developers integrate support for the controller via a separate API provided by the Zeemote SDK. A couple of Android games already support this controller when available.

Users could in theory also couple the Nintendo Wii controller with their device via Bluetooth. A couple of prototypes exploiting the Wii controller exist, but there's no officially supported SDK—which makes integration a tad bit awkward.

The Game Gripper, shown in Figure 1-6, is an ingenious invention specifically designed for the Motorola Droid and Milestone. It is a simple rubber accessory that slides over the QWERTY keyboard of the phone and overlays a more or less standard game controller layout on top of the actual hardware keyboard. Game developers need only add keyboard controls to their game and don't have to integrate a special library to communicate with the Gripper. It's just a piece of rubber, after all.

I

f

1

M

suren

TO**— uooooo

Figure 1-6. The Game Gripper in action

Figure 1-6. The Game Gripper in action

Game controllers are still a bit esoteric in the realm of Android. However, some successful titles have integrated support for some controllers, a move generally well received by Android gamers. Integrating support for such peripherals should therefore be considered.

Was this article helpful?

0 0

Post a comment