Before any work can begin on the development of an Android application, the first step is to configure a computer system to act as the development platform. This involves a number of steps consisting of installing the Android Studio Integrated Development Environment (IDE) which also includes the Android Software Development Kit (SDK), the Kotlin plug-in and OpenJDK Java development environment.
This chapter will cover the steps necessary to install the requisite components for Android application development on Windows, macOS and Linux based systems.
•Windows 7/8/10 (32-bit or 64-bit though the Android emulator will only run on 64-bit systems)
•macOS 10.10 or later (Intel based systems only)
•ChromeOS device with Intel i5 or higher and minimum 8GB of RAM
•Linux systems with version 2.19 or later of GNU C Library (glibc)
•Minimum of 4GB of RAM (8GB is preferred)
•Approximately 4GB of available disk space
•1280 x 800 minimum screen resolution
Most of the work involved in developing applications for Android will be performed using the Android Studio environment. The content and examples in this book were created based on Android Studio version 4.0 using the Android 10.0 (Q) API 29 SDK which, at the time writing are the current versions.
Android Studio is, however, subject to frequent updates so a newer version may have been released since this book was published.
The latest release of Android Studio may be downloaded from the primary download page which can be found at the following URL:
If this page provides instructions for downloading a newer version of Android Studio it is important to note that there may be some minor differences between this book and the software. A web search for Android Studio 4.0 should provide the option to download the older version in the event that these differences become a problem. Alternatively...
Once downloaded, the exact steps to install Android Studio differ depending on the operating system on which the installation is being performed.
Locate the downloaded Android Studio installation executable file (named android-studio-ide-<version>-windows.exe) in a Windows Explorer window and double-click on it to start the installation process, clicking the Yes button in the User Account Control dialog if it appears.
Once the Android Studio setup wizard appears, work through the various screens to configure the installation to meet your requirements in terms of the file system location into which Android Studio should be installed and whether or not it should be made available to other users of the system. When prompted to select the components to install, make sure that the Android Studio and Android Virtual Device options are all selected.
Although there are no strict rules on where Android Studio should...
The first time that Android Studio is launched after being installed, a dialog will appear providing the option to import settings from a previous Android Studio version. If you have settings from a previous version and would like to import them into the latest installation, select the appropriate option and location. Alternatively, indicate that you do not need to import any previous settings and click on the OK button to proceed.
Next, the setup wizard may appear as shown in Figure 2-2 though this dialog does not appear on all platforms:
If the wizard appears, click on the Next button, choose the Standard installation option and click on Next once again.
Android Studio will proceed to download and configure the latest Android SDK and some additional components and packages. Once this process has completed, click on the Finish button in the Downloading Components dialog at which point the Welcome to Android Studio screen...
The steps performed so far have installed Java, the Android Studio IDE and the current set of default Android SDK packages. Before proceeding, it is worth taking some time to verify which packages are installed and to install any missing or updated packages.
This task can be performed using the Android SDK Settings screen, which may be launched from within the Android Studio tool by selecting the Configure -> SDK Manager option from within the Android Studio welcome dialog. Once invoked, the Android SDK screen of the default settings dialog will appear as shown in Figure 2-4:
Immediately after installing Android Studio for the first time it is likely that only the latest released version of the Android SDK has been installed. To install older versions of the Android SDK simply select the checkboxes corresponding to the versions and click on the Apply button.
It is also possible that updates will be listed...
Most of the time, the underlying tools of the Android SDK will be accessed from within the Android Studio environment. That being said, however, there will also be instances where it will be useful to be able to invoke those tools from a command prompt or terminal window. In order for the operating system on which you are developing to be able to find these tools, it will be necessary to add them to the system’s PATH environment variable.
Regardless of operating system, the PATH variable needs to be configured to include the following paths (where <path_to_android_sdk_installation> represents the file system location into which the Android SDK was installed):
The location of the SDK on your system can be identified by launching the SDK...
Android Studio is a large and complex software application that consists of many background processes. Although Android Studio has been criticized in the past for providing less than optimal performance, Google has made significant performance improvements in recent releases and continues to do so with each new version. Part of these improvements include allowing the user to configure the amount of memory used by both the Android Studio IDE and the background processes used to build and run apps. This allows the software to take advantage of systems with larger amounts of RAM.
If you are running Android Studio on a system with sufficient unused RAM to increase these values (this feature is only available on 64-bit systems with 5GB or more of RAM) and find that Android Studio performance appears to be degraded it may be worth experimenting with these memory settings. Android Studio may also notify you that performance can be increased via a dialog...
From time to time new versions of Android Studio and the Android SDK are released. New versions of the SDK are installed using the Android SDK Manager. Android Studio will typically notify you when an update is ready to be installed.
To manually check for Android Studio updates, click on the Configure -> Check for Updates menu option within the Android Studio welcome screen, or use the Help -> Check for Updates... (Android Studio -> Check for Updates... on macOS) menu option accessible from within the Android Studio main window.
Prior to beginning the development of Android based applications, the first step is to set up a suitable development environment. This consists of the Android SDKs and Android Studio IDE (which also includes the OpenJDK development environment). In this chapter, we have covered the steps necessary to install these packages on Windows, macOS and Linux.