更新时间:2021-03-26 16:17:20
封面
版权信息
Contributors
About the author
About the reviewers
Packt is searching for authors like you
Preface
Who this book is for
What this book covers
To get the most out of this book
Get in touch
Chapter 1. Getting Started with Android and Kotlin
Why use Kotlin and Android?
The beginner's first stumbling block
How Kotlin and Android work together
Setting up Android Studio
What makes an Android app?
The structure of Android's code
Our first Android app
Deploying the app so far
Frequently asked question
Summary
Chapter 2. Kotlin XML and the UI Designer
Examining the log output
Exploring the project's Kotlin code and the main layout's XML code
Adding buttons to the main layout file
Leaving comments in our Kotlin code
Coding messages to the user and the developer
Writing our first Kotlin code
Frequently asked questions
Chapter 3. Exploring Android Studio and the Project Structure
A quick guided tour of Android Studio
Project Explorer and project anatomy
The Basic Activity project
Exploring the Android emulator
Chapter 4. Getting Started with Layouts and Material Design
Material design
Exploring Android UI design
Layouts
Creating the Exploring Layouts project
Building a menu with LinearLayout
Wiring up the UI with the Kotlin code (part 1)
Adding layouts within layouts
Making the layout look pretty
Wiring up the UI with the Kotlin code (part 2)
Building a precise UI with ConstraintLayout
Laying out data with TableLayout
Chapter 5. Beautiful Layouts with CardView and ScrollView
Attributes – a quick summary
Building a UI with CardView and ScrollView
Themes and material design
Creating a tablet emulator
Chapter 6. The Android Lifecycle
The life and times of an Android app
A simplified explanation of the Android lifecycle
How we handle the lifecycle phases
The lifecycle demo app
Some other overridden functions
The structure of Kotlin code – revisited
Chapter 7. Kotlin Variables Operators and Expressions
Learning the jargon
More on code comments
Variables
Operators and expressions
The express yourself demo app
Chapter 8. Kotlin Decisions and Loops
Making decisions in Kotlin
Repeating code with loops
while loops
do-while loops
Ranges
For loops
Controlling loops with break and continue
Sample code
Chapter 9. Kotlin Functions
Function basics and recap
Making functions flexible
Chapter 10. Object-Oriented Programming
Introducing OOP
Basic classes
Visibility modifiers
Constructors
Basic classes app and using the init block
Introduction to references
Chapter 11. Inheritance in Kotlin
OOP and inheritance
Using inheritance with open classes
More polymorphism
Classes using the Inheritance example app