Book Image

Android Development with Kotlin

By : Igor Wojda, Marcin Moskala
Book Image

Android Development with Kotlin

By: Igor Wojda, Marcin Moskala

Overview of this book

Nowadays, improved application development does not just mean building better performing applications. It has become crucial to find improved ways of writing code. Kotlin is a language that helps developers build amazing Android applications easily and effectively. This book discusses Kotlin features in context of Android development. It demonstrates how common examples that are typical for Android development, can be simplified using Kotlin. It also shows all the benefits, improvements and new possibilities provided by this language. The book is divided in three modules that show the power of Kotlin and teach you how to use it properly. Each module present features in different levels of advancement. The first module covers Kotlin basics. This module will lay a firm foundation for the rest of the chapters so you are able to read and understand most of the Kotlin code. The next module dives deeper into the building blocks of Kotlin, such as functions, classes, and function types. You will learn how Kotlin brings many improvements to the table by improving common Java concepts and decreasing code verbosity. The last module presents features that are not present in Java. You will learn how certain tasks can be achieved in simpler ways thanks to Kotlin. Through the book, you will learn how to use Kotlin for Android development. You will get to know and understand most important Kotlin features, and how they can be used. You will be ready to start your own adventure with Android development with Kotlin.
Table of Contents (16 chapters)
Title Page
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Customer Feedback
Preface
9
Making Your Marvel Gallery Application

More reasons to use Kotlin


Kotlin has strong commercial support from JetBrains, a company that delivers very popular IDEs for many popular programming languages (Android Studio is based on JetBrains IntelliJ IDEA). JetBrains wanted to improve the quality of their code and team performance, so they needed a language that would solve all the Java issues and provide seamless interoperability with Java. None of the other JVM languages meet those requirements, so JetBrains finally decided to create their own language and started the Kotlin project. Nowadays, Kotlin is used in their flagship products. Some use Kotlin together with Java while others are pure Kotlin products.

Kotlin is quite a mature language. In fact, its development started many years before Google announced official Android support (the first commit dates back to 2010-11-08):

Note

The initial name of the language was Jet. At some point, the JetBrains team decided to rename it to Kotlin. The name comes from Kotlin Island near St. Petersburg and is analogous to Java, which was named after an Indonesian island.

After the version 1.0 release in 2016, more and more companies started to support the Kotlin project. Gradle added support for Kotlin into building scripts; Square, the biggest creator of Android libraries posted that they strongly support Kotlin; and finally, Google announced official Kotlin support for the Android platform. This means that every tool that will be released by the Android team will be compatible not only with Java but also with Kotlin. Google and JetBrains have begun a partnership to create a nonprofit foundation for Kotlin, responsible for future language maintenance and development. All of this will greatly increase the number of companies that use Kotlin in their projects.

Kotlin is also similar to Apple's Swift programming language. In fact, such is the resemblance that some articles focus on differences, not similarities. Learning Kotlin will be very helpful for developers eager to develop applications for Android and iOS. There are also plans to port Kotlin to iOS (Kotlin/Native), so maybe we don't have to learn Swift after all. Full stack development is also possible in Kotlin, so we can develop server-side applications and frontend clients that share the same data model as mobile clients.