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)

Building an Android Application – Tetris

In the previous chapter, we took a concise look at crucial topics pertaining to the core Kotlin language. These topics took us through the fundamentals of Kotlin as well as the powerful object-oriented programming approach to software development it puts at our disposal. In this chapter, we will put the knowledge we gained from the previous chapter to good use by developing an Android application.

In this chapter, you will learn about the following topics:

  • Android application components
  • Views
  • View groups
  • Layout constraints
  • Implementing layouts with XML
  • String and dimension resources
  • Handling input events

We will learn these topics through a hands-on approach by implementing the layouts and components of a classic game, Tetris, in the form of an Android application. As we are developing the game in the form of an Android application...