Kotlin collection interfaces include a lot of tools to let you easily sort, filter, and otherwise calculate and manipulate their contents. Learn about a few different ways to sort data using both simple function calls and more complex lambda expressions.
- [Instructor] In last week's tip,…I described how to get started with Kotlin data collections.…This week, I'll show you how to use some tools…that let you easily sort, filter,…and otherwise calculate and manipulate…the contents of the data collection.…To demonstrate some of the simplest functionality,…I've created a list of strings.…And I've packaged it in a class named DataProvider.…It has a single function inside the companion object.…That makes the function behave like a static method in Java,…and it returns a simple list of strings,…the names of the U.S. states in a randomized order.…
I'll come back to the main activity class…and I'll come back to the shopping cart later.…For the moment, I just want to work with…that simple list of strings.…I'm going to create a variable that I'll call stateList…and I'll get its value from DataProvider.getStateList.…Now I want to sort that data in alphabetical order.…The list interface has a function called sorted.…Now it doesn't actually sort that list,…instead, it returns a copy of the list.…
Skill Level Intermediate
Q: Why can't I earn a Certificate of Completion for this course?
A: We publish a new tutorial or tutorials for this course on a regular basis. We are unable to offer a Certificate of Completion because it is an ever-evolving course that is not designed to be completed. Check back often for new movies.
Android App Development: Data Persistence Librarieswith Annyce Davis4h 52m Intermediate
Building Android Apps with Cloud Serviceswith Albert Lo2h 37m Intermediate
1. Android Development Tips Weekly
- 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.