android

Android TextView ellipsize property example

This article is about how to work with Android TextView ellipsize property. Android Ellipsize Android TextView ellipsize property Causes words in the text that are longer than the view’s width to be ellipsized ( means to shorten text using an ellipsis, i.e. three dots …) instead of broken in the middle to fit it inside the given […]

Android TextView ellipsize property example Read More »

Android Working With Fragments

This tutorial is about how to create a fragment and include it in an activity with the help of an example. Create a fragment class To create a fragment, we have to define a fragment class, which extends the class Fragment and overrides the necessary methods. class FragmentOne : Fragment() {     override fun onCreateView(

Android Working With Fragments Read More »

Android Broadcast Receiver Example

This article is about Android broadcasts, broadcastReceiver, and how to work with the broadcastReceiver with the help of a simple example. Broadcasts Broadcasts are messages that the Android system and Android apps send when an event of interest occurs. The broadcast message itself is wrapped in an Intent object. There are two types of broadcasts: System

Android Broadcast Receiver Example Read More »

Activity Lifecycle in Android

This tutorial is about Activity in Android, Activity Lifecycle, Real example use-cases of Activity Lifecycle. Activity In Android, an Activity is referred to as one screen in an application. An activity provides the window in which the app draws its UI. An Android app consists of one or more screens or activities. For example, when we

Activity Lifecycle in Android Read More »

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 Set Read More »

Kotlin Map

In this tutorial, we will talk about Kotlin Map with the help of simple examples. Map Maps are used to store key and value pairs. In Map: key and value are user defined. The key should be unique and only one value can be stored for each unique key. Values can be duplicate. A key value

Kotlin Map Read 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 Example Read 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 Classes Read 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 Expressions Read 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 objects Read More »