Book Image

Android Studio Arctic Fox Essentials - Kotlin Edition

By : Neil Smyth
Book Image

Android Studio Arctic Fox Essentials - Kotlin Edition

By: Neil Smyth

Overview of this book

Android Studio is an Integrated Development Environment based on the JetBrains IntelliJ IDEA. It offers developers a unique platform to design and develop Android apps using various developer tools. Fully updated for Android Studio Arctic Fox, the goal of this book is to teach the skills necessary to develop Android-based applications using the Kotlin programming language. This book begins with an outline of the steps necessary to set up an Android development and testing environment, followed by an introduction to programming in Kotlin which includes data types, control flow, functions, lambdas, and object-oriented programming. An overview of Android Studio covers areas such as tool windows, the code editor, and the layout editor tool. An introduction to the architecture of Android is followed by an in-depth look at the design of Android applications and user interfaces using the Android Studio environment. Early chapters detail Android architecture components such as view models, lifecycle management, Room database access, the Database Inspector, app navigation, live data, and data binding. More advanced topics such as intents are also covered, as are touch screen handling, gesture recognition, and the recording and playback of audio. This edition of the book also covers printing, transitions, cloud-based file storage, and foldable device support. The concepts of material design are also discussed in detail, including the use of floating action buttons, Snackbars, tabbed interfaces, card views, navigation drawers, and collapsing toolbars. Other key features of Android Studio Arctic Fox and Android taught in this book include the Layout Editor, the ConstraintLayout and ConstraintSet classes, MotionLayout Editor, view binding, constraint chains, barriers, and direct reply to notifications. Chapters also explore more advanced features of Android Studio such as app links, dynamic delivery, Gradle build configuration, and submitting apps to the Google Play developer console.
Table of Contents (93 chapters)
93
Index

2.3 Installing Android Studio

Once downloaded, the exact steps to install Android Studio differ depending on the operating system on which the installation is being performed.

2.3.1 Installation on Windows

Locate the downloaded Android Studio installation executable file (named android-studio-<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 be installed on the system, the remainder of this book will assume that the installation was performed into C:\Program Files\Android\Android Studio and that the Android SDK packages have been installed into the user’s AppData\Local\Android\sdk sub-folder. Once the options have been configured, click on the Install button to begin the installation process.

On versions of Windows with a Start menu, the newly installed Android Studio can be launched from the entry added to that menu during the installation. The executable may be pinned to the task bar for easy access by navigating to the Android Studio\bin directory, right-clicking on the executable and selecting the Pin to Taskbar menu option.

2.3.2 Installation on macOS

Android Studio for macOS is downloaded in the form of a disk image (.dmg) file. Once the android-studio-<version>-mac.dmg file has been downloaded, locate it in a Finder window and double-click on it to open it as shown in Figure 2-1:

Figure 2-1

To install the package, simply drag the Android Studio icon and drop it onto the Applications folder. The Android Studio package will then be installed into the Applications folder of the system, a process which will typically take a few seconds to complete.

To launch Android Studio, locate the executable in the Applications folder using a Finder window and double-click on it.

For future easier access to the tool, drag the Android Studio icon from the Finder window and drop it onto the dock.

2.3.3 Installation on Linux

Having downloaded the Linux Android Studio package, open a terminal window, change directory to the location where Android Studio is to be installed and execute the following command:

unzip /<path to package>/android-studio-ide-<version>-linux.zip

Note that the Android Studio bundle will be installed into a sub-directory named android-studio. Assuming, therefore, that the above command was executed in /home/demo, the software packages will be unpacked into /home/demo/android-studio.

To launch Android Studio, open a terminal window, change directory to the android-studio/bin sub-directory and execute the following command:

./studio.sh

When running on a 64-bit Linux system, it will be necessary to install some 32-bit support libraries before Android Studio will run. On Ubuntu these libraries can be installed using the following command:

sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1 libbz2-1.0:i386

On Red Hat and Fedora based 64-bit systems, use the following command:

sudo yum install zlib.i686 ncurses-libs.i686 bzip2-libs.i686