Log In
Or create an account ->
Imperial Library
Home
About
News
Upload
Forum
Help
Login/SignUp
Index
Cover Page
About This E-Book
Title Page
Copyright Page
Contents
Listings
Foreword
Preface
Who This Book Is For
How to Follow This Book
Book Conventions
Acknowledgments
About the Author
I Learning Kotlin
1 Introducing Kotlin
What Is Kotlin?
Goals and Language Concepts
Why Use Kotlin on Android?
Kotlin versus Java 8
Tool Support and Community
Business Perspective
Who’s Using Kotlin?
Summary
2 Diving into Kotlin
Kotlin REPL
Variables and Data Types
Conditional Code
Loops and Ranges
Functions
Null Safety
Equality Checks
Exception Handling
Summary
3 Functional Programming in Kotlin
Purpose of Functional Programming
Functions
Lambda Expressions
Higher-Order Functions
Working with Collections
Scoping Functions
Lazy Sequences
Summary
4 Object Orientation in Kotlin
Classes and Object Instantiation
Properties
Methods
Primary and Secondary Constructors
Inheritance and Overriding Rules
Type Checking and Casting
Visibilities
Data Classes
Enumerations
Sealed Classes
Objects and Companions
Generics
Summary
5 Interoperability with Java
Using Java Code from Kotlin
Using Kotlin Code from Java
Best Practices for Interop
Summary
6 Concurrency in Kotlin
Concurrency
Kotlin Coroutines
Summary
II Kotlin on Android
7 Android App Development with Kotlin: Kudoo App
Setting Up Kotlin for Android
App #1: Kudoo, a To-Do List App
Summary
8 Android App Development with Kotlin: Nutrilicious
Setting Up the Project
Adding a RecyclerView to the Home Screen
Fetching Data from the USDA Nutrition API
Mapping JSON Data to Domain Classes
Introducing a ViewModel for Search
Letting Users Search Foods
Introducing Fragments I: The Search Fragment
Introducing Fragments II: The Favorites Fragment
Store User’s Favorite Foods in a Room Database
Fetching Detailed Nutrition Data from the USDA Food Reports API
Integrating the Details Activity
Storing Food Details in the Database
Adding RDIs for Actionable Data
Improving the User Experience
Summary
9 Kotlin DSLs
Introducing DSLs
Creating a DSL in Kotlin
DSL for Android Layouts with Anko
DSL for Gradle Build Scripts
Summary
10 Migrating to Kotlin
On Software Migrations
Leading the Change
Partial or Full Migration
Where to Start
Tool Support
Summary
A Further Resources
Official Resources
Community
Functional Programming
Kotlin DSLs
Migrating to Kotlin
Testing
Credits
Glossary
Index
← Prev
Back
Next →
← Prev
Back
Next →