Difference between revisions of "Kotlin"

From BC$ MobileTV Wiki
Jump to: navigation, search
 
(4 intermediate revisions by the same user not shown)
Line 43: 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 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>
 
* 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>
Line 94: 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>
Line 200: Line 203:
 
* Kotlin is *Way* More Than Just Android (tech talk): https://www.infoq.com/presentations/kotlin-frameworks/
 
* 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/
 
* 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)
  
  

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