#kotlintip search results
Kotlin generic types; <T> = type and object definition should be the same class <in T> = type definition should be same or subclass of object definition <out T> = object definition should be the same or subclass of type definition #Kotlin #KotlinTip #Android #AndroidDev
Make your unit tests much more readable with Kotlin infix functions. #Kotlin #KotlinTip #Android #AndroidDev
#KotlinTip: When using two classes with the same name from different packages in the same file, use import alias to refer to these classes by their aliases. #AndroidDev
Being more readable with the failure message, but use it carefully `trimIndent()` #KotlinTip #Kotlin
#KotlinTip #Kotlin Nested class v. Inner class Nested class - Use it for modularity, clean and readable code Inner class - Use it when the child wants to hold the reference of its parent class
#KotlinTip💡 - If you're using multiple try-catch statements then code might be confusing🙆. - With kotlin Higher order function you can minimize it😉. - You'll just need to put your code which might throw exception under that block🔥. - See image below👇. #Kotlin #AndroidDev
Kotlin Tip: Avoid NumberFormatException when converting a String to an Int using toIntOrNull() instead of toInt(). #Kotlin #KotlinTip #AndroidDev #100DaysOfCode
Posted this a few days ago as a #KotlinTip only to realize that everyone has mixed opinions about which one they prefer. The question now is: Which one would you use and why Solution 2? 👀 #AndroidDev
Change coroutine context with flowOn operation. It does not effect downStream. #Kotlin #KotlinTip #KotlinCoroutine #Flow
📣 Kotlin Tip 📣 Deshazte del NullPointerException. En Kotlin por defecto todo objeto no es nulo, si deseas que soporte nulos, debes declararlo explícitamente, una vez hagas eso y quieres acceder a ese objeto, Kotlin te mandará un error para la validación. #KotlinTip #AndroidDev
💡Did you know that there's a method named `windowed` which returns a list of snapshots sliding along with the collection? 😮 Thanks to @sebi_io. Got this from his AoC repo 😅 ➡️ Docs: kotlinlang.org/api/latest/jvm… #KotlinTip
💡#KotlinTip - Use `runCatching()` instead of using normal try-catch if you want any data which throw an exception. - It provides `getOrNull()`, `getOrDefault()`, `getOrElse()` functions. #Kotlin #KotlinDev #AndroidDev
Kotlin Tip: When using two classes with the same name from different packages, use import alias to refer to these classes by their aliases. #AndroidDev #Kotlin #KotlinTip
#KotlinTip💡 - buildString{} is an inline function in #Kotlin that provides StringBuilder as a lambda receiver scope (this) and let us build String based on conditions at runtime!🏃 - Finally, it returns a String🚀 - See this example 👇 #androiddev #idiomatic #simple #coding
🚨 What is 𝘊𝘰𝘮𝘱𝘢𝘯𝘪𝘰𝘯 𝘖𝘣𝘫𝘦𝘤𝘵? #kotlin #kotlintip The creators of Kotlin did not want to use Java's 𝘴𝘵𝘢𝘵𝘪𝘤 concept directly, but in order to maintain compatibility with Java, they provided a construct called 𝘤𝘰𝘮𝘱𝘢𝘯𝘪𝘰𝘯 𝘰𝘣𝘫𝘦𝘤𝘵. (short thread🧵👇)
Little trick in #Kotlin that really made my day when I discovered it: ✅ A cleaner way to update key-values in a map: #androiddev #kotlintip
🚀 #KotlinTip: Choose your Coroutine Dispatcher wisely! Default: CPU-intensive work IO: Network or disk operations Main: UI updates Optimize your code with the right dispatcher! 💡 #Kotlin #AndroidDev
Kotlin Tip: When using two classes with the same name from different packages, use import alias to refer to these classes by their aliases. #AndroidDev #Kotlin #KotlinTip
Kotlin Tip: Use the joinToString function to join elements of a collection with a separator, instead of using the StringBuilder class #AndroidDev #Kotlin #KotlinTip
Kotlin Tip: When using two classes with the same name from different packages, use import alias to refer to these classes by their aliases. #AndroidDev #Kotlin #KotlinTip #100DaysOfCode
Kotlin Tip: Avoid NumberFormatException when converting a String to an Int using toIntOrNull() instead of toInt(). #Kotlin #KotlinTip #AndroidDev #100DaysOfCode
Measuring time taken by a function to execute with measureTimedValue youtu.be/j_LEcry7Pms #Kotlin #kotlintip
youtube.com
YouTube
Calculate Your Code Performance | Kotlin Tips 2023
💡Did you know that there's a method named `windowed` which returns a list of snapshots sliding along with the collection? 😮 Thanks to @sebi_io. Got this from his AoC repo 😅 ➡️ Docs: kotlinlang.org/api/latest/jvm… #KotlinTip
Change coroutine context with flowOn operation. It does not effect downStream. #Kotlin #KotlinTip #KotlinCoroutine #Flow
With Junit5, ParameterizedTest annotation is a great way to test your function multiple times with different parameters. For more information: junit.org/junit5/docs/cu… #Kotlin #KotlinTip #Android #AndroidDev #Junit
Make your unit tests much more readable with Kotlin infix functions. #Kotlin #KotlinTip #Android #AndroidDev
Kotlin generic types; <T> = type and object definition should be the same class <in T> = type definition should be same or subclass of object definition <out T> = object definition should be the same or subclass of type definition #Kotlin #KotlinTip #Android #AndroidDev
#KotlinTip💡 - buildString{} is an inline function in #Kotlin that provides StringBuilder as a lambda receiver scope (this) and let us build String based on conditions at runtime!🏃 - Finally, it returns a String🚀 - See this example 👇 #androiddev #idiomatic #simple #coding
#KotlinTip #Kotlin Nested class v. Inner class Nested class - Use it for modularity, clean and readable code Inner class - Use it when the child wants to hold the reference of its parent class
Being more readable with the failure message, but use it carefully `trimIndent()` #KotlinTip #Kotlin
#KotlinTip: When using two classes with the same name from different packages in the same file, use import alias to refer to these classes by their aliases. #AndroidDev
#KotlinTip #Kotlin Nested class v. Inner class Nested class - Use it for modularity, clean and readable code Inner class - Use it when the child wants to hold the reference of its parent class
Make your unit tests much more readable with Kotlin infix functions. #Kotlin #KotlinTip #Android #AndroidDev
Kotlin generic types; <T> = type and object definition should be the same class <in T> = type definition should be same or subclass of object definition <out T> = object definition should be the same or subclass of type definition #Kotlin #KotlinTip #Android #AndroidDev
Posted this a few days ago as a #KotlinTip only to realize that everyone has mixed opinions about which one they prefer. The question now is: Which one would you use and why Solution 2? 👀 #AndroidDev
Change coroutine context with flowOn operation. It does not effect downStream. #Kotlin #KotlinTip #KotlinCoroutine #Flow
Kotlin Tip: Avoid NumberFormatException when converting a String to an Int using toIntOrNull() instead of toInt(). #Kotlin #KotlinTip #AndroidDev #100DaysOfCode
📣 Kotlin Tip 📣 Deshazte del NullPointerException. En Kotlin por defecto todo objeto no es nulo, si deseas que soporte nulos, debes declararlo explícitamente, una vez hagas eso y quieres acceder a ese objeto, Kotlin te mandará un error para la validación. #KotlinTip #AndroidDev
Di adiós al ; (punto y coma), por defecto en Kotlin no existe, pero aún puedes utilizarlo si estas acostumbrad@ y no te dará ningún tipo de error. Iniciamos con los "tips" diarios. #KotlinTip #Kotlin #MiraMiCodigo
#KotlinTip💡 - If you're using multiple try-catch statements then code might be confusing🙆. - With kotlin Higher order function you can minimize it😉. - You'll just need to put your code which might throw exception under that block🔥. - See image below👇. #Kotlin #AndroidDev
In Kotlin If you wanted to return two/three values from a function ? It can be accomplish by Pairs/Triple class , you just have to use it as a return type. We can use destructuring to split a Pair/Triple into two/three values: #31DaysOfKotlin #Kotlin #kotlintip #AndroidDev
💡 #KotlinTip - Serialization-Deserialization #Utillities 👉 By using @Square's #Moshi, you can create simple extension utility for converting the model to JSON and vice versa. 🤨It's pretty simple as below👇. #Kotlin #AndroidDev @kotlin @KotlinWeekly
#KotlinTip💡 - buildString{} is an inline function in #Kotlin that provides StringBuilder as a lambda receiver scope (this) and let us build String based on conditions at runtime!🏃 - Finally, it returns a String🚀 - See this example 👇 #androiddev #idiomatic #simple #coding
Kotlin Tip: Use the joinToString function to join elements of a collection with a separator, instead of using the StringBuilder class #AndroidDev #Kotlin #KotlinTip
Something went wrong.
Something went wrong.
United States Trends
- 1. rUSD N/A
- 2. #DMDCHARITY2025 871K posts
- 3. #TusksUp N/A
- 4. #AEWDynamite 21K posts
- 5. #TheChallenge41 2,230 posts
- 6. Diddy 74.8K posts
- 7. #Survivor49 2,938 posts
- 8. Earl Campbell 2,126 posts
- 9. seokjin 160K posts
- 10. Free Tina 14K posts
- 11. Yeremi N/A
- 12. Steve Cropper 6,782 posts
- 13. Jamal Murray 7,590 posts
- 14. Monkey Wards N/A
- 15. Milo 12.7K posts
- 16. Californians 6,674 posts
- 17. Metroid Prime 4 12.3K posts
- 18. Ryan Nembhard 3,874 posts
- 19. fnaf 2 17K posts
- 20. Rizo N/A