What You Need

In order to get started as an Android developer — and to get the most out of this book — you are going to need several things, outlined in the following sections.

A Development Machine

For the purposes of this book, you will need a Windows, macOS, or Linux computer on which to write your Android apps. This is how the vast majority of Android app developers do their work, though there are tools (e.g., AIDE) that allow you to write Android apps directly on an Android device.

Your development machine should be as powerful as you can manage:

The primary development tool for Android apps — called Android Studio — consumes a lot of resources, particularly when compiling a project, which is why it helps to have a powerful development machine.

Note that Apple M1 chip support is still a work in progress. As of September 2021, Android Studio Arctic Fox has preliminary support for the M1 chip. This should improve with time.

Language Experience

In general, to write Android apps, you need to know how to work with computer programming languages. In particular, Android app development is focused heavily on Java and Kotlin, with Groovy also playing a role.

Java

The original programming language used for Android app development was Java. Right now, most Android code in the world is written in Java, and most educational material is written around Java.

As a result, to be an Android app developer today, it helps to know Java.

This book does not teach you Java. Java has been around for around two decades, and so there are lots of existing books, courses, videos, and the like to help you learn Java. However, there are many things in Java that are not really relevant for Android app development, such as Swing desktop GUIs and Java servlets for Web applications. You do not need to know everything about Java, as Java is vast. Rather, focus on:

The links are to Wikibooks material on those topics, though there are countless other Java resources for you to consider.

Kotlin

The primary current language for Android app development is Kotlin. Kotlin is a fairly new language, having only reached 1.0 status in 2016. That causes some problems, as there is less material about how to write Kotlin than there is on how to write Java. On the other hand, Kotlin adopts newer approaches and discards legacy “cruft”. The resulting language can be much more concise, getting more work done with fewer lines of code.

This book does not teach you Kotlin. The author of this book is also the author of Elements of Kotlin, which was written with an eye towards it being a companion to the book that you are reading now. From time to time, you will find this book pointing out relevant chapters and sections in Elements of Kotlin, to help newcomers to both Android and Kotlin learn both subjects.

Note that at the 2019 Google I|O conference, Google indicated that the Android SDK will be “Kotlin first” going forward. While Java development is still possible, Google will be focusing on Kotlin in terms of documentation, samples, education, and some new technologies. So, while this book will present material in both Java and Kotlin, you should strongly consider learning Kotlin in the not-too-distant future.

Groovy and Gradle

The code that causes your app to do stuff will be written mostly in Java and Kotlin.

The code that causes your app to be built out of that Java and Kotlin will be written in Groovy… though you may not notice this much.

Most Android apps are built using a build tool called Gradle. Gradle is a program for building other programs. We will be working with “Gradle build scripts” to configure how Gradle turns our source code into a (hopefully) working app. The Gradle build scripts that we use today usually are written using the Groovy programming language.

However, for most basic uses of Gradle — including pretty much everything in this book — you will not need to think much about Groovy syntax. Just follow the recipes described in the book, and you can put off learning Groovy until such time as you really want to start creating elaborate build scripts.

An Android Test Environment

Writing Android apps is fun!

(no, really!)

However, that fun only appears when you can actually run the app that you created. Otherwise, you just have a hunk of source code that sits around doing nothing. To run the app, you will need an Android device or emulator.

Devices

Every Android developer should have at least one Android device. Every Android device that legitimately has the Play Store on it is able to be used for app development. You can enable the super-secret “developer options” in the device, to allow you to install apps that you have written yourself on the device and test them out — we will see how to do that in this book.

Typically, that Android device will be a phone, though you could test on something else, such as a tablet, if you wish. Android app development puts few requirements on the device itself; for example, you do not necessarily need to have a usable SIM installed in the phone.

In an upcoming chapter, you will see how to configure your Android device for use with app development.

Emulators

All Android developers should have at least one device. Some Android developers, such as the author of this book, have lots of Android devices. However, inevitably, you run into cases where hardware is a problem:

For those cases, the Android tools come with an emulator. The emulator gives you an app for your development machine that pretends to be an Android device. You decide what sort of device it is: Android version, screen size and resolution, and so on. You can run your app on the emulator and get a sense for what it would be like for the app to be running on a real device with those same characteristics.

In an upcoming chapter, you will see how to set up the Android emulator.

Patience and Serenity

Android app development often can be a frustrating experience:

You will be able to address all of these challenges in time. Early on, though, you should expect that these sorts of problems will arise, and you will need to cope with them when they do.


Prev Table of Contents Next

This book is licensed under the Creative Commons Attribution-ShareAlike 4.0 International license.