In this recipe, we are going to learn how to work with the Android Cursor type in a more effective and easy way. We are going to create an extension function for the Cursor type, allowing us to query it in a clean way. We will also implement a practical example showing how to access the system-content resolver in order to fetch contacts stored on the device and transform Cursor into a list of strings representing the contacts' names.
Less boilerplate Cursor data parsing
Getting ready
You can examine the implementation and configuration of the recipes related to the Android framework in the AndroidSamples project available in the GitHub repository: https://github.com/PacktPublishing/Kotlin-Standard-Library-Cookbook/....