Kotlin code – Devstyler.io https://devstyler.io News for developers from tech to lifestyle Wed, 30 Jun 2021 16:27:56 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.5 Kotlin Gains Java Coding Enhancements https://devstyler.io/blog/2021/06/30/kotlin-gains-java-coding-enhancements/ Wed, 30 Jun 2021 16:27:56 +0000 https://devstyler.io/?p=56998 ...]]> With the Kotlin 1.5.20 update, the JetBrains-developed Kotlin language gets preliminary backing for the Lombok Java library, which is intended to make coding easier, along with JSpecify Java nullness capabilities.

Released June 23, Kotlin 1.5.20 has experimental support for calling Lombok-generated methods. The addition of the Lombok compiler plug-in allows the generation of Lombok declarations in Java by Kotlin code in the same mixed Java/Kotlin module. The Lombok library plugs into an editor and builds tools and works to reduce the need to write boilerplate code with capabilities such as automation of logging variables.

Kotlin 1.5.20 also has experimental support for JSpecify, which provides standard Java annotations for static analysis. A unified set of Java nullness annotations is featured in JSpecify, providing more nullability information to help Kotlin maintain null safety when interoperating with Java.

Instructions on installing Kotlin 1.5.20 can be found at blog.jetbrains.com. Here are all other capabilities in Kotlin 1.5.20:

  • For Gradle, parallel execution of Kotlin tasks is now fully controlled by the Gradle parallel execution mechanism while the kotlin.parallel.tasks.in.project property has been deprecated. Also for Gradle, Kotlin 1.5.20 implements experimental caching of annotation processors’ classloaders in kapt, to speed up kapt for consecutive Gradle runs in some cases.
  • The Kotlin/Native compiler now can export documentation comments from Kotlin code to Objective-C frameworks. This experimental support also works for the Swift language.
  • Work continues on stabilizing the Kotlin/JS IR back end. A migration guide is offered to assist with migrating to the new JavaScript back end.
  • The standard library is LowerCase() and is UpperCase() now provide the same result on all platforms by checking all characters, not just letters. Also, digit ToInt() now supports all Unicode digit characters for all Kotlin platforms, including the JVM, native, and JavaScript.
]]>
What’s New for Android Developers at Google I/O https://devstyler.io/blog/2021/05/19/what-s-new-for-android-developers-at-google-i-o/ Wed, 19 May 2021 07:21:06 +0000 https://devstyler.io/?p=51526 ...]]> Google is dedicated to providing a more modern Android development experience with new improvements, major updates, and new releases announced across the platform at this year’s Google I/O conference. 

According to Karen Ng, product lead for Android developer tools, the announcements focus on how to help developers build higher-quality apps faster and easier.

“We want to help you build higher-quality apps faster, and we want that to scale across the entire ecosystem, not as a small set, but we’re really thinking about the tools and APIs that help you do that.”

The main Android announcements from the conference included:

Jetpack Compose 1.0 release

The company revealed version 1.0 of its toolkit for building native UI is expected in July. The toolkit is built with Kotlin, and designed to make it easier to build native apps across the Android platform. The release is expected to incorporate the update of Material You with new Material components and support for large screens.

Android Studio Arctic Fox (2020.3.1) beta 

The beta version of the latest release is available and designed to help developers build high-quality applications faster by improving Kotlin build speeds, typing latency and test results across multiple different test devices. The latest update of the Android IDE focuses on accelerating UI design, extending apps to new devices and boosting developer productivity.

Kotlin updates

Kotlin Symbol Processing is an API for parsing Kotlin code and improving speed. According to the company, more than 1.2 million applications in the Google Play store now use the programming language Kotlin.

Android Jetpack improvements

New features include the alpha version of Jetpack Microbenchmark, which captures large interactions that impact application startup and enable developers to improve app performance; and the beta of DataStore, a new Kotlin coroutines API for persistent data.

Updates to WearOS

The company said it is making milestones with its wearable Android development with a new unified platform built with Samsung; a new consumer experience; and new health and fitness services from Fitbit coming to the platform.

Large screens enhancements

Ng commented:

“Everyone wants their application to be good quality and they want to be able to do that from the Android platform easily and not deal with all the specific challenges. If you take a look at some of the things that we’re releasing, they are going to be around app performance so how do I have my app be super performant across things. We are looking at addressing those pain points as well, but that’s the promise…help you focus on what your app does well and where your magic is.”

Google announced new APIs and tools to optimize the viewing experience, resize content automatically, and enable new navigation components.

]]>