Book Image

Kotlin Programming By Example

By : Iyanu Adelekan
Book Image

Kotlin Programming By Example

By: Iyanu Adelekan

Overview of this book

Kotlin greatly reduces the verbosity of source code. With Google having announced their support for Kotlin as a first-class language for writing Android apps, now's the time learn how to create apps from scratch with Kotlin Kotlin Programming By Example takes you through the building blocks of Kotlin, such as functions and classes. You’ll explore various features of Kotlin by building three applications of varying complexity. For a quick start to Android development, we look at building a classic game, Tetris, and elaborate on object-oriented programming in Kotlin. Our next application will be a messenger app, a level up in terms of complexity. Before moving onto the third app, we take a look at data persistent methods, helping us learn about the storage and retrieval of useful applications. Our final app is a place reviewer: a web application that will make use of the Google Maps API and Place Picker. By the end of this book, you will have gained experience of of creating and deploying Android applications using Kotlin.
Table of Contents (12 chapters)

The Fundamentals

Learning a programming language is a daunting experience for many people, and not one that most individuals generally choose to undertake. As you have chosen to pick up this book, I assume that you have an interest in learning the Kotlin programming language and perhaps even becoming an expert at it someday. As a consequence, permit me to congratulate you on taking a bold step toward learning this language.

Regardless of the problem domain that you may wish to build solutions for, be it application development, networking, or distributed systems, Kotlin is a good choice for the development of systems to achieve the required solutions. In other words, a developer can't go wrong with learning Kotlin. At this point, a proper introduction to the Kotlin language is required.

Kotlin is a strongly-typed, object-oriented language that runs on the Java Virtual Machine (JVM) and can be used to develop applications in numerous problem domains. In addition to running on the JVM, Kotlin can be compiled to JavaScript, and as such, is an equally strong choice for developing client-side web applications. Kotlin can also be compiled directly into native binaries that run on systems without a virtual machine via Kotlin/Native. The Kotlin programming language was primarily developed by JetBrains – a company based in Saint Petersburg, Russia. The developers at JetBrains are the current maintainers of the language. Kotlin was named after Kotlin island – an island near Saint Petersburg.

Kotlin was designed to be used to develop industrial-strength software in many domains, but has seen the majority of its use come from the Android ecosystem. At the time of writing, Kotlin is one of the three languages that have been declared by Google as an official language for Android. Kotlin is syntactically similar to Java. As a matter of fact, it was designed to be a better alternative to Java. As a consequence, there are numerous significant advantages to using Kotlin instead of Java in software development.

In this chapter, you will learn the following:

  • The installation of Kotlin
  • The fundamentals of the Kotlin programming language
  • Installing and setting up Android Studio
  • Gradle
  • The fundamentals of the web