Kotlin for Android App Development: Developer's Library
Autor Peter Sommerhoffen Limba Engleză Paperback – 24 dec 2018
For students with at least basic programming experience (with any language), Peter Sommerhoff's well-crafted overview and examples will help them get quickly up-to-speed with the Kotlin language, its constructs, and its advanced functional and object-oriented capabilities.
Once students have mastered these foundations, Sommerhoff walks them through two complete app development projects, introducing best practices and emerging patterns for writing code that's robust, concise, readable, and highly performant.
- Leverage advanced Kotlin features including lambdas, collections, null safety, type inference, and try-with-resources
- Explore powerful coroutines with this guide's unique, exclusive coverage
- Quickly migrate existing Java app projects to Kotlin
- Jumpstart your Kotlin projects with working code examples and two full sample apps, all available at a companion Github repository
- Leverage advanced Kotlin features including lambdas, collections, null safety, type inference, and try-with-resources
- Explore powerful coroutines with this guide's unique, exclusive coverage
- Quickly migrate existing Java app projects to Kotlin
- Jumpstart your Kotlin projects with working code examples and two full sample apps, all available at a companion Github repository
Preț: 237.43 lei
Preț vechi: 296.78 lei
-20% Nou
Puncte Express: 356
Preț estimativ în valută:
45.45€ • 46.75$ • 37.71£
45.45€ • 46.75$ • 37.71£
Carte indisponibilă temporar
Doresc să fiu notificat când acest titlu va fi disponibil:
Se trimite...
Preluare comenzi: 021 569.72.76
Specificații
ISBN-13: 9780134854199
ISBN-10: 0134854195
Pagini: 432
Dimensiuni: 179 x 233 x 27 mm
Greutate: 0.66 kg
Editura: Pearson Education
Seria Developer's Library
ISBN-10: 0134854195
Pagini: 432
Dimensiuni: 179 x 233 x 27 mm
Greutate: 0.66 kg
Editura: Pearson Education
Seria Developer's Library
Notă biografică
Peter Sommerhoff is a software developer with a passion for teaching, hence he founded CodeAlong.TV. Today, he teaches development and design to 35,000+ motivated students worldwide. He holds a master's degree in computer science from RWTH Aachen University in Germany. You can follow his activity on Twitter (@petersommerhoff) and on YouTube, where he shares educational content to help people become better software developers.
Cuprins
Listings xiii
Foreword xxvii
Preface xxix
Acknowledgments xxxii
About the Author xxxiii
Part I: Learning Kotlin 1
Chapter 1: Introducing Kotlin 3
What Is Kotlin? 3
Goals and Language Concepts 4
Why Use Kotlin on Android? 5
Kotlin versus Java 8 6
Tool Support and Community 7
Business Perspective 7
Who's Using Kotlin? 8
Summary 9
Chapter 2: Diving into Kotlin 11
Kotlin REPL 11
Variables and Data Types 12
Conditional Code 15
Loops and Ranges 19
Functions 21
Null Safety 29
Equality Checks 32
Exception Handling 33
Summary 36
Chapter 3: Functional Programming in Kotlin 37
Purpose of Functional Programming 37
Functions 39
Lambda Expressions 40
Higher-Order Functions 41
Working with Collections 45
Scoping Functions 53
Lazy Sequences 61
Summary 67
Chapter 4: Object Orientation in Kotlin 69
Classes and Object Instantiation 69
Properties 70
Methods 80
Primary and Secondary Constructors 82
Inheritance and Overriding Rules 84
Type Checking and Casting 89
Visibilities 91
Data Classes 94
Enumerations 96
Sealed Classes 98
Objects and Companions 101
Generics 105
Summary 121
Chapter 5: Interoperability with Java 123
Using Java Code from Kotlin 123
Using Kotlin Code from Java 133
Best Practices for Interop 149
Summary 150
Chapter 6: Concurrency in Kotlin 151
Concurrency 151
Kotlin Coroutines 157
Summary 200
Part II: Kotlin on Android 203
Chapter 7: Android App Development with Kotlin: Kudoo App 205
Setting Up Kotlin for Android 205
App #1: Kudoo, a To-Do List App 210
Summary 239
Chapter 8: Android App Development with Kotlin: Nutrilicious 241
Setting Up the Project 242
Adding a RecyclerView to the Home Screen 243
Fetching Data from the USDA Nutrition API 250
Mapping JSON Data to Domain Classes 257
Introducing a ViewModel for Search 262
Letting Users Search Foods 265
Introducing Fragments I: The Search Fragment 268
Introducing Fragments II: The Favorites Fragment 276
Store User's Favorite Foods in a Room Database 280
Fetching Detailed Nutrition Data from the USDA Food
Reports API 288
Integrating the Details Activity 293
Storing Food Details in the Database 302
Adding RDIs for Actionable Data 307
Improving the User Experience 311
Summary 314
Chapter 9: Kotlin DSLs 315
Introducing DSLs 315
Creating a DSL in Kotlin 318
DSL for Android Layouts with Anko 328
DSL for Gradle Build Scripts 335
Summary 343
Chapter 10: Migrating to Kotlin 345
On Software Migrations 345
Leading the Change 346
Partial or Full Migration 349
Where to Start 351
Tool Support 354
Summary 356
Appendix A: Further Resources 359
Official Resources 359
Community 359
Functional Programming 360
Kotlin DSLs 360
Migrating to Kotlin 360
Testing 361
Glossary 363
Index 367
Foreword xxvii
Preface xxix
Acknowledgments xxxii
About the Author xxxiii
Part I: Learning Kotlin 1
Chapter 1: Introducing Kotlin 3
What Is Kotlin? 3
Goals and Language Concepts 4
Why Use Kotlin on Android? 5
Kotlin versus Java 8 6
Tool Support and Community 7
Business Perspective 7
Who's Using Kotlin? 8
Summary 9
Chapter 2: Diving into Kotlin 11
Kotlin REPL 11
Variables and Data Types 12
Conditional Code 15
Loops and Ranges 19
Functions 21
Null Safety 29
Equality Checks 32
Exception Handling 33
Summary 36
Chapter 3: Functional Programming in Kotlin 37
Purpose of Functional Programming 37
Functions 39
Lambda Expressions 40
Higher-Order Functions 41
Working with Collections 45
Scoping Functions 53
Lazy Sequences 61
Summary 67
Chapter 4: Object Orientation in Kotlin 69
Classes and Object Instantiation 69
Properties 70
Methods 80
Primary and Secondary Constructors 82
Inheritance and Overriding Rules 84
Type Checking and Casting 89
Visibilities 91
Data Classes 94
Enumerations 96
Sealed Classes 98
Objects and Companions 101
Generics 105
Summary 121
Chapter 5: Interoperability with Java 123
Using Java Code from Kotlin 123
Using Kotlin Code from Java 133
Best Practices for Interop 149
Summary 150
Chapter 6: Concurrency in Kotlin 151
Concurrency 151
Kotlin Coroutines 157
Summary 200
Part II: Kotlin on Android 203
Chapter 7: Android App Development with Kotlin: Kudoo App 205
Setting Up Kotlin for Android 205
App #1: Kudoo, a To-Do List App 210
Summary 239
Chapter 8: Android App Development with Kotlin: Nutrilicious 241
Setting Up the Project 242
Adding a RecyclerView to the Home Screen 243
Fetching Data from the USDA Nutrition API 250
Mapping JSON Data to Domain Classes 257
Introducing a ViewModel for Search 262
Letting Users Search Foods 265
Introducing Fragments I: The Search Fragment 268
Introducing Fragments II: The Favorites Fragment 276
Store User's Favorite Foods in a Room Database 280
Fetching Detailed Nutrition Data from the USDA Food
Reports API 288
Integrating the Details Activity 293
Storing Food Details in the Database 302
Adding RDIs for Actionable Data 307
Improving the User Experience 311
Summary 314
Chapter 9: Kotlin DSLs 315
Introducing DSLs 315
Creating a DSL in Kotlin 318
DSL for Android Layouts with Anko 328
DSL for Gradle Build Scripts 335
Summary 343
Chapter 10: Migrating to Kotlin 345
On Software Migrations 345
Leading the Change 346
Partial or Full Migration 349
Where to Start 351
Tool Support 354
Summary 356
Appendix A: Further Resources 359
Official Resources 359
Community 359
Functional Programming 360
Kotlin DSLs 360
Migrating to Kotlin 360
Testing 361
Glossary 363
Index 367