Book Image

Reactive Programming in Kotlin

By : Rivu Chakraborty
Book Image

Reactive Programming in Kotlin

By: Rivu Chakraborty

Overview of this book

In today's app-driven era, when programs are asynchronous, and responsiveness is so vital, reactive programming can help you write code that's more reliable, easier to scale, and better-performing. Reactive programming is revolutionary. With this practical book, Kotlin developers will first learn how to view problems in the reactive way, and then build programs that leverage the best features of this exciting new programming paradigm. You will begin with the general concepts of Reactive programming and then gradually move on to working with asynchronous data streams. You will dive into advanced techniques such as manipulating time in data-flow, customizing operators and provider and how to use the concurrency model to control asynchronicity of code and process event handlers effectively. You will then be introduced to functional reactive programming and will learn to apply FRP in practical use cases in Kotlin. This book will also take you one step forward by introducing you to Spring 5 and Spring Boot 2 using Kotlin. By the end of the book, you will be able to build real-world applications with reactive user interfaces as well as you'll learn to implement reactive programming paradigms in Android.
Table of Contents (20 chapters)
Title Page
Credits
About the Author
About the Reviewers
www.PacktPub.com
Customer Feedback
Dedication
Preface

Setting up Kotlin in Android Studio


We strongly encourage you to use Android Studio 3.0 for Android development, irrespective of whether you're using Kotlin or not. Android Studio 3.0 is the latest version of Android Studio, with a lot of bug fixes, new features, and improved Gradle build time.

For Android Studio 3.0, you don't need to do any setup to use Kotlin for Android development. You just need to select Include Kotlin support while creating a new project. Here is a screenshot for your reference:

We've highlighted the Include Kotlin support section of the Android Studio—Create Android Project dialog.

However, if you're using Android Studio 2.3.3, then follow these steps:

  1. Go to Android Studio | Settings | Plugins.
  2. Search for Kotlin (take a look at the following screenshot) and install that plugin as follows:

  1. Start a new Android project.
  2. To apply the Kotlin plugin to the project, open the project level build.gradle and modify the content, as shown here:
  1. Open the build.gradle in your module ...