Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Android Studio 4.0 Development Essentials - Kotlin Edition
Android Studio 4.0 Development Essentials - Kotlin Edition

Android Studio 4.0 Development Essentials - Kotlin Edition: Build Android Apps with Android Studio 4.0 and Kotlin

By Neil Smyth
£23.99 £15.99
Book Oct 2020 817 pages 1st Edition
eBook
£23.99 £15.99
Subscription
£13.99 Monthly
eBook
£23.99 £15.99
Subscription
£13.99 Monthly

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Buy Now

Product Details


Publication date : Oct 21, 2020
Length 817 pages
Edition : 1st Edition
Language : English
ISBN-13 : 9781800560437
Category :
Table of content icon View table of contents Preview book icon Preview Book

Android Studio 4.0 Development Essentials - Kotlin Edition

2. Setting up an Android Studio Development Environment

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.

2.1 System Requirements

Android application development may be performed on any of the following system types:

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

2.2 Downloading the Android Studio Package

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:

https://developer.android.com/studio/index.html

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...

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-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...

2.4 The Android Studio Setup Wizard

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:

Figure 2-2

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...

2.5 Installing Additional Android SDK Packages

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:

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...

2.6 Making the Android SDK Tools Command-line Accessible

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):

<path_to_android_sdk_installation>/sdk/tools

<path_to_android_sdk_installation>/sdk/tools/bin

<path_to_android_sdk_installation>/sdk/platform-tools

The location of the SDK on your system can be identified by launching the SDK...

2.7 Android Studio Memory Management

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...

2.8 Updating Android Studio and the SDK

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.

2.9 Summary

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.

Left arrow icon Right arrow icon

Key benefits

  • Discover how to set up Android development and testing environments
  • Practice object-oriented programming (OOP) in Kotlin
  • Explore all the major elements of Android Jetpack

Description

Kotlin as an Android-compatible programming language is becoming increasingly popular. Fully updated for Android Studio 4.0, this book will teach you the skills necessary to develop Android-based applications using Kotlin. Starting with the basics, this book outlines the steps necessary to set up Android development and testing environments, and goes on to introduce you to programming in Kotlin. You’ll practice Java to Kotlin code conversion and explore data types, operators, expressions, loops, functions, as well as the basics of OOP in Kotlin. You’ll then learn about Android architecture components and advanced topics, such as intents, touchscreen handling, gesture recognition, multi-window support integration, and biometric authentication. As you make progress, you’ll explore Android Studio 4.0’s key features, including layout editor, direct reply notifications, and dynamic delivery. You’ll also delve into Android Jetpack and create a sample app project using ViewModel, the Android Jetpack component. Finally, you will upload your app to Google Play Console and model the build process using Gradle. By the end of this Android book, you’ll be fully prepared to develop applications using Android Studio 4.0 and Kotlin.

What you will learn

Build Android apps by writing less error-prone code using Kotlin Reduce the amount of code using Android Jetpack Explore unique ways of handling single and multi-touch events Trigger local and remote notifications on the device Integrate biometric authentication into an Android app Create, test, and upload an Android app bundle on Google Play Store

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Buy Now

Product Details


Publication date : Oct 21, 2020
Length 817 pages
Edition : 1st Edition
Language : English
ISBN-13 : 9781800560437
Category :

Table of Contents

