Book Image

Kotlin - Tips, Tricks, and Techniques [Video]

By : Nigel Henshaw
Book Image

Kotlin - Tips, Tricks, and Techniques [Video]

By: Nigel Henshaw

Overview of this book

<p>Do you want to see an increase in your productivity as an Android developer? With this course, you will discover new possibilities with Kotlin and improve your app development process.</p> <p>In this course, you will work with interesting tools and techniques on examples which you can adopt straightaway. You will speed up your development with less coding and get faster results. By the end of this course, you will be able to write faster, cleaner code and make your life easy as a Kotlin developer.</p> <p>The code bundle for this video course is available at -&nbsp;<a href="https://github.com/PacktPublishing/Kotlin-Tips-Tricks-and-Techniques" target="_blank">https://github.com/PacktPublishing/Kotlin-Tips-Tricks-and-Techniques</a></p> <h2>Style and Approach</h2> <p>A comprehensive course packed with step-by-step instructions, working examples, and helpful tips and techniques on working with Kotlin. This course is divided into clear chunks so you can learn at your own pace and focus on your own area of interest.</p>
Table of Contents (6 chapters)
Chapter 6
KTX Extensions for Easier Access to Android APIs
Content Locked
Section 4
Using Collection KTX Module for Extensive Collection Support
Creating certain types of collections such as ArraySet will involve code to manually create a value and then populate the items in the array one at a time, before returning the populated ArraySet. Use the KTX collection module to create an ArraySet with a single method call. - Demonstrate the issue by implementing an ArraySet the Android way - Replace the Android code with the KTX collection arraySetOf method - Run code to verify that the same ArraySet collection is created