Difference between revisions of "Kotlin"

From BC$ MobileTV Wiki
Jump to: navigation, search
 
(48 intermediate revisions by the same user not shown)
Line 12: Line 12:
  
 
==== Implicit Strict OO Typing ====
 
==== Implicit Strict OO Typing ====
 +
 +
* Avoiding Stringly-typed in Kotlin: https://blog.frankel.ch/avoid-stringly-typed-kotlin/
  
 
=== Null Safety ===
 
=== Null Safety ===
Line 25: Line 27:
 
* Learning Kotlin Coroutines for Android by example: https://github.com/LukasLechnerDev/Kotlin-Coroutine-Use-Cases-on-Android
 
* Learning Kotlin Coroutines for Android by example: https://github.com/LukasLechnerDev/Kotlin-Coroutine-Use-Cases-on-Android
 
* Token-Based Authentication with Retrofit + Android OAuth 2.0: https://android.jlelse.eu/token-authorization-with-retrofit-android-oauth-2-0-747995c79720
 
* Token-Based Authentication with Retrofit + Android OAuth 2.0: https://android.jlelse.eu/token-authorization-with-retrofit-android-oauth-2-0-747995c79720
 +
<ref>Kotlin Coroutines patterns & anti-patterns: https://proandroiddev.com/kotlin-coroutines-patterns-anti-patterns-f9d12984c68e</ref>
 +
