Posts tagged kotlin
-
Kotlin Multiplatform in production
What it actually takes to ship Kotlin Multiplatform across iOS and Android in a real product.
-
Fakt: Automating the Fake-over-mock pattern
Kotlin testing has a problem that gets worse the more successful your project becomes.
-
The Hidden Cost of Default Hierarchy Template in Kotlin Multiplatform
The Default Hierarchy Template in KMP projects is a great way to reduce boilerplate code and start working quickly. However, it came with an unexpected…
-
KMP-102 - Modularization in KMP
In the last article we dug into the quirks of code exported to Objective-C headers, along with the best practices for what to export…
-
KMP-102 - Optimizing Kotlin for Obj-C/Swift
In the last post, we learned how to use Kotlin code in Swift, some techniques to improve the code exported to Swift, and how annotations control its…
-
KMP-102 - Using Kotlin Code in Swift
In the last post, we learned how to create an XCFramework from Kotlin code and explored some characteristics of the generated build types.
-
KMP-102 - Characteristics of the XCFramework in KMP
In the previous post, we learned how Kotlin/Native exports a collection of .frameworks in the XCFramework format.
-
KMP-102 - XCFramework for KMP Devs
Welcome to the KMP-102 series. We dig deeper into Kotlin Multiplatform concepts, learning more about how to integrate our Kotlin code into iOS and beyond.
-
Kotlin Koans BR: Import alias
When importing a class or function, you can give it a different name by adding as NewName after the import directive. This can be useful when…
-
Kotlin Koans BR: Extension functions and properties
Implement the extension functions Int.r() and Pair.r() so they convert an Int and a Pair into a RationalNumber.
-
Kotlin Koans BR: Named arguments
Make the joinOptions() function return the list in JSON format (for example, [a, b, c]) by specifying only two arguments.
-
Kotlin Koans BR: Default arguments
Imagine you have several overloads of foo() in your favorite language. You can replace them all with a single function in Kotlin.
-
Kotlin Koans BR: Data Classes
Rewrite the following code in Kotlin, then add the data modifier. A beginner-friendly look at Kotlin classes and data classes.
-
Kotlin Koans BR: Sealed Classes
Reuse your solution from the previous task, but replace the interface with a sealed interface. That way you no longer need the else branch in the when expression.
-
Kotlin Koans BR: Lambdas
Pass a lambda to the any function to check whether the collection contains an even number.
-
Kotlin Koans BR: String Templates
The pattern below matches a date in the format 13.06.1992 (two digits, a dot, two digits, a dot, four digits):
-
Kotlin Koans BR: Hello, world!
Change the code so that the start function returns the string "OK".
-
Kotlin Koans BR: Triple-quoted strings
Swap the trimIndent call for trimMargin, setting # as the prefix value, so the resulting string no longer contains the prefix character.
-
Kotlin Koans BR: Smart casts
Rewrite the given code using Kotlin smart casts and the when expression.
-
Kotlin Koans BR: The "nothing" type (Nothing)
Specify the Nothing return type for the failWithWrongAge function.
-
Kotlin Koans BR: Nullable types
Rewrite the following code so that it uses only a single if expression, and learn how Kotlin handles nullable types safely.
-
KMP 101: Exploring internal and external dependencies in KMP (end of the series)
In previous articles, we established a foundation in Kotlin Multiplatform (KMP) and how it compiles to multiple platforms.
-
KMP 101: How to Share Code in KMP - Connecting Platforms with expect and actual
Unpacking the expect and actual keywords in Kotlin Multiplatform and the different ways they let you share code across platforms.
-
KMP 101: Learning how Gradle is used in Kotlin Multiplatform
In the last article, we created a project using the KMP Wizard and, with little effort, ran our app on Android, iOS, and Desktop.
-
KMP 101: Creating and running your first multiplatform project in Fleet
Over the last few articles we covered key KMP concepts, from the multiplatform paradigm to setting up the environment.
-
KMP 101: Understanding and Setting Up the Dev Environment in Kotlin Multiplatform
Software development is a complex process that demands not only skill and creativity, but also a well-configured development environment.
-
KMP 101: Mastering the Principles of Source Sets
In the last article, we learned about the Kotlin compiler frontend, IR, and backend. Now we dig into source sets — the key concept for writing KMP code.
-
KMP 101: Understanding How Kotlin Compiles to Multiple Platforms
In the last post (🔗 KMP 101: An Introduction to the multiplatform paradigm), we explored the multiplatform paradigm and how KMP stands out in the ecosystem.
-
KMP 101: An introduction to the multiplatform paradigm
We use a wide range of apps every day on phones, watches, TVs, and computers, all part of a broad digital ecosystem.
-
Android Plataforma - Part 0: Introducing the Series
Android development is a constant stream of new devices, SDK updates, and a flood of libraries and tools shipping every day. Here is how we tame it.
-
Android Plataforma - Part 1: Modularization
Efficiency matters in modern software projects. This article covers modularization in Kotlin/Android projects, Gradle, and the challenges of many modules.
-
Android Plataforma - Part 10: Customizing the modules
In the last article we explored CommonsExtension to remove duplication from our configuration.
-
Android Plataforma - Part 11: Building a DSL to customize the new options
In the previous article, we parameterized the arguments of applyAndroidApp() and appyAndroidLibary() with models.
-
Android Plataforma - Part 12: Optimizing build time for Android libraries
🌱 Branch: 12/improving-android-library-build-time 🔗 Repository:...
-
Android Plataforma - Part 13: Including "pure JVM" modules
In the last article we sped up Android module builds by turning off several Android Gradle Plugin (AGP) features.
-
Android Plataforma - Part 14: Opting in to experimental Kotlin compiler features
In the last article we extended our platform with the ability to declare JVM modules.
-
Android Plataforma - Part 15: Taking care of your code with Detekt, ktlint and Spotless
In the last article we covered how our platform lets different modules opt into experimental features.
-
Android Plataforma - Part 16: Final thoughts
Over the last articles, we built a platform from scratch, learning and applying concepts to make multi-module Kotlin apps more flexible and scalable.
-
Android Plataforma - Part 2: Starting the Project
In this post we explore a starter project, understand the challenges of maintaining build.gradle.kts files, and discover how Gradle Composite Builds…
-
Android Plataforma - Part 3: Sharing Gradle Scripts
In the previous article we saw the challenges of a multi-module project: maintaining and reusing Gradle files. Let us dig into how to solve that.
-
Android Plataforma - Part 4: Composite Build
In the previous articles we saw why modularity matters and why Composite Builds are the right choice for scaling Kotlin projects.
-
Android Plataforma - Part 5: Simplifying Gradle Init
In the previous article, we set up our platform with build-logic and registered the greeting task in the main project.
-
Android Plataforma - Part 6: Version Catalog
In the previous post, we optimized our platform and got it ready for more features.
-
Android Plataforma - Part 7: Decorating the 'app' module
In the previous article, we got our platform ready to take on new features.
-
Android Plataforma - Part 8: Decorating the 'library' modules
In the last post, we introduced the first decoration in the Platform and set up our entire app module using the Kotlin DSL.
-
Android Plataforma - Part 9: Unifying the Application and Library extensions with the Common Extension
In the last post, we managed to extract the configuration logic for our library modules.