Kotlin : Android’s future is here – Part 2

Overview

This blog is written to cover basics of Kotlin in Android.

To set text of TextView:

To declare various types of lists:

To iterate for loop:

While, do while, break and continue work as similarly as they work in java with few minor changes.

To add item in mutableList and iterate through it:

To sort hashSet and iterate through it:

To get value from hashMap using a key:

Here, a is the key.

Conclusion

These are just a few techniques among many for using collections in Kotlin. Make sure to check them out.

mm

Sumeet Rukeja Android Developer

I am an Android Developer at Yudiz Solutions Pvt. Ltd. - a leading Mobile App Development Company. I am passionate about developing android apps and to learn more and more about the deep sea of Android.

Leave a Reply

Top