I have a secret code for you to crack detective! 🕵️‍♀️

originally published on https://chetangupta.net/bbk-main/

Don’t be a Java-ish dev in Kotlin-ish world, improve your knowledge about Koltin Standard Library and write better Kotlin code. ✌🏻 If your Java dev migrating to Kotlin this will help you learn alot!

Image for post
Image for post

This quiz was suggested by Rohan Singh on Twitter, sorry for the delay mate!

Question: You have received a secret message! unfortunately, you can’t just read it, it is encoded in Morse code. Your task is to implement a function that would take the morse code as input and return a…


👨🏻‍💻 How to create base-class of Activities and Fragment

Image for post
Image for post

Note this post is just one fraction of the ViewBinding Deep Dive I did on my personal blog. If you find it useful do consider checking-out the full In-depth article.

Creating BaseActivity

Usage

Creating BaseFragment

Usage

That’s it! copy these snippets and you will have ready-to-use ViewBinding Classes in your codebase.

It’s not just Another ViewBinding Article 👇🏻

TLDR: You will Learn

There are many view binding articles out now, what values does it add? after completing this one you would be familiar with these points

  • View-binding not working in all the modules? …


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…


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

Image for post
Image for post

Featured on :

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

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.


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

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…


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…


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!


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

Image for post
Image for post

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

Chetan Gupta

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