<ref>Coroutines on Android - Getting the background: [https://medium.com/androiddevelopers/coroutines-on-android-part-i-getting-the-background-3e0e54d20bb Part 1] | [https://medium.com/androiddevelopers/coroutines-on-android-part-ii-getting-started-3bff117176dd Part 2] | [https://medium.com/androiddevelopers/coroutines-on-android-part-iii-real-work-2ba8a2ec2f45 Part 3]</ref>
 
<ref>Foodium - fully featured reactive app: https://github.com/PatilShreyas/Foodium (Kotlin, Coroutines, Flow, MVVM, Room, Dagger2, Coil, Moshi, Android Architecture components, Material Design/components)</ref>
 
<ref>Foodium - fully featured reactive app: https://github.com/PatilShreyas/Foodium (Kotlin, Coroutines, Flow, MVVM, Room, Dagger2, Coil, Moshi, Android Architecture components, Material Design/components)</ref>
 +
<ref>Coroutines -- simplify threading on android: https://ian-alexander.medium.com/coroutines-simplifying-android-architecture-ce0cd02b9447</ref>
 +
<ref>Room & Coroutines (for improved DB access): https://medium.com/androiddevelopers/room-coroutines-422b786dc4c5</ref>
 +
<ref>Suspending over views - How coroutines can make UI programming easier: https://medium.com/androiddevelopers/suspending-over-views-19de9ebd7020</ref>
 +
<ref>Room 🔗 Coroutines integration: https://medium.com/androiddevelopers/room-coroutines-422b786dc4c5</ref>
 +
<ref>Introducing ''kotlinx.coroutines'' 1.6.0: https://blog.jetbrains.com/kotlin/2021/12/introducing-kotlinx-coroutines-1-6-0/</ref>
  
  
Line 34: Line 43:
 
* Kotlin - sample Web-based IDE: https://try.kotlinlang.org/#/Examples/Hello,%20world!/Simplest%20version/Simplest%20version.kt
 
* Kotlin - sample Web-based IDE: https://try.kotlinlang.org/#/Examples/Hello,%20world!/Simplest%20version/Simplest%20version.kt
 
* KotlinTest: https://github.com/kotlintest/kotlintest/ (powerful, elegant and flexible [[Kotlin]] test framework)
 
* KotlinTest: https://github.com/kotlintest/kotlintest/ (powerful, elegant and flexible [[Kotlin]] test framework)
 +
* Introducing Kotlin Build Reports: https://blog.jetbrains.com/kotlin/2022/06/introducing-kotlin-build-reports/
 +
* Jetpack Compose (for Desktop): https://www.jetbrains.com/lp/compose/ | [https://github.com/jetbrains/compose-jb SRC]<ref>Jetpack Compose -- Kotlin - "Falling Balls" timing game (Desktop): https://github.com/JetBrains/compose-jb/tree/master/examples/falling_balls</ref>
 +
* Jetpack Compose (for Web): https://compose-web.ui.pages.jetbrains.team/ | [https://github.com/JetBrains/compose-jb/tree/master/examples/web_landing SRC]<ref>Jetpack Compose -- Kotlin - "Falling Balls" timing game (Web): https://github.com/JetBrains/compose-jb/tree/master/examples/falling_balls_with_web | [https://falling-balls.ui.pages.jetbrains.team/ DEMO]</ref>
 +
<ref>Technology Preview: Jetpack Compose for Web: https://blog.jetbrains.com/kotlin/2021/05/technology-preview-jetpack-compose-for-web/</ref>
 +
<ref>Jetbrains previews "Jetpack Compose" (Kotlin) for Web: https://www.infoq.com/news/2021/05/jetpack-compose-web-tech-preview/</ref>
  
  
Line 39: Line 53:
  
 
* '''Kotlin: https://play.kotlinlang.org/koans/''' | [https://play.kotlinlang.org/koans/Introduction/Named%20arguments/Task.kt EXAMPLE] | [https://kotlinlang.org/docs/kotlin-docs.pdf DOCS]'''<ref>Kotlin tutorials: https://kotlinlang.org/docs/tutorials/</ref>
 
* '''Kotlin: https://play.kotlinlang.org/koans/''' | [https://play.kotlinlang.org/koans/Introduction/Named%20arguments/Task.kt EXAMPLE] | [https://kotlinlang.org/docs/kotlin-docs.pdf DOCS]'''<ref>Kotlin tutorials: https://kotlinlang.org/docs/tutorials/</ref>
 +
* Get started with Kotlin: https://kotlinlang.org/docs/getting-started.html
 
* Mastering Kotlin standard functions ''run'', ''with'', ''let'', ''also'' and ''apply'': http://medium.com/@elye.project/mastering-kotlin-standard-functions-run-with-let-also-and-apply-9cd334b0ef84
 
* Mastering Kotlin standard functions ''run'', ''with'', ''let'', ''also'' and ''apply'': http://medium.com/@elye.project/mastering-kotlin-standard-functions-run-with-let-also-and-apply-9cd334b0ef84
* Kotlin in Action (BOOK): https://www.manning.com/books/kotlin-in-action
+
* Udacity -- Developing Android Apps with Kotlin (E-LEARNING COURSE): https://www.udacity.com/course/developing-android-apps-with-kotlin--ud9012
 +
* Udacity -- Advanced Android with Kotlin (E-LEARNING COURSE): https://www.udacity.com/course/advanced-android-with-kotlin--ud940
 +
 
 +
* Manning -- Kotlin in Action (BOOK): https://www.manning.com/books/kotlin-in-action
 
* Packt -- Mastering Kotlin (BOOK): http://www.packtpub.com/application-development/mastering-kotlin | [https://github.com/PacktPublishing/Mastering-Kotlin. SRC]
 
* Packt -- Mastering Kotlin (BOOK): http://www.packtpub.com/application-development/mastering-kotlin | [https://github.com/PacktPublishing/Mastering-Kotlin. SRC]
 
* Packt -- Learn Kotlin programming (BOOK): https://www.packtpub.com/application-development/learn-kotlin-programming-second-edition?utm_source=github&utm_medium=repository&utm_campaign=9781789802351 | [https://github.com/PacktPublishing/Learn-Kotlin-Programming SRC]
 
* Packt -- Learn Kotlin programming (BOOK): https://www.packtpub.com/application-development/learn-kotlin-programming-second-edition?utm_source=github&utm_medium=repository&utm_campaign=9781789802351 | [https://github.com/PacktPublishing/Learn-Kotlin-Programming SRC]
Line 48: Line 66:
 
* Packt -- Mastering Android Development with Kotlin (BOOK): https://www.packtpub.com/application-development/mastering-android-development-kotlin | [https://github.com/PacktPublishing/Mastering-Kotlin-for-Android-Development SRC]
 
* Packt -- Mastering Android Development with Kotlin (BOOK): https://www.packtpub.com/application-development/mastering-android-development-kotlin | [https://github.com/PacktPublishing/Mastering-Kotlin-for-Android-Development SRC]
 
* Kotlin for Android App Development (BOOK): https://kotlinandroidbook.com | [https://github.com/petersommerhoff/kotlin-for-android-app-development SRC]
 
* Kotlin for Android App Development (BOOK): https://kotlinandroidbook.com | [https://github.com/petersommerhoff/kotlin-for-android-app-development SRC]
 +
* O'Reilly -- Java to Kotlin (BOOK): https://www.oreilly.com/library/view/java-to-kotlin/9781492082262/
 +
* LeanPub -- Kotlin Coroutines (BOOK): https://leanpub.com/coroutines
 +
 +
* Kotlin official docs -- Java-Kotlin interoperabiltiy: https://kotlinlang.org/docs/reference/java-to-kotlin-interop.html
 +
* Calling Java code from Kotlin: https://medium.com/kayvan-kaseb/calling-java-codes-from-kotlin-b74890fb4a78
 +
<ref>Compose Multiplatform 1.0 is going live!: https://blog.jetbrains.com/kotlin/2021/12/compose-multiplatform-1-0-is-going-live/</ref>
  
 
* Kotlin DSL for runtime permissions: https://android.jlelse.eu/kotlin-dsl-for-runtime-permissions-ba04dbe0de2c | [ SRC] (helper library in Kotlin to request permissions programmatically, with built-in callbacks)<ref>Eazy permissions -- An introduction to the runtime permission library: https://proandroiddev.com/eazy-permissions-c574809bd682</ref>
 
* Kotlin DSL for runtime permissions: https://android.jlelse.eu/kotlin-dsl-for-runtime-permissions-ba04dbe0de2c | [ SRC] (helper library in Kotlin to request permissions programmatically, with built-in callbacks)<ref>Eazy permissions -- An introduction to the runtime permission library: https://proandroiddev.com/eazy-permissions-c574809bd682</ref>
Line 63: Line 87:
 
* The Ultimate Tutorial -- Getting Started With Kotlin: https://iwillteachyoukotlin.com/ultimate-tutorial-getting-started-with-kotlin/
 
* The Ultimate Tutorial -- Getting Started With Kotlin: https://iwillteachyoukotlin.com/ultimate-tutorial-getting-started-with-kotlin/
 
* How Kotlin’s “@Deprecated” Relieves Pain of Colossal Refactoring?: https://hackernoon.com/how-kotlins-deprecated-relieves-pain-of-colossal-refactoring-8577545aaed<ref>''@MerryAnnotation'' — Your First Annotation Processor in Kotlin Android: https://android.jlelse.eu/merryannotation-your-first-annotation-processor-in-kotlin-android-eb3af4ab3402</ref>
 
* How Kotlin’s “@Deprecated” Relieves Pain of Colossal Refactoring?: https://hackernoon.com/how-kotlins-deprecated-relieves-pain-of-colossal-refactoring-8577545aaed<ref>''@MerryAnnotation'' — Your First Annotation Processor in Kotlin Android: https://android.jlelse.eu/merryannotation-your-first-annotation-processor-in-kotlin-android-eb3af4ab3402</ref>
 
* Best Practices for Unit Testing in Kotlin: https://phauer.com/2018/best-practices-unit-testing-kotlin/
 
* TDD an Android UI with Fast Tests: http://blog.code-cop.org/2020/07/tdd-ui-with-fast-ui-tests.html
 
* Learn Kotlin Through Unit Tests: https://medium.com/androiddevelopers/learn-kotlin-through-unit-tests-914106d2d8c5
 
  
 
* Android Room using Kotlin: https://android.jlelse.eu/android-room-using-kotlin-f6cc0a05bf23
 
* Android Room using Kotlin: https://android.jlelse.eu/android-room-using-kotlin-f6cc0a05bf23
Line 75: Line 95:
 
* Improve (dynamically loaded) RecyclerView Performance (Kotlin example): https://blog.usejournal.com/improve-recyclerview-performance-ede5cec6c5bf
 
* Improve (dynamically loaded) RecyclerView Performance (Kotlin example): https://blog.usejournal.com/improve-recyclerview-performance-ede5cec6c5bf
  
* Loading local web content on Android (in Kotlin): https://hellsoft.se/loading-local-web-content-on-android-80ea09cd748b | [https://gist.github.com/ErikHellman/3d131596a8d6a10eb78c418a64281cf5 SRC] (example of creating an in-code lightweight local file/zip archive content "WebServer" for secure dynamic content)<ref>How to manage a complex DeepLinks scheme on your Android App: https://android.jlelse.eu/how-to-manage-a-complex-deeplinks-scheme-on-your-android-app-d441143cec7e</ref><ref>Experimenting with Ktor HTTP clients in idiomatic Kotlin: https://medium.com/default-to-open/experimenting-with-ktor-5c8c1bf78d72</ref>
+
* Loading local web content on Android (in Kotlin): https://hellsoft.se/loading-local-web-content-on-android-80ea09cd748b | [https://gist.github.com/ErikHellman/3d131596a8d6a10eb78c418a64281cf5 SRC] (example of creating an in-code lightweight local file/zip archive content "WebServer" for secure dynamic content)<ref>How to manage a complex DeepLinks scheme on your Android App: https://android.jlelse.eu/how-to-manage-a-complex-deeplinks-scheme-on-your-android-app-d441143cec7e</ref><ref>Experimenting with Ktor HTTP clients in idiomatic Kotlin: https://medium.com/default-to-open/experimenting-with-ktor-5c8c1bf78d72</ref><ref>Getting Started With RSocket (via Ktor add-on) in Kotlin: https://dzone.com/articles/getting-started-with-rsocket-kotlin</ref>
 
* Kotlin AsyncTask + JSON Parser Example for Android: https://galleonsoft.com/kotlin-json-parser-example-for-android/ | [https://github.com/galleonsoft/JSONParser SRC]
 
* Kotlin AsyncTask + JSON Parser Example for Android: https://galleonsoft.com/kotlin-json-parser-example-for-android/ | [https://github.com/galleonsoft/JSONParser SRC]
 
* Kotlin + MVP + Dagger 2 + Retrofit = Sample Android application: https://medium.com/mindorks/kotlin-mvp-dagger-2-retrofit-sample-android-application-e6fe3af7acd | [https://github.com/ogulcan/kotlin-mvp-dagger2 SRC]
 
* Kotlin + MVP + Dagger 2 + Retrofit = Sample Android application: https://medium.com/mindorks/kotlin-mvp-dagger-2-retrofit-sample-android-application-e6fe3af7acd | [https://github.com/ogulcan/kotlin-mvp-dagger2 SRC]
 +
* Custom Count Up Timer: https://stackoverflow.com/questions/35064262/custom-count-up-timer | [https://github.com/AKJAW/Timi-Multiplatform/tree/stopwatch-article-part1 SRC]
 +
* How to create a simple countdown timer in Kotlin?: https://stackoverflow.com/questions/54095875/how-to-create-a-simple-countdown-timer-in-kotlin<ref>Android CountDownTimer - additional milliseconds delay between ticks: https://stackoverflow.com/questions/12762272/android-countdowntimer-additional-milliseconds-delay-between-ticks</ref>
  
 
* Kotlin Coroutines -- Bottom up tutorial: https://www.infoq.com/articles/kotlin-coroutines-bottom-up/<ref>Advanced Kotlin Coroutines tips and tricks: https://proandroiddev.com/coroutines-snags-6bf6fb53a3d1</ref><ref>Simplify asynchronous programming with Kotlin’s coroutines: https://www.androidauthority.com/kotlin-coroutines-asynchronous-programming-858566/</ref><ref>Why your class probably shouldn’t implement ''CoroutineScope'': https://proandroiddev.com/why-your-class-probably-shouldnt-implement-coroutinescope-eb34f722e510</ref><ref>'''Android Networking in 2019 — Retrofit with Kotlin’s Coroutines (TMDB API example): https://android.jlelse.eu/android-networking-in-2019-retrofit-with-kotlins-coroutines-aefe82c4d777 | [https://github.com/navi25/RetrofitKotlinDeferred SRC]'''</ref>
 
* Kotlin Coroutines -- Bottom up tutorial: https://www.infoq.com/articles/kotlin-coroutines-bottom-up/<ref>Advanced Kotlin Coroutines tips and tricks: https://proandroiddev.com/coroutines-snags-6bf6fb53a3d1</ref><ref>Simplify asynchronous programming with Kotlin’s coroutines: https://www.androidauthority.com/kotlin-coroutines-asynchronous-programming-858566/</ref><ref>Why your class probably shouldn’t implement ''CoroutineScope'': https://proandroiddev.com/why-your-class-probably-shouldnt-implement-coroutinescope-eb34f722e510</ref><ref>'''Android Networking in 2019 — Retrofit with Kotlin’s Coroutines (TMDB API example): https://android.jlelse.eu/android-networking-in-2019-retrofit-with-kotlins-coroutines-aefe82c4d777 | [https://github.com/navi25/RetrofitKotlinDeferred SRC]'''</ref>
* Unit Testing Coroutines on Android: https://www.ericdecanini.com/2020/04/06/unit-testing-coroutines-on-android/
 
 
* Kotlin + MVVM + Databinding + Coroutines + Unit Tests: https://medium.com/@anibal.bastias/kotlin-mvvm-coroutines-unit-tests-95ec75197149
 
* Kotlin + MVVM + Databinding + Coroutines + Unit Tests: https://medium.com/@anibal.bastias/kotlin-mvvm-coroutines-unit-tests-95ec75197149
 +
* Android Architecture starring Kotlin Coroutines, Jetpack (MVVM, Room, Paging), Retrofit and Dagger 2: https://proandroiddev.com/android-architecture-starring-kotlin-coroutines-jetpack-mvvm-room-paging-retrofit-and-dagger-7749b2bae5f7 | [https://github.com/Eli-Fox/LEGO-Catalog SRC]
 +
<ref>'''Unit Testing Coroutines on Android: https://www.ericdecanini.com/2020/04/06/unit-testing-coroutines-on-android/'''</ref>
  
 
* How to Load an Image URL to Carousel View Using Picasso in Kotlin: https://www.c-sharpcorner.com/article/how-to-load-the-imageurl-to-carousel-view-like-e-commerce-app-using-picasso-in-k/
 
* How to Load an Image URL to Carousel View Using Picasso in Kotlin: https://www.c-sharpcorner.com/article/how-to-load-the-imageurl-to-carousel-view-like-e-commerce-app-using-picasso-in-k/
Line 87: Line 110:
 
* Create an Android Camera App using Kotlin: https://android.jlelse.eu/create-an-android-camera-app-using-kotlin-459543cec5a7 | [https://github.com/TannerGabriel/Blog/tree/master/Camera SRC]
 
* Create an Android Camera App using Kotlin: https://android.jlelse.eu/create-an-android-camera-app-using-kotlin-459543cec5a7 | [https://github.com/TannerGabriel/Blog/tree/master/Camera SRC]
 
* Create an Android Sound Recorder using Kotlin: https://android.jlelse.eu/create-an-android-sound-recorder-using-kotlin-36902b3bf967 | [https://github.com/TannerGabriel/android-sound-recorder SRC]
 
* Create an Android Sound Recorder using Kotlin: https://android.jlelse.eu/create-an-android-sound-recorder-using-kotlin-36902b3bf967 | [https://github.com/TannerGabriel/android-sound-recorder SRC]
 +
* Upload an Image or File to Your Server Using Volley in Kotlin: https://medium.com/better-programming/how-to-upload-an-image-file-to-your-server-using-volley-in-kotlin-a-step-by-step-tutorial-23f3c0603ec2
 +
 +
* Effective migration to Kotlin on Android: https://medium.com/android-news/effective-migration-to-kotlin-on-android-cfb92bfaa49b (with dependency injection & annotation replacement examples)
 +
* Kotlin’s “internal” Visibility Modifier and Java Interoperability: https://4comprehension.com/kotlins-internal-visibility-modifier-and-java-interoperability/
 +
* Kotlin - Type conversion with adapters: https://www.mscharhag.com/kotlin/type-conversion-with-adapters (similar method to Sling ''adaptTo'' now available)
 +
* Kotlin dependency injection with Koin: https://www.mscharhag.com/kotlin/dependency-injection-koin
 +
 +
* Best Practices of Using JPA (Hibernate) With Kotlin: https://dzone.com/articles/bets-practices-of-using-jpa-with-kotlin?edition=683391
 +
* Working with Kotlin and JPA: https://www.baeldung.com/kotlin/jpa
 +
* Defining JPA/Hibernate Entities in Kotlin: https://medium.com/swlh/defining-jpa-hibernate-entities-in-kotlin-1ff8ee470805
 +
<ref>Hibernate with Kotlin - powered by Spring Boot: https://kotlinexpertise.com/hibernate-with-kotlin-spring-boot/</ref>
 +
<ref>Getting Started with Spring Data JPA in Kotlin: https://www.section.io/engineering-education/introduction-spring-data/</ref>
 +
<ref>Should I use Kotlin data class as JPA entity?: https://stackoverflow.com/questions/58127353/should-i-use-kotlin-data-class-as-jpa-entity</ref>
 +
 +
* Best Practices for Unit Testing in Kotlin: https://phauer.com/2018/best-practices-unit-testing-kotlin/
 +
* TDD an Android UI with Fast Tests: http://blog.code-cop.org/2020/07/tdd-ui-with-fast-ui-tests.html
 +
* Learn Kotlin Through Unit Tests: https://medium.com/androiddevelopers/learn-kotlin-through-unit-tests-914106d2d8c5
 +
* Kotlin Unit Tests with Parameters: https://proandroiddev.com/kotlin-unit-tests-with-parameters-e37aab2b36f6
 +
<ref>Getting Started Unit Testing with Kotlin : https://spin.atomicobject.com/2018/10/07/kotlin-unit-testing/</ref>
 +
<ref>KotlinConf 2018 - Best Practices for Unit Testing in Kotlin by Philipp Hauer: https://phauer.com/2018/best-practices-unit-testing-kotlin/ | [https://resources.jetbrains.com/storage/products/kotlinconf2018/slides/4_Best%20Practices%20for%20Unit%20Testing%20in%20Kotlin.pdf SLIDES] | [https://www.youtube.com/watch?v=RX_g65J14H0 VIDEO]</ref>
 +
<ref>kotest: https://kotest.io/ | [https://github.com/kotest/kotest SRC] | [https://kotest.io/docs/quickstart DOCS]</ref>
 +
<ref>kotlin.test (JUnit 5 integrations): https://kotlinlang.org/api/latest/kotlin.test/</ref>
 +
<ref>MockK: https://mockk.io (mocking library for Kotlin)</ref>
 +
<ref>Testing Quarkus with Kotlin, JUnit5 & MockK: https://www.novatec-gmbh.de/en/blog/testing-quarkus-with-kotlin-junit-and-mockk/</ref>
 +
<ref>Unit Testing Firebase with Kotlin: https://blog.kotlin-academy.com/unit-testing-firebase-with-kotlin-85ae7205d3ef</ref>
 +
<ref>Why my date formatters test fails in CI and passes locally?: https://kotlintesting.com/why-my-date-formatters-test-fails-in-ci/</ref>
 +
<ref>Nested Kotlin tests with Junit5: https://kotlintesting.com/nested-tests-in-junit5/</ref>
 +
<ref>Parameterized tests with Kotest: https://kotlintesting.com/kotest-parameterized/</ref>
 +
<ref>An attempt to unit test generated DataBinding code: https://kotlintesting.com/testing-generated-databinding-code/</ref>
 +
<ref>Testing Retrofit calls with OkHttp MockWebServer: https://kotlintesting.com/testing-retrofit-calls/</ref>
  
 
* Android Accessibility — Resolving common Talkback issues: https://medium.com/android-microsoft/android-accessibility-resolving-common-talkback-issues-3c45076bcdf6
 
* Android Accessibility — Resolving common Talkback issues: https://medium.com/android-microsoft/android-accessibility-resolving-common-talkback-issues-3c45076bcdf6
 +
* All You Need to Know about Android Navigation Component: https://medium.com/swlh/all-you-need-to-know-about-android-navigation-component-96778b4f471c
 +
* Android JetPack - Navigation Architecture Component now Kotlin-first too: https://medium.com/deemaze-software/android-jetpack-navigation-architecture-component-b603c9a8100c
 
* Transitions in Android Navigation Component (in Kotlin): https://medium.com/@serbelga/shared-elements-in-android-navigation-architecture-component-bc5e7922ecdf
 
* Transitions in Android Navigation Component (in Kotlin): https://medium.com/@serbelga/shared-elements-in-android-navigation-architecture-component-bc5e7922ecdf
 
* Android Architecture Components for Dummies in Kotlin (50 lines of code): https://medium.com/@elye.project/android-architecture-components-for-dummies-in-kotlin-50-lines-of-code-29b29d3a381
 
* Android Architecture Components for Dummies in Kotlin (50 lines of code): https://medium.com/@elye.project/android-architecture-components-for-dummies-in-kotlin-50-lines-of-code-29b29d3a381
Line 94: Line 149:
 
* A Tutorial on Building a Splash Screen with Kotlin in Android Studio: https://levelup.gitconnected.com/a-tutorial-on-building-a-splash-screen-with-kotlin-in-android-studio-dc647cd52f9b
 
* A Tutorial on Building a Splash Screen with Kotlin in Android Studio: https://levelup.gitconnected.com/a-tutorial-on-building-a-splash-screen-with-kotlin-in-android-studio-dc647cd52f9b
 
* Netflix Android and iOS Studio Apps — now powered by Kotlin Multiplatform: https://netflixtechblog.com/netflix-android-and-ios-studio-apps-kotlin-multiplatform-d6d4d8d25d23
 
* Netflix Android and iOS Studio Apps — now powered by Kotlin Multiplatform: https://netflixtechblog.com/netflix-android-and-ios-studio-apps-kotlin-multiplatform-d6d4d8d25d23
 +
* RSS Reading In Kotlin - Easy Android Programming: https://medium.com/swlh/rss-reading-in-kotlin-easy-android-programming-bebefd12f65d
 +
 +
* Kotlin & Domain-Driven Design (DDD) -- Value Objects: https://dev.to/flbenz/kotlin-and-domain-driven-design-value-objects-4m32
 +
* Setting text in EditText with Kotlin: https://stackoverflow.com/questions/44493908/setting-text-in-edittext-kotlin
 +
* How to get a numeric value from EditText in Kotlin: https://inducesmile.com/kotlin-source-code/how-to-get-a-numeric-value-from-edittext-in-kotlin/<ref>Convert String obtained from EditText to Integer in Kotlin language: https://stackoverflow.com/questions/44841940/convert-string-obtained-from-edittext-to-integer-in-kotlin-language</ref>
 +
* Android Button Example [OnClick|Color|Design] in Kotlin: https://tutorial.eyehunts.com/android/android-button-example-onclickcolordesign-kotlin/
 +
* Toying with Kotlin's ''context receivers'': https://blog.frankel.ch/kotlin-context-receivers/
 +
 +
* Ki is a New, More Flexible Kotlin Interactive Shell: https://www.infoq.com/news/2021/04/ki-kotlin-interactive-shell/
 +
* Complex UI/Animations on Android: https://proandroiddev.com/complex-ui-animation-on-android-8f7a46f4aec4
 +
* Inline functions — under the hood: https://medium.com/androiddevelopers/inline-functions-under-the-hood-12ddcc0b3a56
 +
* Deploying a Kotlin App to Heroku: https://dzone.com/articles/deploying-a-kotlin-app-to-heroku
 +
<ref>A Kotlin Time DSL for Java 8 Time: https://jworks.io/a-kotlin-time-dsl-for-java-8-time/</ref>
  
  
Line 108: Line 176:
 
<ref>Digging into D8 and R8: https://jakewharton.com/digging-into-d8-and-r8/</ref>
 
<ref>Digging into D8 and R8: https://jakewharton.com/digging-into-d8-and-r8/</ref>
 
<ref>Why and how I switched to Kotlin: https://android.jlelse.eu/why-and-how-i-switched-to-kotlin-503460bbfcf</ref>
 
<ref>Why and how I switched to Kotlin: https://android.jlelse.eu/why-and-how-i-switched-to-kotlin-503460bbfcf</ref>
<ref>Modern Android development with Kotlin (series): [https://proandroiddev.com/modern-android-development-with-kotlin-september-2017-part-1-f976483f7bd6 Part 1] | [https://proandroiddev.com/modern-android-development-with-kotlin-september-2017-part-2-17444fcdbe86 Part 2]</ref>
+
<ref>'''Modern Android development with Kotlin (series): [https://proandroiddev.com/modern-android-development-with-kotlin-september-2017-part-1-f976483f7bd6 Part 1] | [https://proandroiddev.com/modern-android-development-with-kotlin-september-2017-part-2-17444fcdbe86 Part 2] | [https://proandroiddev.com/modern-android-development-with-kotlin-part-3-8721fb843d1b Part 3] | [https://proandroiddev.com/modern-android-development-with-kotlin-part-4-4ac18e9868cb Part 4]'''</ref>
 
<ref>What do 17 Google Developers Experts for Android think about Kotlin?: https://antonioleiva.com/google-kotlin/</ref>
 
<ref>What do 17 Google Developers Experts for Android think about Kotlin?: https://antonioleiva.com/google-kotlin/</ref>
 
<ref>Digging into D8 and R8: https://jakewharton.com/digging-into-d8-and-r8/</ref>
 
<ref>Digging into D8 and R8: https://jakewharton.com/digging-into-d8-and-r8/</ref>
Line 119: Line 187:
 
* 7 Quick Kotlin Tips for Android Developers: https://medium.com/better-programming/7-quick-kotlin-tips-for-android-developers-884d1021ab1d
 
* 7 Quick Kotlin Tips for Android Developers: https://medium.com/better-programming/7-quick-kotlin-tips-for-android-developers-884d1021ab1d
 
* Kotlin-Series — Object Declaration & Companion Objects in Kotlin: https://android.jlelse.eu/kotlin-series-object-declaration-companion-objects-in-kotlin-543596f3fa1f
 
* Kotlin-Series — Object Declaration & Companion Objects in Kotlin: https://android.jlelse.eu/kotlin-series-object-declaration-companion-objects-in-kotlin-543596f3fa1f
 +
* Kotlin has Nothing but there is nothing like Nothing in Java: https://medium.com/thoughts-overflow/kotlin-has-nothing-but-there-is-nothing-like-nothing-in-java-cab98e4f4d26
 +
* Common Code-Smells in Kotlin: https://android.jlelse.eu/common-code-smells-in-kotlin-57684429e9e
 +
* Advocating against (some) Kotlin expressions: https://proandroiddev.com/advocating-against-kotlin-expressions-73acfa819ca7
 +
* How Kotlin helps you avoid memory leaks: https://proandroiddev.com/how-kotlin-helps-you-avoid-memory-leaks-e2680cf6e71e
 +
* Zero-cost abstractions in Kotlin (inline classes): https://medium.com/androiddevelopers/zero-cost-abstractions-in-kotlin-19b953f3a936
 +
* Enhanced Streams Processing with Kotlin’s Sequence Interface: https://www.infoq.com/articles/enhanced-stream-kotlin-sequence/ (as an alternative to Java's ''Stream'' interface)
 +
* Improve app stability with Firebase Crashlytics and Kotlin: https://firebase.googleblog.com/2021/02/improve-app-stability-with-firebase-crashlytics-and-kotlin.html
 +
* The Road to Kotlin 1.5: https://www.infoq.com/news/2021/03/the-road-to-kotlin-1-5/ (support for Java records using ''@JvmRecord'' annotation, Gradle 5.4+ support, Gradle configuration cache support, and others)
 +
* Kotlin 1.5.0 – the First Big Release of 2021: https://blog.jetbrains.com/kotlin/2021/05/kotlin-1-5-0-released/
 +
* Google continues to grow with Kotlin: https://sdtimes.com/softwaredev/google-continues-to-grow-with-kotlin/
 +
* Nine Highlights from the Kotlin Roadmap: https://blog.jetbrains.com/kotlin/2021/05/nine-highlights-from-the-kotlin-roadmap/
 +
* Migrating From Python to Kotlin for Our Backend Services: https://doordash.engineering/2021/05/04/migrating-from-python-to-kotlin-for-our-backend-services/
 +
* Is Your Kotlin Code Really Obfuscated?: https://proandroiddev.com/is-your-kotlin-code-really-obfuscated-a36abf033dde (ProGuard usage with Kotlin)
 +
* Kotlin and FaaS, an impossible union?: https://blog.frankel.ch/kotlin-faas-impossible-union/
 +
* Kotlin is *Way* More Than Just Android (tech talk): https://www.infoq.com/presentations/kotlin-frameworks/
 +
* Kotlin 1.7.0 now available with alpha version of K2 compiler: https://sdtimes.com/softwaredev/kotlin-1-7-0-now-available-with-alpha-version-of-k2-compiler/
 +
* 4 features a long-time Java dev missed after switching to Kotlin for a while then coming back to Java: https://blog.frankel.ch/miss-in-java-kotlin-developer/ (commonly praised Kotlin features not yet available in Java: immutable references, null safety, extension functions, and reified generics)
  
  
Line 127: Line 212:
 
== See Also ==
 
== See Also ==
  
[[Java]] | [[JSP]] | [[JavaFX]] | [[J2ME]] | [[Android]] | [[Groovy]] | [[Scala]] | [[Dart]]
+
[[Java]] | [[JSP]] | [[JavaFX]] | [[J2ME]] | [[Android]] | [[Groovy]] | [[Scala]] | [[Dart]] | [[Flutter]]

Latest revision as of 08:25, 3 August 2022

Kotlin Logo

Kotlin is a statically-typed programming language that runs on the Java Virtual Machine (JVM).


Features

Condensed Syntax

First-class Functional

Implicit Strict OO Typing

Null Safety

[1] [2] [3] [4]

Co-Routines

[5] [6] [7] [8] [9] [10] [11] [12]


Tools

[15] [16]


Resources

[18]


Tutorials

[30]

[31] [32] [33]

[34] [35] [36] [37] [38] [39] [40] [41] [42] [43] [44] [45]

[47]


External Links

[51] [52] [53] [54] [55] [56]


References

  1. Kotlin vs Java -- Most Important Differences That You Must Know in 2019: https://hackr.io/blog/kotlin-vs-java
  2. Why Kotlin language, Android? Why did Google choose Kotlin ?: https://apiumhub.com/tech-blog-barcelona/kotlin-language/
  3. Why did Google replace Java with Kotlin, and why only Kotlin but not other languages?: https://www.quora.com/Why-did-Google-replace-Java-with-Kotlin-and-why-only-Kotlin-but-not-other-languages
  4. Nothing (Else) Matters in Kotlin: https://quiro.dev/posts/nothing-else-matters-kotlin/
  5. Kotlin Coroutines patterns & anti-patterns: https://proandroiddev.com/kotlin-coroutines-patterns-anti-patterns-f9d12984c68e
  6. Coroutines on Android - Getting the background: Part 1 | Part 2 | Part 3
  7. Foodium - fully featured reactive app: https://github.com/PatilShreyas/Foodium (Kotlin, Coroutines, Flow, MVVM, Room, Dagger2, Coil, Moshi, Android Architecture components, Material Design/components)
  8. Coroutines -- simplify threading on android: https://ian-alexander.medium.com/coroutines-simplifying-android-architecture-ce0cd02b9447
  9. Room & Coroutines (for improved DB access): https://medium.com/androiddevelopers/room-coroutines-422b786dc4c5
  10. Suspending over views - How coroutines can make UI programming easier: https://medium.com/androiddevelopers/suspending-over-views-19de9ebd7020
  11. Room 🔗 Coroutines integration: https://medium.com/androiddevelopers/room-coroutines-422b786dc4c5
  12. Introducing kotlinx.coroutines 1.6.0: https://blog.jetbrains.com/kotlin/2021/12/introducing-kotlinx-coroutines-1-6-0/
  13. Jetpack Compose -- Kotlin - "Falling Balls" timing game (Desktop): https://github.com/JetBrains/compose-jb/tree/master/examples/falling_balls
  14. Jetpack Compose -- Kotlin - "Falling Balls" timing game (Web): https://github.com/JetBrains/compose-jb/tree/master/examples/falling_balls_with_web | DEMO
  15. Technology Preview: Jetpack Compose for Web: https://blog.jetbrains.com/kotlin/2021/05/technology-preview-jetpack-compose-for-web/
  16. Jetbrains previews "Jetpack Compose" (Kotlin) for Web: https://www.infoq.com/news/2021/05/jetpack-compose-web-tech-preview/
  17. Kotlin tutorials: https://kotlinlang.org/docs/tutorials/
  18. Compose Multiplatform 1.0 is going live!: https://blog.jetbrains.com/kotlin/2021/12/compose-multiplatform-1-0-is-going-live/
  19. Eazy permissions -- An introduction to the runtime permission library: https://proandroiddev.com/eazy-permissions-c574809bd682
  20. Create Carousel Easily in Android App with CarouselView: https://medium.com/@lobothijau/create-carousel-easily-in-android-app-with-carouselview-6cbf5ef500a9 | SRC (alternative carouselview lib)
  21. @MerryAnnotation — Your First Annotation Processor in Kotlin Android: https://android.jlelse.eu/merryannotation-your-first-annotation-processor-in-kotlin-android-eb3af4ab3402
  22. How to manage a complex DeepLinks scheme on your Android App: https://android.jlelse.eu/how-to-manage-a-complex-deeplinks-scheme-on-your-android-app-d441143cec7e
  23. Experimenting with Ktor HTTP clients in idiomatic Kotlin: https://medium.com/default-to-open/experimenting-with-ktor-5c8c1bf78d72
  24. Getting Started With RSocket (via Ktor add-on) in Kotlin: https://dzone.com/articles/getting-started-with-rsocket-kotlin
  25. Android CountDownTimer - additional milliseconds delay between ticks: https://stackoverflow.com/questions/12762272/android-countdowntimer-additional-milliseconds-delay-between-ticks
  26. Advanced Kotlin Coroutines tips and tricks: https://proandroiddev.com/coroutines-snags-6bf6fb53a3d1
  27. Simplify asynchronous programming with Kotlin’s coroutines: https://www.androidauthority.com/kotlin-coroutines-asynchronous-programming-858566/
  28. Why your class probably shouldn’t implement CoroutineScope: https://proandroiddev.com/why-your-class-probably-shouldnt-implement-coroutinescope-eb34f722e510
  29. Android Networking in 2019 — Retrofit with Kotlin’s Coroutines (TMDB API example): https://android.jlelse.eu/android-networking-in-2019-retrofit-with-kotlins-coroutines-aefe82c4d777 | SRC
  30. Unit Testing Coroutines on Android: https://www.ericdecanini.com/2020/04/06/unit-testing-coroutines-on-android/
  31. Hibernate with Kotlin - powered by Spring Boot: https://kotlinexpertise.com/hibernate-with-kotlin-spring-boot/
  32. Getting Started with Spring Data JPA in Kotlin: https://www.section.io/engineering-education/introduction-spring-data/
  33. Should I use Kotlin data class as JPA entity?: https://stackoverflow.com/questions/58127353/should-i-use-kotlin-data-class-as-jpa-entity
  34. Getting Started Unit Testing with Kotlin : https://spin.atomicobject.com/2018/10/07/kotlin-unit-testing/
  35. KotlinConf 2018 - Best Practices for Unit Testing in Kotlin by Philipp Hauer: https://phauer.com/2018/best-practices-unit-testing-kotlin/ | SLIDES | VIDEO
  36. kotest: https://kotest.io/ | SRC | DOCS
  37. kotlin.test (JUnit 5 integrations): https://kotlinlang.org/api/latest/kotlin.test/
  38. MockK: https://mockk.io (mocking library for Kotlin)
  39. Testing Quarkus with Kotlin, JUnit5 & MockK: https://www.novatec-gmbh.de/en/blog/testing-quarkus-with-kotlin-junit-and-mockk/
  40. Unit Testing Firebase with Kotlin: https://blog.kotlin-academy.com/unit-testing-firebase-with-kotlin-85ae7205d3ef
  41. Why my date formatters test fails in CI and passes locally?: https://kotlintesting.com/why-my-date-formatters-test-fails-in-ci/
  42. Nested Kotlin tests with Junit5: https://kotlintesting.com/nested-tests-in-junit5/
  43. Parameterized tests with Kotest: https://kotlintesting.com/kotest-parameterized/
  44. An attempt to unit test generated DataBinding code: https://kotlintesting.com/testing-generated-databinding-code/
  45. Testing Retrofit calls with OkHttp MockWebServer: https://kotlintesting.com/testing-retrofit-calls/
  46. Convert String obtained from EditText to Integer in Kotlin language: https://stackoverflow.com/questions/44841940/convert-string-obtained-from-edittext-to-integer-in-kotlin-language
  47. A Kotlin Time DSL for Java 8 Time: https://jworks.io/a-kotlin-time-dsl-for-java-8-time/
  48. Google suggests using Kotlin programming language to build a new Android app: https://www.techworm.net/2019/05/kotlin-google-programming-language-android-apps.html
  49. Why did Google replace Java with Kotlin, and why only Kotlin but not other languages?: https://www.quora.com/Why-did-Google-replace-Java-with-Kotlin-and-why-only-Kotlin-but-not-other-languages
  50. Kotlin is now Google’s preferred language for Android app development: https://techcrunch.com/2019/05/07/kotlin-is-now-googles-preferred-language-for-android-app-development/
  51. Why starting a new Android project with Java is a bad idea: https://medium.com/snapp-mobile/why-starting-a-new-android-project-with-java-is-a-bad-idea-359bffe0bbd6
  52. Digging into D8 and R8: https://jakewharton.com/digging-into-d8-and-r8/
  53. Why and how I switched to Kotlin: https://android.jlelse.eu/why-and-how-i-switched-to-kotlin-503460bbfcf
  54. Modern Android development with Kotlin (series): Part 1 | Part 2 | Part 3 | Part 4
  55. What do 17 Google Developers Experts for Android think about Kotlin?: https://antonioleiva.com/google-kotlin/
  56. Digging into D8 and R8: https://jakewharton.com/digging-into-d8-and-r8/

See Also

Java | JSP | JavaFX | J2ME | Android | Groovy | Scala | Dart | Flutter