Android: Tools of the Trade

Introduction

When you’re planning to take the plunge and develop your first Android application, it’s easy to get intimidated by the jargon-packed list of tools you’ll need to assemble. However, in reality downloading and preparing the Android development environment is a straightforward process, thanks to the handy, all-in-one bundles that give you instant access to most, if not all, of the tools you need.

The drawback of downloading everything in one bundle is that it’s easy to lose track of the tools included in your Android development environment, and you might not have a clear idea what each tool is for.

This article will demystify the major tools you’ll use to develop your first Android application. For those who want to enhance their Android projects with additional functionality, this article also provides a brief introduction to Google Play Services, which you can use to add Google+ and Google Maps content to your app, and also provides a way to monetize your Android apps.

However, before you can assemble your Android developer toolkit, you first need to make a decision, which integrated development environment (IDE) are you going to develop your apps in?

1. Eclipse or Android Studio?

Up until recently, Eclipse with the ADT (Android Development Tools) plugin was the recommended environment for developing Android apps. However, at Google I/O 2013, Google shook things up by announcing their own IDE, Android Studio, designed specifically for Android development.

The release of Android Studio has made life more complicated for Android developers, who now have to weigh up the pros and cons of both IDEs and decide which is right for them.

The key to deciding whether Android Studio or Eclipse should be your development environment is identifying what you’re looking for in an IDE.

Streamlined or Feature-Packed User Interface

Eclipse provides a common development environment that can be extended through plugins that allow you to develop a range of apps in different programming languages, all within the same IDE.

For Android development, Eclipse is extended through the Android Development Tools or ADT plugin. Although ADT was designed specifically for Android development, Eclipse was not, which means it includes a lot of features that have nothing to do with developing Android apps.

If you're an experienced Eclipse user, then chances are you’re already familiar with Eclipse's busy, feature-rich user interface, but if you’re new to Eclipse, then you’ll need to spend some time identifying what's relevant to you as an Android developer and what's just cluttering up the user interface.

This is where Android Studio has an advantage compared to Eclipse. Android Studio has a bare-bones user interface and a modest set of features, but everything it contains is geared towards helping you develop Android apps.

Established Community or Going It Alone

Eclipse is an established IDE with a thriving community, which means there's no shortage of places to turn to when you need help, such as blogs, tutorials, Google groups, video guides, forums, or the extensive Eclipse and ADT documentation.

This is in stark contrast to Android Studio. As a new project, Android Studio simply hasn’t had the time to build up the same wealth of resources. Although some of the Eclipse-based resources may also be applicable to Android Studio tasks, if you have specific questions about the Android Studio environment, then Eclipse-focused information is going to be of little use.

Stability or New Technology

As an established IDE, Eclipse is a stable and reliable piece of software, whereas Android Studio is currently only available as an early access preview and comes with a disclaimer that you should expect to encounter bugs and missing features.

Android Studio has the innovative features you'd expect from a brand new IDE, but this is offset by its early access status. Depending on your situation, the lack of an official Android Studio release may be a deal breaker. If you’re planning to work on a small, personal project, then bugs and missing features may not be too much of a concern. However, if you’re looking for an IDE in which to develop a commercial Android application that's crucial to your latest business venture, then the early access preview of Android Studio may not be the most sensible option.

Are you familiar with Gradle?

Android Studio comes with a Gradle plugin and, if you choose this IDE, you'll ultimately use Gradle to automate the building, testing, publishing, and deployment of your Android apps.

If you’re not familiar with Gradle or don’t have the time or inclination to learn Gradle, then you may prefer to go down the Eclipse route, because Gradle is so tightly integrated into Android Studio that you’ll struggle to use any other build tool.

Conclusion

There's no easy answer to the "Android Studio or Eclipse" question as your decision will ultimately depend on individual factors, such as the software you're already familiar with, how much time and inclination you have to learn new technologies, and the nature of the Android apps you want to develop.

For example, if you have lots of time to dedicate to learning new technologies and like the sound of Gradle, then you’re more likely to opt for Android Studio. However, if you're an experienced Eclipse user with a busy schedule who isn't particularly excited by the prospect of getting to know a new IDE, then developing in Eclipse is probably the most sensible option.

Regardless of whether you opt for Android Studio or Eclipse with the ADT plugin, when you grab your all-in-one bundle, you'll get access to the same set of tools, known as the Android SDK.

2. What is the Android SDK?

The Android SDK consists of various tools that are essential for creating Android apps, from libraries to source code, sample projects, and much more. An exhaustive look at everything the Android SDK has to offer is beyond the scope of this article, but there's a few tools that are essential to developing Android apps, which you should familiarize yourself with as soon as possible.

Emulator

The Android SDK includes a mobile device emulator that lets you test your Android apps across a wide range of devices without actually having to purchase said devices.

As it name implies, the emulator has the power to emulate different Android devices by running various Android Virtual Device (AVD) configurations. During the lifecycle of a typical Android project, you'll create a range of AVD configurations for the emulator with each AVD mimicking a different Android device.

AVD Manager

The AVD Manager is where you create, edit, repair, delete, and launch your AVD configurations. The AVD Manager also contains a list of known device definitions, which is handy when you want to emulate a particular device, but are unsure of its hardware and software specifications.

SDK Manager

The Android SDK separates its various tools, platforms, APIs, and other components into different packages that you update and download via the SDK Manager. Some of these packages are recommended, or even installed automatically when you download the Android SDK, but many of these packages are optional and will only be of interest to you if you're developing a certain kind of Android application.

DDMS

Dalvik Debug Monitor Server or DDMS is a debugging tool that can perform various debugging tasks, such as tracking which objects are being allocated to memory, which threads are currently running, and how much heap memory a particular process is using.

