Kotlin Set

In this tutorial, we will talk about Kotlin Set with the help of simple examples. Sets are: An unordered collection of elements. Duplicate elements are not allowed in sets. In Kotlin, we can have both a mutable set and an immutable set. Kotlin Immutable Set The immutable set also known as read-only set support only read-only access to the set. Immutable set …

Kotlin SetRead More »

Kotlin Null Safety

This tutorial is about Null Safety in Kotlin. Null Safety in Kotlin is to eliminate the risk of occurrence of NullPointerException from code. One of the most common pitfalls in many programming languages, including Java, is that accessing a member of a null reference will result in a null reference exception. In Java this would …

Kotlin Null SafetyRead More »

Android Audio Recorder Example

This tutorial is about how to implement audio recorder in android with the help of a simple application. MediaRecorder Class In android, MediaRecorder class will provide a functionality to record audio or video files. In android, to record an audio we need to use device’s microphone along with MediaRecorder class. In case, if we want to record video, we …

Android Audio Recorder ExampleRead More »

Kotlin Data Classes

This tutorial is about Kotlin Data classes, requirements that data class must fulfill, and their standard functionalities. Data Classes Data classes  are classes whose main purpose is to hold data/state and contains standard functionalities. A data keyword is used to declare a class as a data class. Example: data class Student(val name: String, val age: Int) …

Kotlin Data ClassesRead More »

Kotlin Object Declarations and Expressions

This tutorial is about object declarations (singletons) and object expressions with the help of examples. Object Declarations Object declarations defines singletons. Singleton is an object-oriented pattern where a class can have only one instance (object) at a time. Kotlin creates singletons with the object keyword. The object declaration can have functions, properties, and the init …

Kotlin Object Declarations and ExpressionsRead More »

Kotlin Companion objects

This tutorial is about companion objects in Kotlin with the help of examples. Kotlin doesn’t have a static keyword. Static members belong to a type, and not to an instance of a type. In kotlin to achieve this static feature, we make use of companion object. companion object An object declaration inside a class can be …

Kotlin Companion objectsRead More »

Kotlin Getters and Setters

This tutorial is about how to use getters and setters in Kotlin with the help of simple example. Getters and Setters Getters are used for getting value of the property and Setters are used for setting the value of the property. Setters can have visibility modifiers but Getters always have the same visibility as the …

Kotlin Getters and SettersRead More »

Android Jetpack CameraX Example

This post is about Android Jetpack CameraX API and how to implement it in an android application with a simple basic example. CameraX CameraX is a Jetpack support library, makes it easier to add camera capabilities to your app. It has backward compatibility down to Android API 21. It uses a simpler, use case-based approach …

Android Jetpack CameraX ExampleRead More »

%d bloggers like this: