Blog

Below you will find pages that utilize the term “Blog”
August 14, 2020
Native Android text sharing to particular app in Unity

In the previous blogs Native Android text sharing in Unity and Native Android image sharing in Unity we learnt about how to share some text or screenshot to other apps in a Unity app targeting Android platforms. In this post will target sharing the same text or image to some particular app directly.

April 27, 2020
Kotlin apply function

In continuation to my previous post where I explained about Kotlin let function, let’s try to understand today about apply function today.

April 22, 2020
Collections in Kotlin

Collections are a common concept for most programming languages. It is a way of storing similar data types in a single object and iterate over it. Similar to any other language, Kotlin also has Collection defined in kotlin.collections package.

March 29, 2020
Partial class in C# (partial modifier)

Think about a situation where two or more developers need to modify the same class or add new functionalities to the same class. Or assume they need to implement interfaces to the same class. There will be a merge conflict which needs to be resolved manually or using some tool.

March 3, 2020
Destructuring Declarations in Kotlin

We all know about three classes Any, Unit and Nothing in Kotlin which have their own functionality and use cases but we usually confuse between the differences among them and when to use what.

February 29, 2020
Why let function is an Extension to Template class?

After reading my last blog about Kotlin let function, a lot of developers have asked me about, why let is an extension to Template class but not to Any class?

February 25, 2020
Kotlin let function

Kotlin has made our life very easy by providing features like extension functions, nullability check and much more. One such kind of really helpful feature is Scope functions. Once you understand what scope functions are, you will not able to resist yourself from using them.

December 2, 2019
Inheritance vs Extension functions

We all know about inheritance which is there in the OOPs concept where one can extend a class and add functionality to it. In the new programming languages, there is something called as extension functions which can add a functionality to an existing class without extending it.

October 23, 2019
partition() : Kotlin

The collection is something which is used by almost everyone. It makes our life easy. List, Set and Map are the best examples of them. Even the programming language in which you are writing code provides you with a few basic operations that can be performed on those collections, But sometimes you need even more operations.

May 28, 2019
Native Android image sharing in Unity using FileProvider

While implementing native sharing using my previous post, Native Android image sharing in Unity we saw an exception android.os.FileUriExposedException in Android 8 (Oreo) and above.

May 10, 2019
takeIf and takeUnless : Kotlin

Ever thought of chaining an if condition?

What if we can chain the if condition also and moves or executes the next code in the chain only if the condition is true?

April 5, 2019
Inline function : Kotlin

What is inlining?

Inlining is basically requesting the compiler to copy the (inlined) code at the calling place.

Why it is required?

When a program is executed and a function is called, CPU stores the memory address of the instruction following the function call, copies the arguments of the function into a stack and finally transfers control to the specified function. The CPU then executes the function code, stores the function return value in a predefined memory location/register and returns control to the calling function.

March 29, 2019
mutating in Swift

As we all know, Classes are reference type whereas Structures and Enumerations are of a value type in swift. What does that mean is that a class object shares a single instance of the object and passes the same reference if passed to any function or new object whereas the value type is the one which creates a copy of it and passes only the value.

March 1, 2019
‘inout’ in Swift

Recently, while working with swift I came up with a use case where I need to modify the variable passed as an argument to a function. Eventually, all the variables passed to a function are of an immutable type which cannot be changed which is similar to a let variable. If it’s a class object, you cannot create a new object but you can manipulate the properties of that class object or you can call any function with that object.

February 7, 2019
Qualified ‘this’ in Kotlin

The only thing we learnt about this pointer in other languages is “this is an implicit pointer which points to the calling object”. As clear from the definition, it points to the object which calls the respective function or property.

December 23, 2018
Type Aliases in Kotlin

Life is painful when you have two or more classes with the same name but different package name and you have to use them both in the same place.

October 26, 2018
Extensions in Kotlin

Have you ever felt some useful functionality missing in an existing class?

The class could be in the libraries provided by language also.

October 13, 2018
Variable number of arguments (vararg) : Kotlin

Sometimes we need a function where we can pass n number of parameters, and the value of n can be decided at runtime. Kotlin provides us to achieve the same by defining a parameter of a function as vararg. We can pass n number of parameters to a vararg variable of the defined datatype or even of a generic type.

October 6, 2018
Object Expression in Kotlin

Sometimes we need to create an object of some class with slight modification, without explicitly declaring a new subclass for it. Java handles this case with anonymous inner classes. Kotlin uses object expression to achieve the same functionality.

September 4, 2018
Equality in Kotlin (‘==’, ‘===’ and ‘equals’)

We often need to compare the data of two variables or objects or the references of two objects in Kotlin. This brings in another question, which equality check should we use in which case.

1 2 3 4 5 6