▶Book Description
The Android team has announced first-class support for Kotlin 1.1. This acts as an added boost to the language and more and more developers are now looking at Kotlin for their application development. This recipe-based book will be your guide to learning the Kotlin programming language.
The recipes in this book build from simple language concepts to more complex applications of the language. After the fundamentals of the language, you will learn how to apply the object-oriented programming features of Kotlin 1.1. Programming with Lambdas will show you how to use the functional power of Kotlin.
This book has recipes that will get you started with Android programming with Kotlin 1.1, providing quick solutions to common problems encountered during Android app development. You will also be taken through recipes that will teach you microservice and concurrent programming with Kotlin. Going forward, you will learn to test and secure your applications with Kotlin. Finally, this book supplies recipes that will help you migrate your Java code to Kotlin and will help ensure that it's interoperable with Java.
▶What You Will Learn
- Understand the basics and object-oriented concepts of Kotlin Programming
- Explore the full potential of collection frameworks in Kotlin
- Work with SQLite databases in Android, make network calls, and fetch data over a network
- Use Kotlin's Anko library for efficient and quick Android development
- Uncover some of the best features of Kotlin: Lambdas and Delegates
- Set up web service development environments, write servlets, and build RESTful services with Kotlin
- Learn how to write unit tests, integration tests, and instrumentation/acceptance tests.
▶Key Features
- Practical solutions to your common programming problems with Kotlin 1.1
- Leverage the functional power of Kotlin to ease your Android application development
- Learn to use Java code in conjunction with Kotlin
▶Who This Book Is For
This book is targeted at Kotlin beginners who know Android and Java Development and who have a good knowledge level and understanding of the Android development cycle. The readers are familiar with the concepts of Android development and understand the needs of testing their code. They want to learn efficient Kotlin techniques in order to make the existing Android development process more efficient and fun. This is not an introductory book for Kotlin, and it assumes basic familiarity with Kotlin. This book aims at helping developers solve issues they are stuck with while working with Kotlin.
▶What this book covers
- Chapter 1, Installation and Working with Environment, walks you through starting with a Kotlin project. We will also introduce you to the Gradle build system and help you in setting up your development environment.
- Chapter 2, Control Flow, includes recipes for control flow in Kotlin. Kotlin has brought a lot of power to old control flows, as you can now use them as an expression. Kotlin has also introduced a powerful "when", which is basically Java’s "switch" improvements.
- Chapter 3, Classes and Objects, says that classes and objects are inevitable parts of objectoriented programming. This chapter will include the solutions and examples of real-world problems faced by developers and how Kotlin solves it. This chapter will also lay the foundation to the upcoming chapter OOPS programming with Kotlin.
- Chapter 4, Functions, informs that functions are inevitable parts of object- oriented programming. This chapter will include the solutions and examples of real-world problems faced by developers and how Kotlin solves it.
- Chapter 5, Object-Oriented Programming, builds upon the learning of Chapter 3, Classes and Objects, and will include recipes that help in OOP.
- Chapter 6, Collections Framework, presents the recipes that will explore the full potential of Collection framework in Kotlin.
- Chapter 7, Handling File Operations in Kotlin, covers recipes about basic I/O and File I/O.
- Chapter 8, Anko Commons and Extension Function, contains recipes on how to use the Anko library of Kotlin for efficient and quick Android development.
- Chapter 9, Anko Layouts, has recipes on how to use the Anko library of Kotlin for efficient and quick Android development.
- Chapter 10, Databases and Dependency Injection, dives into recipes to work with SQLite databases in Android.
- Chapter 11, Networking and Concurrency, discusses recipes that will help developers make network calls and fetch data over a network.
- Chapter 12, Lambdas and Delegates, uncovers some of the best (and difficult) features of Kotlin, that is, Lambdas and Delegates. This contains recipes to help the developers get started with them.
- Chapter 13, Testing, outlines concepts on writing tests in Kotlin while touching Unit tests, integration tests, instrumentation, and acceptance tests.
- Chapter 14, Web Services with Kotlin, helps developers write web services using Kotlin language.