Transforming data is a common requirement for most modern Android applications. Kotlin helps out by providing functions in the standard library for transforming your collection data. In this video, take a look at the map and groupBy functions.
- [Instructor] Transforming data is a common requirement…for most modern Android apps.…Kotlin helps us out by providing functions…in the standard library…for transforming our collection data.…Let's say we have a list of users,…but we actually need a list of their names.…One approach could be to create a new list,…then iterate over the existing list…and add the users' names.…But Kotlin offers us a better way.…We can use the map function and provide a lambda,…which contains the transformation that we're interested in.…
Notice that we're using our familiar it variable.…This represents a given instance of a user,…and then we simply grab their name.…This results in a new list,…which contains the name of each user.…We can even rewrite this using member references…and get the same result.…Another useful function for mapping your data…is the groupBy function.…Let's say you have a list of users…and you want to divide them into groups…based on whether or not they can legally drive.…
Using the groupBy function,…we will provide a lambda with our separation criteria.…
- What Kotlin has to offer
- Working with lambdas
- Common Android extension functions
- Kotlin Android Extensions overview
- Making use of the Anko library
- Working with coroutines
- Nullability and collections
Skill Level Intermediate
Android App Development: Data Persistence Librarieswith Annyce Davis4h 52m Intermediate
Developing AWS Lambda Functions with Kotlinwith Troy Miles1h 55m Intermediate
1. Kotlin Overview
2. Extension Functions and Properties
3. Incorporating Anko
4. Advanced Anko
5. Working with Collections
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.