Transcription of Kotlin / Android Studio 3.0 Development Essentials
1 Kotlin / Android Studio Development EssentialsAndroid 8 EditionKotlin / Android Studio Development Essentials Android 8 Edition 2017 Neil Smyth / Payload Media, Inc. All Rights book is provided for personal use only. Unauthorized use, reproduction and/or distribution strictly prohibited. All rights content of this book is provided for informational purposes only. Neither the publisher nor the author offers any warranties or representation, express or implied, with regard to the accuracy of information contained in this book, nor do they accept any liability for any loss or damage arising from any errors or book contains trademarked terms that are used solely for editorial purposes and to the benefit of the respective trademark owner.
2 The terms used within this book are not intended as infringement of any : iContentsTable of Contents1. Introduction .. Downloading the Code Samples .. Firebase Essentials Book Now Available .. Feedback .. Setting up an Android Studio Development Environment .. System Requirements .. Downloading the Android Studio Package .. Installing Android Studio .. Installation on Windows .. Installation on macOS .. Installation on Linux .. The Android Studio Setup Wizard .. Installing Additional Android SDK Packages .. Making the Android SDK Tools Command-line Accessible .. Windows Windows .. Windows 10 .. Linux .. macOS .. Updating Android Studio and the SDK.
3 Summary ..103. Creating an Example Android App in Android Studio .. Creating a New Android Project .. Defining the Project and SDK Settings .. Creating an Activity .. Modifying the Example Application .. Reviewing the Layout and Resource Files .. Summary ..224. A Tour of the Android Studio User Interface .. The Welcome Screen .. The Main Window .. The Tool Windows .. Android Studio Keyboard Shortcuts .. Switcher and Recent Files Navigation .. Changing the Android Studio Theme .. Summary ..305. Creating an Android Virtual Device (AVD) in Android Studio .. About Android Virtual Devices .. Creating a New AVD .. Starting the Emulator ..33iiTable of Running the Application in the AVD.
4 Run/Debug Stopping a Running Application .. AVD Command-line Creation .. Android Virtual Device Configuration Files .. Moving and Renaming an Android Virtual Device .. Summary ..396. Using and Configuring the Android Studio AVD Emulator .. The Emulator Environment .. The Emulator Toolbar Options .. Working in Zoom Mode .. Resizing the Emulator Extended Control Options .. Location .. Cellular .. Battery .. Phone .. Directional Pad .. Microphone .. Fingerprint .. Virtual Sensors .. Help .. Drag and Drop Support .. Configuring Fingerprint Emulation .. Summary ..467. Testing Android Studio Apps on a Physical Android Device .. An Overview of the Android Debug Bridge (ADB).
5 Enabling ADB on Android based Devices .. macOS ADB Configuration .. Windows ADB Configuration .. Linux adb Configuration .. Testing the adb Connection .. Summary ..518. The Basics of the Android Studio Code Editor .. The Android Studio Splitting the Editor Window .. Code Completion .. Statement Completion .. Parameter Information .. Parameter Name Hints .. Code Generation .. Code Folding .. Quick Documentation Lookup .. Code Finding Sample Code .. Summary ..62iiiTable of Contents9. An Overview of the Android Architecture .. The Android Software Stack .. The Linux Kernel .. Android Runtime ART .. Android Libraries .. C/C++ Libraries .. Application Framework.
6 Applications .. Summary ..6610. The Anatomy of an Android Application .. Android Activities .. Android Intents .. Broadcast Intents .. Broadcast Receivers .. Android Services .. Content Providers .. The Application Manifest .. Application Resources .. Application Context .. Summary ..6911. An Introduction to Kotlin .. What is Kotlin ? .. Kotlin and Java .. Converting from Java to Kotlin .. Kotlin and Android Studio .. Experimenting with Kotlin .. Semi-colons in Kotlin .. Summary ..7312. Kotlin Data Types,Variables and Nullability .. Kotlin Data Types .. Integer Data Types .. Floating Point Data Types .. Boolean Data Type .. Character Data Type.
7 String Data Type .. Escape Sequences .. Mutable Variables .. Immutable Variables .. Declaring Mutable and Immutable Variables .. Data Types are Objects .. Type Annotations and Type Inference .. Nullable Type .. The Safe Call Operator .. Not-Null Assertion .. Nullable Types and the let Function .. The Elvis Operator .. Type Casting and Type Checking .. Summary ..8313. Kotlin Operators and Expressions .. Expression Syntax in Kotlin .. The Basic Assignment Operator .. Kotlin Arithmetic Operators .. Augmented Assignment Operators .. Increment and Decrement Operators .. Equality Operators .. Boolean Logical Operators .. Range Operator .. Bitwise Operators.
8 Bitwise Inversion .. Bitwise AND .. Bitwise OR .. Bitwise XOR .. Bitwise Left Shift .. Bitwise Right Shift .. Summary ..9114. Kotlin Flow Control .. Looping Flow Control .. The Kotlin for-in Statement .. The while Loop .. The do .. while loop .. Breaking from Loops .. The continue Statement .. Break and Continue Labels .. Conditional Flow Control .. Using the if Expressions .. Using if .. else .. Expressions .. Using if .. else if .. Expressions .. Using the when Statement .. Summary ..9915. An Overview of Kotlin Functions and Lambdas .. What is a Function? .. How to Declare a Kotlin Function .. Calling a Kotlin Function .. Single Expression Functions.
9 Local Functions .. Handling Return Values .. Declaring Default Function Parameters .. Variable Number of Function Parameters .. Lambda Expressions .. Higher-order Functions .. Summary ..10616. The Basics of Object Oriented Programming in Kotlin .. What is an Object? .. What is a Class? ..107vTable of Declaring a Kotlin Class .. Adding Properties to a Defining Methods .. Declaring and Initializing a Class Instance .. Primary and Secondary Constructors .. Initializer Blocks .. Calling Methods and Accessing Properties .. Custom Accessors .. Nested and Inner Classes .. Summary ..11317. An Introduction to Kotlin Inheritance and Subclassing .. Inheritance, Classes and Subclasses.
10 Subclassing Syntax .. A Kotlin Inheritance Example .. Extending the Functionality of a Subclass .. Overriding Inherited Methods .. Adding a Custom Secondary Using the SavingsAccount Class .. Summary ..11918. Understanding Android Application and Activity Lifecycles .. Android Applications and Resource Management .. Android Process States .. Foreground Process .. Visible Process .. Service Process .. Background Process .. Empty Process .. Inter-Process Dependencies .. The Activity Lifecycle .. The Activity Stack .. Activity States .. Configuration Changes .. Handling State Change .. Summary ..12519. Handling Android Activity State The Activity Class.