Live data from Hacker News

Android now supports Kotlin

venturebeat.com

221–225 of 225 posts

Re: Android now supports Kotlin

#221
post #92

"To get started with Kotlin, download the Android Studio 3.0 preview, open one of your existing Java files, and then choose “Convert Java File to Kotlin File” in the Code menu." You do not have to install a preview version of Android Studio, you can install the kotlin plugin in whatever version of AS you're using now. The change in AS 3.0 is simply that it will ship the plugin by default.

It doesn't need to be a preview version of AS. I'm coding with Kotlin on AS 2.3.1 and IntelliJ 16. Just make sure you configure kotlin for the project, easily done, by creating a kotlin file.

That's what I said =)

Re: Android now supports Kotlin

#222
post #70

What does it mean being "supported", given that one already can use Kotlin on Android?

Well, if you work in a more conservative company, you can use this as a way to get the "powers that be" to allow the use of Kotlin. It's basically an endorsement of the language by a company that everyone has heard of.

It's not just conservative companies, but also independent developers and startups that may not want to start investigating third-party languages, of which there's no shortage. Particularly if they're up against other barriers like not being experienced at Android, in which case they may not want to learn the Android frameworks AND a new language at once. Or they have to learn some new Android frameworks they didn't use before, like the camera APIs.

Re: Android now supports Kotlin

#223

Earlier quoted context omitted.

Out of interest, what is wrong with Java? I found writing Android apps easy enough using Java. I am from a C++ background, so find all the C# and Java that I have to write quite simple, so I'd be intrigued to know what was "wrong" with Java. Is it worth me looking into Kotlin? I am already halfway through investigating Swift so it seems the endless task of keeping up to date with new languages for each platform (keep…

There's nothing wrong with Java. It's outdated language by today's standards, a lot of code which takes 100 lines in Java would take 50 lines in Kotlin (and if we'll take autogenerated boilerplate getters/setters, it could be 1000->50), but overall Java is fine. But I still suggest you to look into Kotlin. If you know Java, you won't spend much time learning it and with awesome IDE support you can be productive in ve…

Can you elaborate on how Kotlin maintain compatibility with Java?

Re: Android now supports Kotlin

#224

Earlier quoted context omitted.

There's nothing wrong with Java. It's outdated language by today's standards, a lot of code which takes 100 lines in Java would take 50 lines in Kotlin (and if we'll take autogenerated boilerplate getters/setters, it could be 1000->50), but overall Java is fine. But I still suggest you to look into Kotlin. If you know Java, you won't spend much time learning it and with awesome IDE support you can be productive in ve…

Can you elaborate on how Kotlin maintain compatibility with Java?

Kotlin can just import and use any Java class. Kotlin doesn't introduce new strings or collections, so conversions of any kind are not required. Also Kotlin compiles to Java classes which can be used from Java without any problems too.

Re: Android now supports Kotlin

#225

Earlier quoted context omitted.

Can you elaborate on how Kotlin maintain compatibility with Java?

Kotlin can just import and use any Java class. Kotlin doesn't introduce new strings or collections, so conversions of any kind are not required. Also Kotlin compiles to Java classes which can be used from Java without any problems too.

So, Kotlin and Java are fully inter-operable without any feature loss?
Post reply on HN