#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

mertceyhan's tweet image. Kotlin generic types;

&amp;lt;T&amp;gt; = type and object definition should be the same class

&amp;lt;in T&amp;gt; = type definition should be same or subclass of object definition

&amp;lt;out T&amp;gt; = object definition should be the same or subclass of type definition

#Kotlin #KotlinTip #Android #AndroidDev
mertceyhan's tweet image. Kotlin generic types;

&amp;lt;T&amp;gt; = type and object definition should be the same class

&amp;lt;in T&amp;gt; = type definition should be same or subclass of object definition

&amp;lt;out T&amp;gt; = object definition should be the same or subclass of type definition

#Kotlin #KotlinTip #Android #AndroidDev
mertceyhan's tweet image. Kotlin generic types;

&amp;lt;T&amp;gt; = type and object definition should be the same class

&amp;lt;in T&amp;gt; = type definition should be same or subclass of object definition

&amp;lt;out T&amp;gt; = 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

mertceyhan's tweet image. 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

waseefakhtar's tweet image. #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

Use DSL feature to make your code readable #Kotlin #KotlinTip #Android

eneszorr's tweet image. Use DSL feature to make your code readable
#Kotlin #KotlinTip #Android

Being more readable with the failure message, but use it carefully `trimIndent()` #KotlinTip #Kotlin

akshay81844's tweet image. 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

imShreyasPatil's tweet image. #KotlinTip💡
- If you&apos;re using multiple try-catch statements then code might be confusing🙆.
- With kotlin Higher order function you can minimize it😉. 
- You&apos;ll just need to put your code which might throw exception under that block🔥.
- See image below👇.

#Kotlin #AndroidDev
imShreyasPatil's tweet image. #KotlinTip💡
- If you&apos;re using multiple try-catch statements then code might be confusing🙆.
- With kotlin Higher order function you can minimize it😉. 
- You&apos;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

waseefakhtar's tweet image. 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

waseefakhtar's tweet image. 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

Get rid of if statement to check exception case. #Kotlin #KotlinTip #Android

eneszorr's tweet image. Get rid of if statement to check exception case. #Kotlin #KotlinTip #Android

¿Conoces la función Coerce de Kotlin? #KotlinTip


Change coroutine context with flowOn operation. It does not effect downStream. #Kotlin #KotlinTip #KotlinCoroutine #Flow

eneszorr's tweet image. 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

MiraMiCodigo's tweet image. 📣 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

theapache64's tweet image. 💡Did you know that there&apos;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

imShreyasPatil's tweet image. 💡#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

waseefakhtar's tweet image. 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

imShreyasPatil's tweet image. #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

¿Conoces la función Coerce de Kotlin? #KotlinTip


🚨 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

waleska404's tweet image. 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

jnrvans's tweet image. 🚀 #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
jnrvans's tweet image. 🚀 #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
jnrvans's tweet image. 🚀 #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

waseefakhtar's tweet image. 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

waseefakhtar's tweet image. 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

waseefakhtar's tweet image. 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

waseefakhtar's tweet image. Kotlin Tip:

Avoid NumberFormatException when converting a String to an Int using toIntOrNull() instead of toInt(). 

 #Kotlin #KotlinTip #AndroidDev #100DaysOfCode

💡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

theapache64's tweet image. 💡Did you know that there&apos;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

eneszorr's tweet image. Change coroutine context with flowOn operation. It does not effect downStream.

#Kotlin #KotlinTip #KotlinCoroutine #Flow

Use DSL feature to make your code readable #Kotlin #KotlinTip #Android

eneszorr's tweet image. Use DSL feature to make your code readable
#Kotlin #KotlinTip #Android

Get rid of if statement to check exception case. #Kotlin #KotlinTip #Android

eneszorr's tweet image. Get rid of if statement to check exception case. #Kotlin #KotlinTip #Android

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

mertceyhan's tweet image. 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
mertceyhan's tweet image. 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

mertceyhan's tweet image. 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

mertceyhan's tweet image. Kotlin generic types;