97 Chapters
1. Introduction Chevron down icon Chevron up icon
2. Setting up an Android Studio Development Environment Chevron down icon Chevron up icon
3. Creating an Example Android App in Android Studio Chevron down icon Chevron up icon
4. Creating an Android Virtual Device (AVD) in Android Studio Chevron down icon Chevron up icon
5. Using and Configuring the Android Studio AVD Emulator Chevron down icon Chevron up icon
6. A Tour of the Android Studio User Interface Chevron down icon Chevron up icon
7. Testing Android Studio Apps on a Physical Android Device Chevron down icon Chevron up icon
8. The Basics of the Android Studio Code Editor Chevron down icon Chevron up icon
9. An Overview of the Android Architecture Chevron down icon Chevron up icon
10. The Anatomy of an Android Application Chevron down icon Chevron up icon
11. An Introduction to Kotlin Chevron down icon Chevron up icon
12. Kotlin Data Types,Variables and Nullability Chevron down icon Chevron up icon
13. Kotlin Operators and Expressions Chevron down icon Chevron up icon
14. Kotlin Flow Control Chevron down icon Chevron up icon
15. An Overview of Kotlin Functions and Lambdas Chevron down icon Chevron up icon
16. The Basics of Object Oriented Programming in Kotlin Chevron down icon Chevron up icon
17. An Introduction to Kotlin Inheritance and Subclassing Chevron down icon Chevron up icon
18. An Overview of Android View Binding Chevron down icon Chevron up icon
19. Understanding Android Application and Activity Lifecycles Chevron down icon Chevron up icon
20. Handling Android Activity State Changes Chevron down icon Chevron up icon
21. Android Activity State Changes by Example Chevron down icon Chevron up icon
22. Saving and Restoring the State of an Android Activity Chevron down icon Chevron up icon
23. Understanding Android Views, View Groups and Layouts Chevron down icon Chevron up icon
24. A Guide to the Android Studio Layout Editor Tool Chevron down icon Chevron up icon
25. A Guide to the Android ConstraintLayout Chevron down icon Chevron up icon
26. A Guide to using ConstraintLayout in Android Studio Chevron down icon Chevron up icon
27. Working with ConstraintLayout Chains and Ratios in Android Studio Chevron down icon Chevron up icon
28. An Android Studio Layout Editor ConstraintLayout Tutorial Chevron down icon Chevron up icon
29. Manual XML Layout Design in Android Studio Chevron down icon Chevron up icon
30. Managing Constraints using Constraint Sets Chevron down icon Chevron up icon
31. An Android ConstraintSet Tutorial Chevron down icon Chevron up icon
32. A Guide to using Apply Changes in Android Studio Chevron down icon Chevron up icon
33. An Overview and Example of Android Event Handling Chevron down icon Chevron up icon
34. Android Touch and Multi-touch Event Handling Chevron down icon Chevron up icon
35. Detecting Common Gestures using the Android Gesture Detector Class Chevron down icon Chevron up icon
36. Implementing Custom Gesture and Pinch Recognition on Android Chevron down icon Chevron up icon
37. An Introduction to Android Fragments Chevron down icon Chevron up icon
38. Using Fragments in Android Studio - An Example Chevron down icon Chevron up icon
39. Modern Android App Architecture with Jetpack Chevron down icon Chevron up icon
40. An Android Jetpack ViewModel Tutorial Chevron down icon Chevron up icon
41. An Android Jetpack LiveData Tutorial Chevron down icon Chevron up icon
42. An Overview of Android Jetpack Data Binding Chevron down icon Chevron up icon
43. An Android Jetpack Data Binding Tutorial Chevron down icon Chevron up icon
44. An Android ViewModel Saved State Tutorial Chevron down icon Chevron up icon
45. Working with Android Lifecycle-Aware Components Chevron down icon Chevron up icon
46. An Android Jetpack Lifecycle Awareness Tutorial Chevron down icon Chevron up icon
47. An Overview of the Navigation Architecture Component Chevron down icon Chevron up icon
48. An Android Jetpack Navigation Component Tutorial Chevron down icon Chevron up icon
49. Creating and Managing Overflow Menus on Android Chevron down icon Chevron up icon
50. An Introduction to MotionLayout Chevron down icon Chevron up icon
51. An Android MotionLayout Editor Tutorial Chevron down icon Chevron up icon
52. A MotionLayout KeyCycle Tutorial Chevron down icon Chevron up icon
53. Working with the Floating Action Button and Snackbar Chevron down icon Chevron up icon
54. Creating a Tabbed Interface using the TabLayout Component Chevron down icon Chevron up icon
55. Working with the RecyclerView and CardView Widgets Chevron down icon Chevron up icon
56. An Android RecyclerView and CardView Tutorial Chevron down icon Chevron up icon
57. A Layout Editor Sample Data Tutorial Chevron down icon Chevron up icon
58. Working with the AppBar and Collapsing Toolbar Layouts Chevron down icon Chevron up icon
59. An Android Studio Master/Detail Flow Tutorial Chevron down icon Chevron up icon
60. An Overview of Android Intents Chevron down icon Chevron up icon
61. Android Explicit Intents – A Worked Example Chevron down icon Chevron up icon
62. Android Implicit Intents – A Worked Example Chevron down icon Chevron up icon
63. Android Broadcast Intents and Broadcast Receivers Chevron down icon Chevron up icon
64. A Basic Overview of Threads and AsyncTasks Chevron down icon Chevron up icon
65. An Introduction to Kotlin Coroutines Chevron down icon Chevron up icon
66. An Android Kotlin Coroutines Tutorial Chevron down icon Chevron up icon
67. An Overview of Android Started and Bound Services Chevron down icon Chevron up icon
68. Implementing an Android Started Service – A Worked Example Chevron down icon Chevron up icon
69. Android Local Bound Services – A Worked Example Chevron down icon Chevron up icon
70. Android Remote Bound Services – A Worked Example Chevron down icon Chevron up icon
71. An Android Notifications Tutorial Chevron down icon Chevron up icon
72. An Android Direct Reply Notification Tutorial Chevron down icon Chevron up icon
73. Foldable Devices and Multi-Window Support Chevron down icon Chevron up icon
74. An Overview of Android SQLite Databases Chevron down icon Chevron up icon
75. The Android Room Persistence Library Chevron down icon Chevron up icon
76. An Android TableLayout and TableRow Tutorial Chevron down icon Chevron up icon
77. An Android Room Database and Repository Tutorial Chevron down icon Chevron up icon
78. Accessing Cloud Storage using the Android Storage Access Framework Chevron down icon Chevron up icon
79. An Android Storage Access Framework Example Chevron down icon Chevron up icon
80. Video Playback on Android using the VideoView and MediaController Classes Chevron down icon Chevron up icon
81. Android Picture-in-Picture Mode Chevron down icon Chevron up icon
82. An Android Picture-in-Picture Tutorial Chevron down icon Chevron up icon
83. Making Runtime Permission Requests in Android Chevron down icon Chevron up icon
84. Android Audio Recording and Playback using MediaPlayer and MediaRecorder Chevron down icon Chevron up icon
85. Working with the Google Maps Android API in Android Studio Chevron down icon Chevron up icon
86. Printing with the Android Printing Framework Chevron down icon Chevron up icon
87. An Android HTML and Web Content Printing Example Chevron down icon Chevron up icon
88. A Guide to Android Custom Document Printing Chevron down icon Chevron up icon
89. An Introduction to Android App Links Chevron down icon Chevron up icon
90. An Android Studio App Links Tutorial Chevron down icon Chevron up icon
91. A Guide to the Android Studio Profiler Chevron down icon Chevron up icon
92. An Android Biometric Authentication Tutorial Chevron down icon Chevron up icon
93. Creating, Testing and Uploading an Android App Bundle Chevron down icon Chevron up icon
94. An Overview of Android Dynamic Feature Modules Chevron down icon Chevron up icon
95. An Android Studio Dynamic Feature Tutorial Chevron down icon Chevron up icon
96. An Overview of Gradle in Android Studio Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Filter icon Filter
Top Reviews
Rating distribution
Empty star icon Empty star icon Empty star icon Empty star icon Empty star icon 0
(0 Ratings)
5 star 0%
4 star 0%
3 star 0%
2 star 0%
1 star 0%

Filter reviews by


No reviews found
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.