Live data from Hacker News

Android KTX: Kotlin Development for Android

android-developers.googleblog.com

51–60 of 75 posts

Re: Android KTX: Kotlin Development for Android

#51
post #32

Curious, is anyone inside of Google using Kotlin for their Android apps, or is this all for third party developers?

I heard the Android data binding compiler was written in Kotlin. At KotlinConf, they announced that Google had dropped Java altogether for writing Lint rules because of Kotlin's much greater capabilities for handling deprecated code and IDE quick fixes.

Re: Android KTX: Kotlin Development for Android

#52

> You may notice that Android KTX uses package names that begin with androidx. This is a new package name prefix that we will be using in future versions of Android Support Library. We hope the division between android.* and androidx.* makes it more obvious which APIs are bundled with the platform, and which are static libraries for app developers that work across different versions of Android. Ugh, okay. It's going…

It's worth noting that one of the great features of Kotlin is how it simplifies deprecating code and writing quick fixes. This is why Google scrapped Java for writing Lint rules entirely. I expect a simple Option-Enter may resolve these kinds of issues across an app.

https://www.youtube.com/watch?v=p8yX5-lPS6o&list=PLQ176FUIyI...

Re: Android KTX: Kotlin Development for Android

#53
post #28

Earlier quoted context omitted.

Hmm, have you used any of the Java-based autocompletion systems? - IntellJ / Android Studio autocompletion system is context aware and will only list relevant methods (which means that the list is rather short and useful for the context). Which is a stark contrast to many ctags-like autocompletion systems, which will just dump all the symbols on you and aren't very useful in my experience. Using autocompletion means…

Most of my experiences with Java were during college with Eclipse. I just remember finding it rather frustrating to have the autocomplete regularly popping up and showing me dozens of options without an easy way of learning more about em. At some point I read through the Kotlin docs and found it interesting, but didn't have any projects in mind for it. I might try my hand again along with IntelliJ / Android Studio. I…

With autocomplete open in IntelliJ, you can press F1 to view the docs for that currently highlighted autocomplete method inline. Works really well.

Re: Android KTX: Kotlin Development for Android

#54
post #37

As an alternative to learning Kotlin on Android, you can spend the time learning flutter. Then you get concise code which works on Android and IOS now and on other platforms in the future - including desktops.

And it's made by Google, unsurprinsingly. A big plus for Kotlin is that being a jetbrains project, it has top of the line intellij tooling support right at release date.

If it's made by Google, shouldn't we avoid it as it's likely to be discontinued in a few months?

Re: Android KTX: Kotlin Development for Android

#55
Laughed when I saw this Apache Groovy code slinking away at the bottom of the article:

> To start using Android KTX in your Android Kotlin projects, add the following to your app module's build.gradle file:

  repositories {
    google()
  }

  dependencies {
    // Android KTX for framework API
    implementation 'androidx.core:core-ktx:0.1'
    ...
  }

Re: Android KTX: Kotlin Development for Android

#56
post #55

Laughed when I saw this Apache Groovy code slinking away at the bottom of the article: > To start using Android KTX in your Android Kotlin projects, add the following to your app module's build.gradle file: repositories { google() } dependencies { // Android KTX for framework API implementation 'androidx.core:core-ktx:0.1' ... }

Yes - that's Gradle's language de jour right now, though there is a ton of effort being put into supporting Kotlin as an alternative scripting language for it. I think you could use it right now actually.

Re: Android KTX: Kotlin Development for Android

#57

As an alternative to learning Kotlin on Android, you can spend the time learning flutter. Then you get concise code which works on Android and IOS now and on other platforms in the future - including desktops.

I am just asking here and not contradicting, but then isn't React Native too an alternative to learning Kotlin?

Re: Android KTX: Kotlin Development for Android

#58
post #4

some examples are fine, but come on... > Uri.parse(myUriString) vs. > myUriString.toUri() I'm not sure if I would prefer the second one...

I was about to post the same thing. The first one makes way more sense to me.

It’s weird watching old things become new again.

I know C# didn’t do it first, but I’m only old enough to remember C# doing it... and watching people learn the hard way that extension methods pollute the global namespace very easily.

This would be a textbook example of what not to use extension methods for, adding a very specialized extension to a basic type where a simple static utility method would suffice.

Re: Android KTX: Kotlin Development for Android

#59
post #37

Earlier quoted context omitted.

And it's made by Google, unsurprinsingly. A big plus for Kotlin is that being a jetbrains project, it has top of the line intellij tooling support right at release date.

If it's made by Google, shouldn't we avoid it as it's likely to be discontinued in a few months?

About half of all tech on the internet today originated by google open sourcing it. Your and other google hate does not take into account the fact that many things that exist on the internet and tech is because of google I cant believe you guys are still crying about reader. Personally I think it was bad move on their part but I really don't get all the crying you guys do for something that shutdown 5 year ago.

Re: Android KTX: Kotlin Development for Android

#60
post #37

Earlier quoted context omitted.

And it's made by Google, unsurprinsingly. A big plus for Kotlin is that being a jetbrains project, it has top of the line intellij tooling support right at release date.

If it's made by Google, shouldn't we avoid it as it's likely to be discontinued in a few months?

Flutter will be official development platform for Google Fuchsia, their next big OS*. Google is supporting Android and iOS with flutter So that they can have plenty of apps available already when Fuchsia is launched.

With the big investment they are doing in Fuchsia it seem unlikely they will abandon it soon.

Post reply on HN