We all love Kotlin, Google has chosen it as the first-class language for Android development and the ASOS Android team consider it the only language for new feature implementation.
我们都很喜欢Kotlin,Google已选择它作为Android开发的一流语言,而ASOS Android团队则认为它是唯一实现新功能的语言。
Since Kotlin is so good, it begs the question of whether we need to consider Java any more? Google has a specific page regarding the Java 8 support on Android Studio and Jake Wharton has written a useful blog piece regarding Java 8 support on Android. With the D8 desugars, Java 8 features lambda, default method and method references which are fully supported for all Android API versions. But some Java 8 features like Stream, Time etc are only supported for Android version 24+. Why do you need to consider the different support for Java 7 and Java 8 on Android if you’re using Kotlin?
由于Kotlin如此出色,这就引出了一个问题,我们是否需要再考虑Java? Google在有关Android Studio上对Java 8的支持上有专门的页面,杰克·沃顿(Jake Wharton)撰写了一篇有关Android对Java 8的支持的有用的博客文章。 借助D8 desugars,Java 8具有lambda,默认方法和方法引用,所有Android API版本都完全支持该功能。 但是某些Java 8功能(例如Stream,Time等)仅在Android 24+版本中受支持。 如果您使用的是Kotlin,为什么需要考虑对Android 7和Java 8的不同支持?
Recently we had an issue when running Kotlin collection methods on devices running below Android 24. Here’s a code snippet.
最近,在运行Android 24以下版本的设备上运行Kotlin收集方法时,我们遇到了一个问题。这是一个代码段。