Android Hardware: Developing for the Galaxy Tab | Developer.com The line-up of Samsung Galaxy Tabs introduce many Android application development opportunities. Learn how to target this diverse set of devices for fun and profit.
The line-up of Samsung Galaxy Tabs, the premiere tablets of the Android marketplace, introduce many development opportunities. With three form factors announced, these slick devices are likely to remain a dominant tablet option for users. Learn how to target this diverse set of devices for fun and profit.
Samsung makes tablets under the “Galaxy Tab” brand name. The first Galaxy Tab, a 7-inch tablet released late fall 2010 with strong sales, was also the first tablet to receive Google’s approval and ship with Google’s proprietary apps like the Android Market, Maps and Gmail. Samsung has now announced two new versions of the Galaxy Tab, available June 8.
The first is the 10.1-inch Galaxy Tab, which was handed out, in Special Edition form to all Google I/O 2011 attendees. (The image shows the cool Android silkscreen on the back of the special edition tab.) The second is an 8.9-inch tablet, likely a sweet spot in terms of tablet size.
The initial 7-inch Galaxy Tab currently runs Android 2.2. This is not an SDK version optimized for tablets, but as Android 2.2 is currently running on about two thirds of all Android devices, this should present little problem to most developers.
However, getting the most out of the tablet screen requires some consideration. When developing for the Galaxy Tab, you’ll likely want to take advantage of the tablet features found in the compatibility library Google provides. In particular, we would recommend using the Fragments API to better utilize the large, high resolution screen. Another important aspect to know about the 7-inch tablet is that it reports itself as a high-density device, despite the fact that the screen is actually closer to medium density. Finally, access to the front camera is not available through the same APIs as later versions of Android. Samsung has made this fairly simple to access, though. Using the
setParameters() method of the Camera class, simply set the parameter named “camera-id” to a value of 2 to access the front camera.
The two newer Galaxy Tab devices are documented to run Android 3.1 (API Level 12) when they launch in June. The Special Edition, however, currently runs Android 3.0. Regardless, the larger devices are relatively standard Honeycomb installations and use a standard resolution with standard settings. We have yet to run across anything unusual when loading our software onto the special edition device. The 8.9-inch tablet is supposed to be just a shrunken version of the 10.1-inch tablet with all the same software and screen resolution. We would anticipate it behaving similarly to its larger sibling.
The Galaxy Tab devices are all tablets, of course. The two newest tablets have relatively standard hardware for Honeycomb tablets. Their screen resolution is 1280×800. They both have front and rear cameras. Their screens rotate in all directions. They generally have a lack of physical buttons on the front, with volume and power buttons on the side. As is typical with Honeycomb tablets, the devices are primarily landscape-mode devices. The screens are medium density and extra-large.
The older Galaxy Tab, the 7-inch one, is a little different. For one, it has a screen resolution of 1024×600. This is large for Android 2.2, yet smaller than a typical Honeycomb tablet. It is identified as being a large screen and high density, despite its technical specs that place it in the medium-density category. Even though it’s an Android 2.2 device, which does not officially support a front-facing camera, it has one (see the Software section above for how to access it programmatically). Unlike Honeycomb tablets, the 7-inch Galaxy Tab is primarily a portrait-mode device–the primary buttons and front facing camera suggest as much. Even so, landscape-mode use of the device is also very popular.
Setting Up Your Development Environment
One of the first challenges a developer will face when trying to develop for any of these devices on a Windows machine is getting the USB drivers. Drivers that work are available two ways. The correct method is by downloading the USB driver from the Samsung developer website. That requires a login, and several comments have alluded to the download sometimes not being available. The alternate method, and popular amongst some forums, is to download the Samsung Kies software and install it, which also installs the necessary USB drivers. Either way, you still may need to choose manually which driver to use. In our case, we chose the “Samsung Android ADB Interface” and all worked well, despite the Windows warning dialogs. (Disclaimer: We aren’t responsible for any damage done when using this method. Drivers are always a personal decision.)
Emulating the Galaxy Tab
Emulation of the Galaxy Tab using an Android Virtual Device (AVD) is fairly straightforward. For the 7-inch tablet, download the GALAXY Tab add-on from the third party add-ons section of the Android SDK and AVD Manager, as shown below.
Once this is done, you can create an AVD using this add-on, and all the correct settings will be applied, as shown below.
The newer Galaxy Tabs are even easier to emulate. As they appear to conform to typical Honeycomb specifications, the emulators based on Honeycomb (API Levels 11 & 12) work fine. The device RAM size is 1024MB.
That said, high-resolution AVD settings tend to be fairly slow on most development machines. Google has stated that they are working on the issue. Because of this, testing on the actual devices may be the only frustration-free testing method for the time being. The emulators do work, but we tend to use them only for layout testing for relatively simple UIs.
Developing for Samsung Galaxy Tab devices is relatively straightforward, but requires slightly more setup and knowledge than the vanilla Android devices you may have worked with before. The original 7-inch tablet has only a few important differences to be aware of, in particular the screen resolution and reported density. Using standard compatibility practices, configuring settings carefully, and taking advantage of the compatibility library will get you a long way towards creating great tablet experiences on the Galaxy Tab devices, while still supporting other Android devices.
About the Authors
|Shane Conder and Lauren Darcey—Contributing Editors, Mobile Development–have coauthored two books on Android development: an in-depth programming book entitled Android Wireless Application Development (ISBN-13: 978-0-321-62709-4) and Sams Teach Yourself Android Application Development in 24 Hours (ISBN-13: 978-0-321-67335-0). When not writing, they spend their time developing mobile software at their company and providing consulting services.|