Devices, Devices, Devices!

Android is not locked into a single hardware ecosystem. Many prominent handset manufacturers, such as HTC, Motorola, Samsung, and LG, have jumped onto the Android bandwagon, and they offer a wide range of devices running Android. In addition to handsets, there are a slew of available tablet devices that build upon Android. Some key concepts are shared by all devices, though, which will make your life as game developer a little easier.

Hardware

Among the things that will be discussed later in the section on that moving target, Compatibility, Google originally issued the following minimum hardware specifications. Virtually all available Android devices fulfill, and often significantly surpass, these recommendations:

128MB RAM: This specification is a minimum. Current high-end devices already include 1GB RAM and, if Moore's law has its way, the upward trend won't end any time soon.

256MB flash memory: This is the minimum amount of memory required for storing the system image and applications. For a long time, lack of sufficient memory was the biggest gripe among Android users, as third-party applications could only be installed 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 higher-capacity SD cards by the user.

16-bit color Quarter Video Graphics Array (QVGA) Thin Film Transistor Liquid Crystal Display (TFT LCD): Before Android version 1.6, only Half-size VGA (HVGA) screens (480×320 pixels) were supported by the operating system. Since version 1.6, lower-and higher-resolution screens have been supported. The current high-end handsets have Wide VGA (WVGA) screens (800×480, 848×480, or 852×480 pixels), and some low-end devices support QVGA screens (320×280 pixels). Tablet screens come in various sizes, typically about 1280×800, and Google TV brings support for HDTV's 1920×1080 resolution! While many developers like to think that every device has a touchscreen, that is not the case. Android is pushing its way into set-top boxes and PC-like devices with traditional monitors. Neither of these have the same touchscreen input as a phone or tablet.

Dedicated hardware keys: These keys are used for navigation. Devices will always provide buttons specifically mapped to standard navigation commands, such as home and backs, usually set apart from on-screen touch commands. With Android the hardware range is huge, so make no assumptions!

Of course, most Android devices come with a lot more hardware than is required for the minimum specifications. 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 games, and you can take a look at some of these later on. A few devices even have a full QWERTY keyboard and a trackball. The latter is most often found in HTC devices. Cameras are also available on almost all current portable devices. Some handsets and tablets have two cameras: one on the back and one on the front, for video chat.

Dedicated graphics processing units (GPUs) are especially crucial for game development. The earliest handset to run Android already had an OpenGL ES 1.0–compliant GPU. Newer portable devices have GPUs comparable in performance to the older Xbox or PlayStation 2, supporting OpenGL ES 2.0. If no graphics processor is available, the platform provides a fallback in the form of a software renderer called PixelFlinger. Many low-budget handsets rely on the software renderer, which is fast enough for most low-resolution screens.

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

The Range of Devices

In the beginning, there was the G1. Developers eagerly awaited more devices, and several phones, with minute differences, soon followed, and these were considered "first generation." Over the years, hardware has become more and more powerful, and now there are phones, tablets, and set-top boxes ranging from devices with 2.5" QVGA screens, running only a software renderer on a 500MHz ARM CPU, all the way up to machines with dual 1GHz CPUs, with very powerful GPUs that can support HDTV.

We've already discussed fragmentation issues, but developers will also need to cope with this vast range of screen sizes, capabilities, and performance. The best way to do that is to understand the minimum hardware and make it the lowest common denominator for game design and performance testing.

The Minimum Practical Target

As of October 3, 2011, less than 3% of all Android devices are running a version of Android older than 2.1. This is important because it means that the game you start now will only have to support a minimum API level of 7 (2.1), and it will still reach 97% of all Android devices (by version) by the time it's completed. This isn't to say that you can't use the latest new features! You certainly can, and we'll show you how. You'll simply need to design your game with some fallback mechanisms to bring compatibility down to version 2.1. Current data is available via Google at http://developer.android.com/resources/dashboard/platform-versions.html, and a chart collected in mid-2011 is shown in Figure 1–3.

images

Figure 1–3. Android version distributions on October 3, 2011

So, what's a good baseline device to use as a minimum target? Go back to the first Android 2.1 device released: the original Motorola Droid, shown in Figure 1–4. While it has since been updated to Android 2.2, the Droid is still a widely used device that is reasonably capable in terms of both CPU and GPU performance.

images

Figure 1–4. The Motorola Droid

The original Droid was coined the first “second generation” device, and it was released about a year after the first set of Qualcomm MSM7201A-based models, which included the G1, Hero, MyTouch, Eris, and many others. The Droid was the first phone to have a screen with a higher resolution than 480×320 and a discrete PowerVR GPU, and it was the first natively multi-touch Android device (though it had a few multi-touch issues, but more on that later).

