封面
版权信息
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
Summary
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
Summary
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
Summary
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
Frequently asked question
Summary
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
Summary
Chapter 7. Kotlin Variables Operators and Expressions
Learning the jargon
More on code comments
Variables
Operators and expressions
The express yourself demo app
Summary
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
Summary
Chapter 9. Kotlin Functions
Function basics and recap
Making functions flexible
Summary
Chapter 10. Object-Oriented Programming
Introducing OOP
Basic classes
Visibility modifiers
Constructors
Basic classes app and using the init block
Introduction to references
Summary
Chapter 11. Inheritance in Kotlin
OOP and inheritance
Using inheritance with open classes
More polymorphism
Classes using the Inheritance example app
Summary
Chapter 12. Connecting Our Kotlin to the UI and Nullability
All the Android UI elements are classes too
Kotlin interfaces
Using buttons and TextView widgets from our layout with a little help from interfaces
Nullability – val and var revisited
Summary
Chapter 13. Bringing Android Widgets to Life
Declaring and initializing the objects from the layout
Creating UI widgets from pure Kotlin without XML
Exploring the palette – part 1
Lambdas
Exploring the palette – part 2 and more lambdas
The widget exploration app
Coding the widget exploration app
Running the Widget Exploration app
Converting layouts to ConstraintLayout
Summary
Chapter 14. Android Dialog Windows
Dialog windows
The Note to self app
Summary
Chapter 15.Handling Data and Generating Random Numbers
A random diversion
Handling large amounts of data with arrays
A simple mini-app array example
Getting dynamic with arrays
ArrayLists
Arrays and ArrayLists are polymorphic
Hashmaps
The Note to self app
Frequently asked questions
Summary
Chapter 16.Adapters and Recyclers
Inner classes
RecyclerView and RecyclerAdapter
Adding RecyclerView RecyclerAdapter and ArrayList to the Note to Self project
Running the app
Frequently asked questions
Summary
Chapter 17.Data Persistence and Sharing
The Android Intent class
Adding a settings page to Note to self
Persisting data with SharedPreferences
Reloading data with SharedPreferences
Making the Note to self settings persist
More advanced persistence
Backing up user data in Note to self
Frequently asked questions
Summary
Chapter 18.Localization
Making the Note to self app Spanish English and German
Running Note to self in German or Spanish
Summary
Chapter 19.Animations and Interpolations
Animations in Android
Animations demo app – introducing SeekBar
Frequently asked questions
Summary
Chapter 20.Drawing Graphics
Understanding the Canvas class
Using the Canvas class
The Canvas Demo app
The Android coordinate system
Creating bitmap graphics with the Bitmap class
Manipulating bitmaps
The Bitmap manipulation demo app
Frequently asked question
Summary
Chapter 21.Threads and Starting the Live Drawing App
Creating the Live Drawing project
Looking ahead at the Live Drawing app
Coding the MainActivity class
Coding the LiveDrawingView class
The game loop
Threads
Implementing the game loop with a thread
Running the app
Summary
Chapter 22.Particle Systems and Handling Screen Touches
Adding custom buttons to the screen
Implementing a particle system effect
Handling touches
Running the app
Summary
Chapter 23.Android Sound Effects and the Spinner Widget
The SoundPool class
Sound demo app introducing the Spinner widget
Summary
Chapter 24.Design Patterns Multiple Layouts and Fragments
Introducing the model-view-controller pattern
Android design guidelines
Real-world apps
Device detection mini app
Configuration qualifiers
Fragments
Our first fragment app
Fragment reality check
Frequently asked question
Summary
Chapter 25.Advanced UI with Paging and Swiping
The Angry Birds classic swipe menu
Building an image gallery/slider app
Kotlin companion objects
Building a Fragment Pager/slider app
Summary
Chapter 26.Advanced UI with Navigation Drawer and Fragment
Introducing the NavigationView
Examining the Age Database app
Starting the Age Database project
Exploring the auto-generated code and assets
Coding the Fragment classes and their layouts
Using the Fragment classes and their layouts
Summary
Chapter 27.Android Databases
Database 101
The SQL syntax primer
The Android SQLite API
Coding the database class
Coding the Fragment classes to use the DataManager class
Running the Age Database app
Summary
Chapter 28.A Quick Chat Before You Go
Publishing
Making an app!
Carrying on learning
My other channels
Goodbye and thank you
Appendix A. Other Book You May Enjoy
Leave a review - let other readers know what you think
Index
更新时间:2021-03-26 16:17:20