Chapter 3

Kotlin for Everyone

IN THIS CHAPTER

check How computers, phones, and other devices run Kotlin programs

check The parts of a typical Kotlin program

You might have noticed in Chapter 2 of this minibook that Kotlin starts with a Java base but ends up doing a lot more. In fact, it borrows features from Groovy, Scala, C#, and Python as well. Kotlin and Java have many similarities, and you can still write code in Java-style, with limits. However, to realize the full potential of Kotlin, you really need to stick to Kotlin-specific methodologies, which is something that Chapter 2 brings up. Still, there is the question of just how Kotlin and Java compare when it comes to developing and executing applications, which is part of what this chapter will tell you.

Although this chapter focuses on Android development issues, you have quite a bit more to discover with Kotlin. For example, you aren’t limited to interacting with just Java. You can also interact with other language files, such as native code C/C++ files (see https://developer.android.com/studio/projects/add-native-code for details). You can also compile your code in several ways, such as by creating JavaScript output (see https://kotlinlang.org/docs/tutorials/javascript/kotlin-to-javascript/kotlin-to-javascript.html for details). ...

Get Android Application Development All-in-One For Dummies, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.