Thursday, 29 August 2013

Android Developer Tools Essentials

Author: Mike Wolfson
Publisher: O'Reilly
ISBN: 978-1-449-32821-4
Format: E-Book


So, what does the book actually cover? Well, the clever tagline suggests everything from Android Studio to ZipAlign which is a pretty impressive claim. Unless of course, the reference there was for just those two tools in which case it's perhaps not so impressive! Fear not, you will be pleased to know that this book covers quite a bit of ground and, consequently, quite a lot of tools.

The following chapter list will give you an idea of what topics made it into the book with a very brief breakdown of each chapter to follow below.

  1. Getting Started
    Minimum Requirements
    Installing Java
    Installing the Android Software Development Kit
    Developing Without Eclipse
    Configuring a Device for Development
  2. Essential Tools
    SDK Manager
    Android Debug Bridge (ADB
  3. Configuring Devices and Emulators
    Using a Physical Device for Development
    Using an Emulator for Development
    Android Virtual Devices
    Advanced Emulator Configuration
  4. Using Devices and Emulators
    Using the Emulator
    File Explorer
    Developer Tools Application
  5. Developing with Eclipse
    Anatomy of the Eclipse Workspace
    Code Templates
    Properties Editors
    XML Formatter
    The Android Key
    Quick Outline for XML
    Other Essential Eclipse Shortcuts
    Refactor Menu
  6. Developing with Android Studio
    Installing Android Studio
    Anatomy of the Android Studio IDE
    The New Structure of an Android Project
    Creating New Android Components
    Layout Designer and Layout Preview
    Generating an APK
    Interacting with Maven and Gradle
    Version Control Integration
    Migrating from Eclipse
    Android Studio Tips and Tricks
  7. Testing Your Code
  8. Simulating Events
    Simulating Location and Routes
    Simulating Telephony Operations
    Changing Networking Parameters
    Using a Device with Sensor Emulation
    Advanced Sensor Testing
    Developer Options Menu
  9. Build Tools
    Compiling Your Code
    Packaging an APK for Release
    Building from the Command Line Using Ant
    Advanced Packaging Steps
    Gradle-Based Build Tools
    Using the Maven Tools
  10. Monitoring System Resources
    Memory Usage in Android
    Dalvik Debug Monitor Server (DDMS)
    Memory Analyzer Tool (MAT)
  11. Working with the User Interface
    Android Layout Basic Concepts
    Editing XML Files Directly
    Working with Graphics
  12. Using the Graphical Editor
    Generating Layouts Using the Graphical Layout Editor
    Outline View
    Properties Editor
    Configuration Chooser
  13. Optimizing the User Interface
    Introduction to UI Performance
    Hierarchy Viewer
    Fixing Problems Using Lint
    Application Exerciser Monkey
Chapter 1 aims to get your development environment up and running. To this end the author does an admirable job, ensuring the even the smallest of details is covered, such as setting parameters to ensure that the Java Compiler level is compliant with 1.6.  

Covering the fundamental tools for Android development, the second chapter deals with the SDK manager and ADB. The SDK manager is the tool that, unsurprisingly, manages the Android SDK, allowing the user to both update the SDK and add additional components. ADB is a powerful utility that enables you to interact with your emulator or connected device. While the author does not cover every aspect of the ADB utility he provides links to some of the more pertinent web resources that cover this vast topic.

Covering the pitfalls and benefits of physical test devices versus virtual devices in chapter 3, the author guides you through customs infighting both physical and virtual devices. Limitations and capabilities of both are discussed, allowing the user to make an informed decision.

While the creation of emulators was demonstrated in the previous chapter, this chapter employs them to demonstrate their use as an aid to testing your application . The author also takes care to point out best practices for reducing emulator load time and ensuring a consistent start state. File Explorer and Developer Tools Application are also introduced.

As most of your time is going to be spent developing in Eclipse, the fifth chapter delves into the properties of the Eclipse IDE and exposes some nice shortcuts and options for making your life a lot easier in bespoke application.

Chapter 6 covers the new Android Studio app. Although the book is new, this is already a little dated due to the frequency of the releases from Google of this application. The author pretty succinctly covers the Android Studio app life cycle and how to migrate from Eclipse, as well as including version control and some nifty hints and tips. 

Some of the intricacies of debugging for your Android app are addressed in this chapter, which covers the Logcat utility (with a pointer to ensure that you use ProGuard to remove logging statements during packaging), how to set your app to debug and set up debug points and how to configure and use the Lint static analysis tool.

In chapter 8 the testing challenges faced by various events is delved into. It's not possible to test for every location on the planet for example (unless of course you're superman in which case your time might be better spent saving the world instead of writing apps). As a result the author shows you how to simulate events such as location and routes, telephony operations and networking. The author also shows how you can use sensors on a physical device to interact with an emulator. Finally, the options in the developers options menu are explored with an explanation for most of the options provided.

Compiling your code and preparing your APK for release is the name of the game here. The author shows you to compile and sign your code as you prepare for release. Code optimization and obfuscation is also covered by way of a more detailed look at the ProGuard tool that was touched upon in Chapter 7. Zipalign is also covered as well as how to get to grips with Gradle-based builds and the Maven tools.

Chapter 10 introduces the necessary toolsets for monitoring system resources in Android, namely memory usage via the DDM,  utilising the wanalyser, thread tool, heap tool and trace view tool,  as well as showing how to install and use the Memory Analyser Tool (MAT).

At the heart of any application is its UI. Chapter 11 describes how to create layouts to define the UI, discussing and illustrating important concepts such as Views and ViewGroups and their relationship. The author also discusses resources and their advantages, how to create XML files via templates and how to edit them manually and working with graphics.

Having covered manually editing layout files in chapter 11 the author now examines generating layouts via the Graphical Layout Editor.

This final chapter covers poorly performing UI by firstly discussing how Android draws views and how this subsequently affects UI performance. The author goes on to explain the use of hierarchy viewer tools to analyse your UI and the use of monkey to generate random events to test your application.

General Impressions

This is quite an impressive book and the author clearly has extensive knowledge of this subject matter and has done a great job in imparting that knowledge to his target audience. The book is generally well laid out with ample screenshots to illustrate key points, lots of notes to warn you of potential pitfalls and enough hyperlinks to related topics to keep even the most click-happy readers satisfied (and more importantly they add value to an already impressive book). My only slight complaints with this book however were the use of URL shorteners for the hyperlinks and the order of the chapters could have been optimised - although that's subjective. I should point out that I have no personal issue with URL shorteners, they just get blocked on some networks, especially corporate ones, and while all the links were current having the full URL can help you track down were the site has relocated a topic or at least let you look at it in the Google cache. These minor points aside it's a top-notch book and I hope that as Android continues to mature the author will review and update as appropriate.


If getting the most out of both your development environment and Android application is important to you, and it should be if you're a developer, then pick up a copy of this book. It's that simple. 


With such good content, and a very reasonable price tag of $12.99, I can't give this title less than 5/5.

Thanks for reading!


Next review will be Learning SQL, 2nd edition

No comments:

Post a Comment