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)

Working with external storage

External storage is used to create and access non-private, shared, world-readable files. Shared external storage is supported by all Android devices. The first thing you need to start using external storage is its permission.

Getting external storage permission

The READ_EXTERNAL_STORAGE and WRITE_EXTERNAL_STORAGE permissions must be acquired by your application before it can make use of external storage APIs. READ_EXTERNAL_STORAGE is necessary when you only need to read from external storage. The WRITE_EXTERNAL_STORAGE permission is necessary when your application requires the ability to write directly to external storage.

These two permissions can be added with ease to the manifest file, as we...