Supporting the Droid means you're supporting devices that have the following set of specifications:

  • A CPU speed 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
  • Android version 2.1 or 2.2+

The Droid is an excellent minimum target because it runs Android 2.2 and supports OpenGL ES 2.0. It also has a screen resolution similar to most phone-based handsets at 854×480. If a game works well on a Droid, it's likely to work well on 90% of all Android handsets. There are still going to be some old, and even some newer, devices that have a screen size of 480×320, so it's good to plan for it and at least test on them, but performance-wise, you're unlikely to need to support much less than the Droid to capture the vast majority of the Android market.

Cutting-Edge Devices

Honeycomb introduced very solid tablet support, and it's become apparent that tablets are a choice gaming platform. With the introduction of the NVIDIA Tegra 2 chip in early 2011 devices, both handsets and tablets started to receive fast, dual-core CPUs, and even more powerful GPUs have become the norm. It's difficult, when writing a book, to discuss what's modern because it changes so quickly, but at the time of this writing, it's becoming very common for devices to have ultra-fast processors all around, tons of storage, lots of RAM, high-resolution screens, two-handed multi-touch support, and even 3D stereoscopic display in a few of the new models.

The most common GPUs in Android devices are the PowerVR series, by Imagination Technologies, Snapdragon with integrated Adreno GPUs, by Qualcomm, and the Tegra series, by NVIDIA. The PowerVR currently comes in a few flavors: 530, 535, and 540. Don't be fooled by the small increments between model numbers; the 540 is an absolutely blazing-fast GPU compared to its predecessors, and it's shipped in the Samsung Galaxy S series, as well as the Google Nexus S. The 530 is in the Droid, and the 535 is scattered across a few models. Perhaps the most commonly used GPU is Qualcomm's, found in nearly every HTC device. The Tegra GPU is aimed at tablets, but it is also in several handsets. All three of these competing chip architectures are very comparable and very capable.

Samsung's Galaxy Tab 10.1 (see Figure 1–5) is currently the de facto standard Android tablet, and it sports the following features:

  • NVIDIA Tegra 2 dual 1GHz CPU/GPU
  • A programmable GPU supporting OpenGL ES 1.x and 2.0
  • A 1280×800 screen
  • Ten-point multi-touch support
  • Android Honeycomb 3.1
images

Figure 1–5. Samsung Galaxy Tab 10.1

Supporting Galaxy Tab 10.1–class tablets is very important to sustain the growing number of users embracing this technology. Technically, supporting it is no different from supporting any other device. However, Google and Samsung have promised to maintain it with the most up-to-date version of Android for at least 18 months after release, so it's likely to receive the newest Android OS upgrades and features in the first wave of deployment. A tablet-sized screen is another aspect that may require a little extra consideration during the design phase, but you'll see more of that later.

The Future: Next Generation

Device manufacturers try to keep their latest handsets a secret for as long as possible, but some of the specifications always get leaked.

General trends for all future devices are toward more cores, more RAM, better GPUs, and higher screen resolutions. Competing chips are constantly coming out, boasting bigger numbers all the time, while Android itself grows and matures, both by improving performance and by gaining features in almost every subsequent release. The hardware market has been extremely competitive, and it doesn't show any signs of slowing down.

While Android started on a single phone, it has quickly evolved to work well on different types of devices, including e-book readers, set-top boxes, tablets, navigation systems, and hybrid handsets that plug into docks to become PCs. To create an Android game that works everywhere, developers need to take into account the very nature of Android; that is, a ubiquitous OS that can run embedded on almost anything. One shouldn't assume that Android will simply stay on the current types of devices. Its growth has been so great since 2008, and its reach so vast, that, for Android, it is clear that the sky's the limit.

Whatever the future brings, Android is here to stay!

Game Controllers

Given the different input methods available among the 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–6. It features an analog stick along with a set of buttons.

images

Figure 1–6. The Zeemote JS1 game controller

The controller is coupled with the Android 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 the optional use of this controller.

In theory, a user could also couple the Nintendo Wii controller with an Android device via Bluetooth. A couple of prototypes exploiting the Wii controller exist, but there's no officially-supported SDK, which makes integration awkward.

The Game Gripper, shown in Figure 1–7, 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, overlaying a more or less standard game controller layout on top of it. Game developers need only add keyboard controls to their game, and they don't have to integrate a special library to communicate with the Gripper. It's just a piece of rubber, after all.

images

Figure 1–7. 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 selected controllers, a move generally well received by Android gamers. Integrating support for such peripherals should therefore be considered.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset