Google Android Software Development Kit
- Android SDK provides tools that let you use other IDEs in place of Eclipse; TraceView application
- Cannot take incoming calls when using the Android emulator; Android introduces a whole new lingo for developers to memorise
The Android SDK is a wonderful example of what can be done with open source applications and tools. When the SDK's parts work, they work reasonably well. However, at this point, would-be Android developers must be willing to assist in debugging the development platform itself; it's still pretty rough. Android's single best characteristic is prime mover Google. Whether that is enough weight to ensure Android's success remains to be seen.
The Open Handset Alliance's Android SDK for creating mobile applications throws a few semantic curves at Java developers, but for the most part, they will feel at home; just be prepared for some rough terrain, and be sure to bring plenty of hardware
Android is Google's foray into the handheld OS realm. It follows a path trodden by – among others – Symbian's Quartz, the SavaJe operating system, and J2ME. In fact, one of Android's stated goals is to overcome some of J2ME's shortcomings. Whether or not Android succeeds, either at that specific goal, or in general, remains to be seen.
This article addresses a specific question: What is it like to work with the Android SDK? And to a lesser extent: What is under the Android hood? As these questions are answered, bear in mind that the version of the Android SDK we used was not in final form. Some of the problems described may have – in fact, we hope will have – been corrected by the time you read this. In addition, while Android development is supported on Linux, Mac OS X, and Windows, we did all our testing on Windows systems.
Inside an Android
Peel away Android's carapace, dig down to its marrow, and you'll find a Linux kernel. Libraries are a layer above, a variety of frameworks above that, and a final layer of applications sits on the top. The library layer is home to code for entities such as media processors for playback and recording of audio and video, the core of the Web browser, font rendering, and the SQLite relational database engine. The Android runtime also lives in the library layer.
Above the libraries reside frameworks, which are sets of reusable services and common components available to applications. For example, one sort of framework is a content provider, which is any service that handles the storage and retrieval of data. The application interface into the SQLite engine is a specific instance of a content provider.
Applications run at the top of the OS stack. Android will ship (assuming that it eventually does ship) with a set of core applications, including an e-mail client, a calendar, a Web browser, and more. And, of course, it is toward this topmost layer that all of the faculties of the Android SDK are directed. When a developer writes an Android application, that developer codes in Java. The Java source is compiled to Java bytecodes, but – to execute the application on Android – the developer must execute a tool called dx. This tool converts Java bytecode to what is referred to as dex bytecodes. "Dex" is short for "Dalvik executable", Dalvik being the virtual machine that actually executes Android applications.
From a developer's perspective, Dalvik looks like a Java Virtual Machine, but strictly speaking, Dalvik is not a JVM. As stated above, Dalvik executes dex bytecode, not Java bytecode. And there are differences in the structure of Dalvik class files as compared to Java class files. Nevertheless, for all intents and purposes, building an Android application is really an exercise in building a peculiar sort of Java application.
The Android SDK
The Europa version of Eclipse is the preferred development platform for Android applications. In addition, you need at least a JDK 5 or JDK 6 installation to use the Android tools (the JRE that Eclipse typically installs is insufficient). Instructions on the Android site walk you through installing the Android Development Tools plug-in for Eclipse, and verifying the installation's correct operation by guiding you through the creation and execution of a quintessential "hello world" application.
However, you are not tied to Eclipse as your Android development system. The Android SDK does provide tools that let you use other IDEs in place of Eclipse. For example, the IntelliJ IDE is mentioned specifically in the Android documentation.
Hard-core developers will be satisfied to work solely with the collection of command-line tools that come with the SDK. For example, the activityCreator tool – which is provided as a batch file for Windows, and as a Python script for Mac and Linux users – will construct the framework for an Android Activity. (Activity is the Android equivalent of an application; more on this later.) Executing activityCreator will build skeletal Java files, create the Android project's required subdirectories, and build the necessary manifest XML files. The tool also creates an Ant script file for compiling the source and building the application. Once built, the application can be launched via the SDK's adb tool, the Android debug bridge.
Other command-line tools in the SDK include logcat, which outputs a log of system messages. Thanks to the stack trace provided by logcat, it is useful whenever an error occurs on the Android emulator. If you need deep analysis of what is going on in errant code, you can import a special Debug class into your application. This class provides methods for starting and stopping execution traces. When activated, Debug will log method calls to a trace file, which can be examined later with the toolkit's TraceView application. From within TraceView, you can view thread interactions, as well as examine execution paths. TraceView also shows the amount of time spent in each method, so you can use the tool as an execution profiler.
Finally, there is the Android emulator itself. When started, the emulator displays the skin of a hypothetical android device, complete with specialised faceplate buttons and QWERTY keyboard. It does its best to mimic an actual device, though there are understandable limitations (it cannot, for example, take incoming phone calls). The Android emulator runs a modified version of Fabrice Bellard's excellent open source simulation/virtualisation environment, QEMU. Android's version of QEMU simulates an ARM processor, and on that processor executes the Linux OS.
Working with Eclipse
Once the Android Eclipse plug-in is installed, building an Android application is much like building any other application. The plug-in adds an Android Activity project to Eclipse's project templates tree. Start a new project, and the plug-in builds the foundational Java files, creates the necessary folders, and constructs skeletal resource files.
This screen image shows the Android Notepad executing from within Eclipse: the Eclipse IDE launches the Android emulator, and transfers the application for execution. Status messages tracking execution progress appear in the lower-right console window.
The Eclipse plug-in handles compilation, conversion to dex, launching the emulator, and downloading the application. Because writing Android code is writing Java code, the editor behaves as it would were you constructing an ordinary Java application. Resource files, which are written in XML, are easily managed by XML editors already available in Eclipse. Debugging is likewise supported from within Eclipse, and Android opens a debug perspective that anyone already familiar with Eclipse will be comfortable with.
Unfortunately, Android introduces a whole new lingo for developers to memorise. Roughly speaking, an application is an Activity. (The current documentation is only marginally helpful on this point, describing an Activity as "a single focused thing that a user can do.") Within an activity, you define one or more views. A view – realised via the View class – corresponds to an area on the screen, and manages the drawing and event trapping of its associated area. (So, for Java developers, a View is roughly equivalent to a Canvas.) Event handling is governed by the Intent class, which models an activity's intention to handle events of a given kind.
In short, be prepared to spend some time in the documentation matching what you already understand about GUI application development with the corresponding elements as Android calls them. The documentation is reasonably good on this matter. Nevertheless, as is typical, we found the provided example code to be far more useful.
Just before we began testing the Android SDK in mid-February, a new SDK was released (m5-rc14, to be exact). We installed that SDK (and Eclipse plug-in) on a 1GHz, 1GB Windows XP system. Though installation went smoothly, the emulator took on the order of 30 minutes to complete its boot process when an Activity was launched from within Eclipse. Other users on the Android message boards reported similar behaviour, though the problem was by no means universal. The solution appeared to be faster hardware. Luckily, we had a more powerful machine on hand: a 3GHz processor with 2GB of RAM (running Windows 2000). We reinstalled Eclipse and the Android SDK on this faster system, and – sure enough – the emulator was up and running our trial application in about 30 seconds after the launch from Eclipse.
Now, 30 seconds – though worlds better than 30 minutes – is by no means a comfortable launch latency, particularly if you're stuck in a heavy execute-crash-debug-fix-execute cycle. And we're not certain that delay can be reduced appreciably. Remember, when you start the emulator, you're starting the QEMU environment, followed by a booting of the Linux kernel, which has to fire up all the framework services. In other words, a lot has to happen just to get to the first bytecode of your target application.
Android on the march
Android is definitely a work in progress. If you want to try your hand at creating a significant Android application with the existing toolkit, we salute you. But be prepared for a challenge.
Our biggest concern with Android is that we find nothing compelling in it that sets it apart from other handheld OSes. Though one might be tempted to point to the inclusion of the SQLite database engine as significant, we are unconvinced that an SQL-speaking relational database is the "killer feature" that will help Android succeed where other, similar handheld OSes have simply fizzled.
Nevertheless, Android has the weight of Google behind it. Whether that weight is sufficient to propel Android where other handheld OSes have not gone before is uncertain. For now, we'll simply say that Google has a lot of propelling to do.
Join the PC World newsletter!
Epson WorkForce ET-4550
Samsung portable 1TB T3 drive
Smart LED Bulb LB130
Lexar® JumpDrive® S57 USB 3.0 flash drive
Everki ContemPRO Roll Top Laptop Backpack
Linksys AC5400 MU-MIMO Gigabit router
UE Boom 2 Bluetooth speaker
Epson EcoTank Expression ET-2500
Belkin MIXIT Metallic Lightning to USB Cable
Logitech G403 Prodigy mouse
Huawei Mate 9
Lexar® JumpDrive® S45 USB 3.0 flash drive
3SIXT Ultra HD Sports Action Camera
Google Daydream VR headset
Acer Swift 7
Lexar® Portable SSD
Epson WorkForce DS-360W
Dell Inspiron 5000 series 2-in-1
Garmin Fenix Chronos smartwatch
Blade 28 backpack by Arc’teryx
Lexar® Professional 1800x microSDHC™/microSDXC™ UHS-II cards
Dell XPS 13 laptop
Audio-Technica ATH-ANC70 Noise Cancelling Headphones
HD Pan/Tilt Wi-Fi Camera with Night Vision NC450
HP Pavilion x360 13”
Surface Pro 4
Lexar® JumpDrive® C20c USB Type-C flash drive
Most Popular Reviews
- 1 Huawei Mate 9 full in-depth smartphone review
- 2 ZTE Axon 7 review: Is ZTE dumping old stock on Australia?
- 3 Oppo R9s smartphone full review
- 4 Huawei Nova Plus smartphone review
- 5 Google Pixel XL full, in-depth smartphone review: Phones just got smarter
Latest News Articles
- Google's new AI aims to end abusive online comments using 'Perspective'
- Village Roadshow aims to block 40 pirate sites
- Analysts peer into Microsoft's rumored Windows 10 Cloud
- Google lets users get social with Maps
- Microsoft unveils a bonanza of security capabilities
PCW Evaluation Team
I’d happily recommend this touchscreen laptop and Windows 10 as a great way to get serious work done at a desk or on the road.
Ultimately, I think the Windows 10 environment is excellent for me as it caters for so many different uses. The inclusion of the Xbox app is also great for when you need some downtime too!
For me, the Xbox Play Anywhere is a great new feature as it allows you to play your current Xbox games with higher resolutions and better graphics without forking out extra cash for another copy. Although available titles are still scarce, but I’m sure it will grow in time.
First impression on unpacking the Q702 test unit was the solid feel and clean, minimalist styling.
For work use, Microsoft Word and Excel programs pre-installed on the device are adequate for preparing short documents.
- How to quit Pokemon Go (or to start enjoying it again)
- Huawei Mate 9 full in-depth smartphone review
- Time to ditch Foxtel and the iQ3: How to replace Foxtel packages with cheaper alternatives
- What's the difference between an Intel Core i3, i5 and i7?
- Laser vs. inkjet printers: which is better?
- CCSecurity AnalystACT
- TPSenior Service Desk AnalystNSW
- TPWinforms DevelopersWA
- TPSenior Analyst Programmer - ContractQLD
- CCSolution DesignerVIC
- FTMobile Gaming SupportQLD
- CCFinance Analyst/ Project SpecialistVIC
- CCSQL Server BI DeveloperQLD
- FTLead PMONSW
- FTCitrix EngineerNSW
- CCService Desk Analyst - TelcoTAS
- TP.Net DeveloperSA
- FTERP ConsultantQLD
- FTOnline Solutions AnalystNSW
- CCTest AnalystQLD
- FT.net Developer (Front and Back end)QLD
- CCSystem EngineerSA
- TPEnvironment Specialist(DevOps)QLD
- CCWindows System EngineerNSW
- CCContract - System Access Administrator - major Telco in MelbourneVIC
- FTJunior Software Engineer - Adelaide Based (PV, NV2 or NV1 required)NSW
- FTDevOps/Senior Sys Admin - eCommerce - Permanent - Sydney Northern BeachesNSW
- FTWeb Developer/ReportsNSW
- CCSenior Storage System Engineer -NetApp & TSMNSW
- CCServiceNOW DeveloperNSW