DDMS also includes a Detailed Network Usage tab that tracks network requests and analyzes how your application is transferring data. Although DDMS fulfills the same purpose in both Android Studio and Eclipse, the way you access it is different. Eclipse users can access DDMS by going to Window > Open Perspective > DDMS, whereas Android Studio users access DDMS by clicking the Monitor button in the toolbar (the button with the plain Android icon).

Lint

Lint is a code scanning tool that helps improve the structural quality of your code by checking an Android project's source files for bugs and areas that could potentially be optimized.

Although Lint is included in the Android SDK, the way you launch Lint differs depending on whether you're using Eclipse or Android Studio. In Android Studio, you run Lint by selecting Analyze > Inspect Code. In Eclipse, Lint runs automatically whenever you make changes to your project via the layout editor or XML files, and it also runs whenever you export a project.

Android Debug Bridge

Also known as adb, Android Debug Bridge lets you perform a range of debugging tasks by typing instructions directly into the command line. You'll find a comprehensive table of adb commands at the official Android documentation.

Regardless of whether you opt for Android Studio or Eclipse, you have access to all of the aforementioned Android SDK tools. However, the rest of your toolkit varies, depending on which IDE you choose.

3. Eclipse Toolkit

Despite the competition from Android Studio, Eclipse with the ADT plugin has lots to offer to Android developers. If you opt for Eclipse as your IDE, you can download an all-in-one bundle that includes the Android SDK and the following additions.

Eclipse

This IDE provides a common development environment that you can customize with different plugins.

ADT Plugin

The Android Development Tools plugin extends the Eclipse environment with Android-specific features, including a project creation wizard that automatically generates the basic file structure of your Android application and custom XML editors that help you write valid code for your resource files and Android manifest.

The ADT plugin also provides a graphical user interface to many SDK tools that you could otherwise only access from the command line, such as the Android Debug Bridge and DDMS, which we discussed earlier.

Setting up Eclipse with the ADT plugin as your development environment is a straightforward process:

  1. Start by downloading the ADT bundle.
  2. Once the download is complete, unzip the ADT package.
  3. Unzip the archive and open it. It'll be named adt-bundle followed by the version number.
  4. Launch Eclipse by opening the Eclipse folder and double-clicking the Eclipse application icon.
  5. Eclipse stores all the projects you create in a so-called workspace. On Windows, this is by default created in C:\Users\Name\Documents\workspace. Change this path if like and click OK.

Eclipse launches with the ADT plugin and Android SDK already integrated. This means that as soon as Eclipse is launched, you're ready to start creating your first Android application.

4. Android Studio Toolkit

Even though it's only available as an early access preview, Android Studio has some interesting features, not to mention Google's seal of approval. If you decide to download the Android Studio bundle, you'll get the Android SDK and the following additions.

Android Studio

In the world of integrated development environments, Android Studio is uniquely positioned as the IDE that's designed specifically for developing Android apps.

Gradle

Android Studio comes with a built-in Android plugin for Gradle and uses Gradle as its build system. In Android Studio, you use Gradle to perform tasks such as customizing, configuring, and extending your project's build process and managing dependencies from your local file system and from remote repositories.

Gradle can also help you support as many devices as possible by generating multiple APKs with different configurations from a single Android project.

If you decide to use the early access preview of Android Studio, download the latest version from the Android Developer website. On Windows, launch the executable to open Android Studio and start developing Android apps.

5. Google Play Services

This article has already introduced you to the Android SDK tools and shown you how to install and set up your IDE of choice. However, if you want to create a richer experience for your users, then you may want to add Google Play Services to your development environment.

Google Play Services are optional extras that enable you to add more functionality and features to your Android apps. Google Play Services have lots to offer to the Android developer. Let's take a look at a few of them.

Google+

Enrich your app with Google+ content. The Google+ Platform service can help you provide a personalized experience for your users by pulling content from their Google+ account into your app. For example, your app could use Google+ information to greet the user by name or use their Google+ profile picture as their avatar.

Alternatively, your app can push information to Google+, for example, letting users post their top scores and other in-app achievements to their Google+ profile or send invites to their Google+ contacts.

Google Maps

Embed Google Maps content in your app, including 3D maps, hybrid maps, and even Google Street View content. Note that the Google Maps Android API does require an API key, which you can obtain through the Google APIs Console.

Google Play In-App Billing

This service allows you to monetize your Android projects by selling digital content through your app. This content can be downloadable, such as pictures or videos, or virtual content, for example, new levels in a game, unlockable features, or in-game goods, such as gems and extra lives.

Google Play handles these transactions for you, so you don’t need to worry about building your own checkout and billing functionality. Note that in-app billing does require you to create a Google Play Developer Console account and a Google Wallet merchant account. You'll also need to install the Google Play Billing library. You can do this by launching the SDK Manager, opening the Extras section, selecting Google Play Billing library, and clicking Install packages.

This is just a selection of what Google Play Services has to offer. You can get more information about Google Play Services at the official Android documentation.

Before you can take advantage of Google Play Services, you need to download an additional package. You can do this following these steps:

  1. In your IDE of choice, open the Android SDK Manager.
  2. Expand the Extras section.
  3. Select Google Play Services. Note that if you're using Android Studio you'll also need to install Google Repository, which is located in the Extras category.
  4. After clicking Install packages, the SDK Manager will go ahead and install Google Play Services.

Conclusion

Regardless of whether you choose Eclipse or Android Studio as your IDE, you should now have a better understanding of the ecosystem of tools used in Android development, and how these tools fit together in the wider context of your IDE.

If you've been following along with this tutorial, your development environment should now be installed and ready to go. The only thing left to do is create a new Android project and start developing.

Tags:

Comments

Related Articles