The future of Kotlin Android Extensions

Hallo Friends cellphone prices and specifications, In the article that you are reading this time with the title The future of Kotlin Android Extensions, we have prepared this article well for you to read and take the information in it. hopefully the contents of the post Article Android Developers Blog, Article IFTTT, what we write you can understand. all right, have a nice reading..

Posted by David Winer, Product Manager

The Android Kotlin Extensions Gradle plugin (not to be confused with Android KTX) was released in 2017 and brought two new conveniences to Android development in Kotlin:

  • Synthetics let you replace calls to findViewById with kotlinx.android.synthetic bindings.
  • Parcelize allows you to remove boilerplate and easily create Parcelables through the @Parcelize annotation.

Since then, we have released View Binding for Android, an officially supported library that has deep integration with the Android build toolchain and provides similar functionality as Kotlin synthetics. While we continue to recommend Parcelize, a number of drawbacks have appeared with using Kotlin synthetics:

  • They pollute the global namespace
  • They don’t expose nullability information
  • They only work in Kotlin code

JetBrains originally developed the Android Kotlin Extensions plugin, and together we have discussed the pros and cons of continuing to maintain synthetics: we strive to ensure long term support for APIs where we can but want to guide developers towards best practices that make for healthy codebases and, ultimately, happy users.

Over the course of the next year, our teams will be jointly deprecating synthetics in favor of continuing to support our recommended option, View Binding. Here’s what that means:

  • If you are using Parcelize, you can continue to use the same annotations and APIs. The annotation package will change to kotlinx.parcelize, however, and In your module-level Gradle file, you should start using the standalone kotlin-parcelize plugin instead of android-kotlin-extensions. You’ll be able to find documentation for Parcelize on the Android developer documentation site.
  • If you are using Android Kotlin synthetics, you should migrate to View Binding. Check out our migration guide for more details.

The deprecation period starts with Kotlin 1.4.20, released today. android-kotlin-extensions will be removed in a future Kotlin release during or after September 2021. Long term, we will continue to maintain the kotlin-parcelize plugin, and you can continue to file issues on Parcelize in the Android Studio issue tracker.



from Android Developers Blog https://ift.tt/3kZQtqd
via IFTTT

Thus the article The future of Kotlin Android Extensions

Enough of the articles The future of Kotlin Android Extensions this time, hopefully it can be of benefit to all of you. well, see you in another article post.


You are now reading the article The future of Kotlin Android Extensions By address link https://cellphone-prices-and-specifications.blogspot.com/2020/11/the-future-of-kotlin-android-extensions.html


Previous
Next Post »
0 Komentar untuk "The future of Kotlin Android Extensions"

Terima Kasih Sudah Berkomentar