Curious how Kotlin resolve the Java platform’s map?

Most of the Kotlin developers are migrated from the Java environment, they are pretty well versed with uses-cases and application of Collection Framework in the Java platform, but applying the same knowledge in a Kotlin codebase isn’t guaranteed to work always. You could end up with a spaghetti codebase base having a long trailing function and making hacks to achieve a functionality that could easily be solved using Kotlin’s standard functions easily. Kotlin stdlib which offers generic interfaces, classes, and functions for creating, populating, and managing Collections of any type.

In Today’s article, we will try to understand how Kotlin catered to Java Maps in his its colors. Disclaimer This article is specific to Kotlin JVM as collection implementation varies with the platform you are targeting in Kotlin. I’m Chetan Gupta, I do tech stuff, don’t forget to checkout from personal blogs from AndroidBites, without any delays, Let’s get started. …

Learn pure Kotlin DI then migrate it to HILT or Dagger.

Image for post
Image for post

Dagger is one of the popular frameworks that has been known for Dependency Injection (DI) for Java and Android platforms. It’s in most of the Android projects whether small or large, developers tend to start off with the basic scaffold of Dagger just not to deal with the huge boilerplate or to avoid huge migration of adding it later to the project. …

List to String is very crucial operation that you need to know if you’re into competitive programming.

Image for post
Image for post
Kotlin | Join to String

to learn more advance operations such as truncating string, performing transformations, adding a prefix and suffix, and much more that can be done on the `joinToString()` follow up the companion article.

Image for post
Image for post
https://chetangupta.net

https://chetangupta.net/list-to-string

see you on the other side 😈, Happy Hacking! 👩‍💻

Even been confused or keep forgetting which is called first init blocks or constructors? Never again keep reading…

Hi #androidDevs, This is Androidbites where I try to break down a small concept into an understandable code snippet and share my learning experience with it.

Today we are discussing init blocks, here is a little challenge for you guys, let's see if you could guess the correct out! if you can guess the right output you get a Candy,

Image for post
Image for post

if you don’t know then, don’t worry grab your headphones and put on lofi music and read thought my article from below…👇💻

See you on the other side 😈
Happy #Hacking!💻

safely handling position even when data members are re-positioned!

Hi #androidDevs, This is Androidbites where I try to break down a small concept into an understandable code snippet and share my learning experience with it.

As per my previous article, I discussed how destructuring is limited in kotlin in case you missed it go through the following link.

Today snippet tells about the place where you should never use destructuring. 👁 on the code 💻👇

Image for post
Image for post
kotlin | destructing limitation

You must be wondering then what should be the ideal place when we should be using it or even to use for not, to figure that out and more in-depth explanation with example follow the article below.

see you on the other side 😈

Happy Hacking!

Follow me:
LinkedIn : https://bit.ly/ch8n-linkdIn
Medium : https://bit.ly/ch8n-medium
Twitter: https://bit.ly/ch8n-twitter
StackOverflow : https://bit.ly/ch8n-stackOflow
CodeWars : https://bit.ly/ch8n-codewar
Portfolio : https://bit.ly/ch8n-home
Github : https://bit.ly/ch8n-git
Instagram : https://bit.ly/ch8n-insta
Youtube: https://bit.ly/ch8n-youtube

lateinit vs nullable type, is lateinit actually the answer to your nullable type issues.

Hi #androidDevs, This is Androidbites where I try to break down a small concept into an understandable code snippet and share my learning experience with it.

Today’s topic is related to handling nullability using lateinit modifier, I absolutely agree `null` is the Billion dollar problem in a programming language, and for you, as a developer, it’s your responsibility that your app doesn't fall in as a victim of it and not crash your app due to that, In kotlin there are many languages functionalists build in that enable you to aware of null happening code and ask you to cater them properly. …

Image for post
Image for post

Hi developer, Welcome to AndroidBites, here I take a small snippet of code and try to showcase an example to cover a concept.

Today we are touching Kotlin Destructuring, a way to unpack parameters and members. a neat example is in the snippet!

Image for post
Image for post

but before you go all-in with this feature make sure you know these limitations:

Happy Hacking 💻!

Follow me:
LinkedIn : https://bit.ly/ch8n-linkdIn
Medium : https://bit.ly/ch8n-medium
Twitter: https://bit.ly/ch8n-twitter
StackOverflow : https://bit.ly/ch8n-stackOflow
CodeWars : https://bit.ly/ch8n-codewar
Portfolio : https://bit.ly/ch8n-home
Github : https://bit.ly/ch8n-git
Instagram : https://bit.ly/ch8n-insta
Youtube: https://bit.ly/ch8n-youtube

An elegant way of error handling using expressions and null-handing

Image for post
Image for post
tryOrNull | Androidbites | Kotlin

Taking inspiration from getOrNull type function in Kotlin, I ended up creating this extension which has helped me out in multiple cases, Specially dealings with JsonParsing .

Highly recommend the following extended explanation of how this extension work, Do checkout and stay tuned for more content.

Happy Hacking!

follow me on social media :
LinkedIn : https://bit.ly/ch8n-linkdIn
Medium: https://bit.ly/ch8n-medium
Twitter: https://bit.ly/ch8n-twitter
Blog: https://chetangupta.net
Github: https://bit.ly/ch8n-git
Youtube: https://bit.ly/ch8n-youtube

Let's explore what is the meaning of functions as first-class citizen in Kotlin

Image for post
Image for post

Hi! Welcome to my ongoing series of AndroidBites where we discuss bite-size information on some core concepts of programming, Today we are exploring some fun in the functions of Kotlin,

Kotlin has functions as a first-class citizen if you're wondering what that means then it's simply a function is primitive type in kotlin, which means it can be stored into variables and data structures, passed as arguments to and returned from other functions, i.e support for Higher-Order Functions.

Structure of a function

Image for post
Image for post
basic structure of a function

A function consists of some components :

  1. fun as keyword to declare the start of the function. …

Image for post
Image for post

Hello everyone! this is a small series I’m starting on Android Development where I will try to break down the small core programming concepts into key points and bite-size snippets which you can use to brush up your concepts!

Keep learning and Happy Hacking!

In Android, we have lots of mechanisms to start off an asynchronous task.

Threads and Runnables, HandlerThreads / Eventloop — MessageQueue, Executors, and ThreadPoolExecutor, Loaders, and AsyncLoaders , Async Task , Futures , Rxjava , Coroutines and many more…

Most of you would be going with Rxjava and Coroutines but knowing all other concepts will help you appreciate newer frameworks more, also they are important for interviews. …

About

Chetan Garg

Coding enthusiast! love Android #kotlinAlltheWay, want to explore all opportunity around it! CodingMantra: #cleanCoder #TDD #SOLID #designpatterns

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store