&amp;lt;T&amp;gt; = type and object definition should be the same class

&amp;lt;in T&amp;gt; = type definition should be same or subclass of object definition

&amp;lt;out T&amp;gt; = object definition should be the same or subclass of type definition

#Kotlin #KotlinTip #Android #AndroidDev
mertceyhan's tweet image. Kotlin generic types;

&amp;lt;T&amp;gt; = type and object definition should be the same class

&amp;lt;in T&amp;gt; = type definition should be same or subclass of object definition

&amp;lt;out T&amp;gt; = object definition should be the same or subclass of type definition

#Kotlin #KotlinTip #Android #AndroidDev
mertceyhan's tweet image. Kotlin generic types;

&amp;lt;T&amp;gt; = type and object definition should be the same class

&amp;lt;in T&amp;gt; = type definition should be same or subclass of object definition

&amp;lt;out T&amp;gt; = 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

imShreyasPatil's tweet image. #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


No results for "#kotlintip"

Being more readable with the failure message, but use it carefully `trimIndent()` #KotlinTip #Kotlin

akshay81844's tweet image. 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

waseefakhtar's tweet image. #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


Use DSL feature to make your code readable #Kotlin #KotlinTip #Android

eneszorr's tweet image. Use DSL feature to make your code readable
#Kotlin #KotlinTip #Android

Make your unit tests much more readable with Kotlin infix functions. #Kotlin #KotlinTip #Android #AndroidDev

mertceyhan's tweet image. 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

mertceyhan's tweet image. Kotlin generic types;

&amp;lt;T&amp;gt; = type and object definition should be the same class

&amp;lt;in T&amp;gt; = type definition should be same or subclass of object definition

&amp;lt;out T&amp;gt; = object definition should be the same or subclass of type definition

#Kotlin #KotlinTip #Android #AndroidDev
mertceyhan's tweet image. Kotlin generic types;

&amp;lt;T&amp;gt; = type and object definition should be the same class

&amp;lt;in T&amp;gt; = type definition should be same or subclass of object definition

&amp;lt;out T&amp;gt; = object definition should be the same or subclass of type definition

#Kotlin #KotlinTip #Android #AndroidDev
mertceyhan's tweet image. Kotlin generic types;

&amp;lt;T&amp;gt; = type and object definition should be the same class

&amp;lt;in T&amp;gt; = type definition should be same or subclass of object definition

&amp;lt;out T&amp;gt; = object definition should be the same or subclass of type definition

#Kotlin #KotlinTip #Android #AndroidDev

Get rid of if statement to check exception case. #Kotlin #KotlinTip #Android

eneszorr's tweet image. Get rid of if statement to check exception case. #Kotlin #KotlinTip #Android

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

waseefakhtar's tweet image. 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

eneszorr's tweet image. 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

waseefakhtar's tweet image. 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

MiraMiCodigo's tweet image. 📣 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

MiraMiCodigo's tweet image. 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 &quot;tips&quot; 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

imShreyasPatil's tweet image. #KotlinTip💡
- If you&apos;re using multiple try-catch statements then code might be confusing🙆.
- With kotlin Higher order function you can minimize it😉. 
- You&apos;ll just need to put your code which might throw exception under that block🔥.
- See image below👇.

#Kotlin #AndroidDev
imShreyasPatil's tweet image. #KotlinTip💡
- If you&apos;re using multiple try-catch statements then code might be confusing🙆.
- With kotlin Higher order function you can minimize it😉. 
- You&apos;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

burhanrashid52's tweet image. 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

imShreyasPatil's tweet image. 💡 #KotlinTip - Serialization-Deserialization #Utillities

👉 By using @Square&apos;s #Moshi, you can create simple extension utility for converting the model to JSON and vice versa. 

🤨It&apos;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

imShreyasPatil's tweet image. #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

waseefakhtar's tweet image. Kotlin Tip:

Use the joinToString function to join elements of a collection with a separator, instead of using the StringBuilder class

#AndroidDev #Kotlin #KotlinTip

Loading...

Something went wrong.


Something went wrong.


United States Trends