Android Studio Otter Essentials - Compose Edition (eBook)
666 Seiten
Payload Publishing (Verlag)
978-1-965764-32-9 (ISBN)
This book is a comprehensive guide to building Android applications using Android Studio Otter (2025.2.2), Jetpack Compose, and the Kotlin programming language. It is designed to provide the knowledge and skills you need to create modern Android apps using the latest development tools and frameworks.
We begin with foundational steps, including setting up an Android Studio development environment, followed by a detailed introduction to Kotlin, the language underpinning Android development. This section covers core aspects of Kotlin, including data types, operators, control flow, functions, lambdas, and coroutines, establishing a solid foundation in object-oriented programming principles.
Next, we cover Jetpack Compose, Google's innovative toolkit for building native user interfaces, including an in-depth look at Compose components and layout structures, including rows, columns, boxes, flows, pagers, and lists. You'll also gain insights into Android project architecture and Android Studio's Compose development mode.
Advanced topics are also covered, including state management, modifiers, and UI navigation. You will also learn how to create reusable layout components, implement biometric authentication for enhanced security, and accelerate development with Gemini AI.
The guide also covers specialized techniques, including graphics rendering, animations, transitions, Kotlin Flows, and gesture handling. Practical data management solutions, including view models, Room database access, live data, and the Database Inspector, are explored in detail. For developers interested in monetization, this guide also includes a dedicated section on implementing in-app billing.
The concluding chapters provide a comprehensive overview of app packaging and the publication process on the Google Play Store.
Throughout the book, each concept is reinforced with hands-on tutorials and downloadable source code. Additionally, over 50 online quizzes are available to test your knowledge and understanding.
2. Setting up an Android Studio Development Environment
Before any work can begin on developing an Android application, the first step is to configure a computer system to act as the development platform. This involves several steps consisting of installing the Android Studio Integrated Development Environment (IDE), including the Android Software Development Kit (SDK), the Kotlin plug-in and the 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 10 or 11 64-bit
•macOS 12 or later running on Intel or Apple silicon
•Chrome OS device with Intel i5 or higher
•Linux systems with version 2.31 or later of the GNU C Library (glibc)
•Minimum of 16 GB of RAM
•Approximately 8 GB 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 Otter 2025.2.2 using the Android API 36 SDK (Baklava), which, at the time of writing, are the latest releases.
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, there may be differences between this book and the software. A web search for “Android Studio Otter” should provide the option to download the older version if these differences become a problem. Alternatively, visit the following web page to find Android Studio Otter 2025.2.2 in the archives:
https://developer.android.com/studio/archive
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 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 system users. When prompted to select the components to install, ensure 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 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 taskbar for easy access by navigating to the Android Studio/bin directory, right-clicking on the studio64 executable, and selecting the Pin to Taskbar menu option (on Windows 11, this option can be found by selecting Show more options from the menu).
2.3.2 Installation on macOS
Android Studio for macOS is downloaded as 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, 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 that 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:
tar xvfz /<path to package>/android-studio-<version>-linux.tar.gz
Note that the Android Studio bundle will be installed into a subdirectory named android-studio. Therefore, assuming 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
2.4 The Android Studio setup wizard
If you have previously installed an earlier version of Android Studio, the first time this new version is launched, a dialog may 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 the OK button to proceed.
If you are installing Android Studio for the first time, the initial dialog that appears once the setup process starts may resemble that shown in Figure 2-2 below:
Figure 2-2
If this dialog appears, click the Next button to display the Install Type screen (Figure 2-3). On this screen, select the Standard installation option before clicking Next.
Figure 2-3
Click Next and review the options in the Verify Settings screen before proceeding to the License Agreement screen. Enable the Accept checkbox and click the Finish button to start the installation.
After these initial setup steps have been taken, click the Finish button to display the Welcome to Android Studio screen using your chosen UI theme:
Figure 2-4
2.5 Installing additional Android SDK packages
The steps performed so far have installed 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 by clicking on the More Actions link within the welcome dialog and selecting the SDK Manager option from the drop-down menu. Once invoked, the Android SDK screen of the Settings dialog will appear as shown in Figure 2-5:
Figure 2-5
Google pairs each release of Android Studio with a maximum supported Application Programming Interface (API) level of the Android SDK. In the case of Android Studio Otter, this is Android API Level 36 (Baklava). This information can be confirmed using the following link:
https://developer.android.com/studio/releases#api-level-support
Immediately after installing Android Studio for the first time, it is likely that only the latest supported version of the Android SDK has been installed. To install older versions of the Android SDK, select the checkboxes corresponding to the versions and click the Apply button. The rest of this book assumes that the Android API Level 36 (Baklava) SDK is installed.
Most of the examples in this book will support older versions of Android as far back as Android 8.0 (Oreo). This ensures that the apps run on a wide range of Android devices. Within the list of SDK versions, enable the checkbox next to Android 8.0 (Oreo) and click the Apply button. Click the OK button to install the SDK in the resulting confirmation dialog. Subsequent dialogs will seek the acceptance of licenses and terms before performing the installation. Click Finish once the installation is complete.
It is also possible that updates will be listed as being available for the latest SDK. To access detailed information about the packages that are ready to be updated, enable the Show Package Details option located in the lower right-hand corner of the screen. This will display information similar to that shown in Figure 2-6:
Figure 2-6
The above figure highlights the availability of an update. To...
| Erscheint lt. Verlag | 1.12.2025 |
|---|---|
| Sprache | englisch |
| Themenwelt | Mathematik / Informatik ► Informatik ► Programmiersprachen / -werkzeuge |
| ISBN-10 | 1-965764-32-0 / 1965764320 |
| ISBN-13 | 978-1-965764-32-9 / 9781965764329 |
| Informationen gemäß Produktsicherheitsverordnung (GPSR) | |
| Haben Sie eine Frage zum Produkt? |
Größe: 35,1 MB
Kopierschutz: Adobe-DRM
Adobe-DRM ist ein Kopierschutz, der das eBook vor Mißbrauch schützen soll. Dabei wird das eBook bereits beim Download auf Ihre persönliche Adobe-ID autorisiert. Lesen können Sie das eBook dann nur auf den Geräten, welche ebenfalls auf Ihre Adobe-ID registriert sind.
Details zum Adobe-DRM
Dateiformat: EPUB (Electronic Publication)
EPUB ist ein offener Standard für eBooks und eignet sich besonders zur Darstellung von Belletristik und Sachbüchern. Der Fließtext wird dynamisch an die Display- und Schriftgröße angepasst. Auch für mobile Lesegeräte ist EPUB daher gut geeignet.
Systemvoraussetzungen:
PC/Mac: Mit einem PC oder Mac können Sie dieses eBook lesen. Sie benötigen eine
eReader: Dieses eBook kann mit (fast) allen eBook-Readern gelesen werden. Mit dem amazon-Kindle ist es aber nicht kompatibel.
Smartphone/Tablet: Egal ob Apple oder Android, dieses eBook können Sie lesen. Sie benötigen eine
Geräteliste und zusätzliche Hinweise
Buying eBooks from abroad
For tax law reasons we can sell eBooks just within Germany and Switzerland. Regrettably we cannot fulfill eBook-orders from other countries.
aus dem Bereich