In this post, we’ll walk through building a URL Shortener app using Kotlin and Jetpack Compose for Android. This coding challenge is often asked in Android Engineer technical rounds, as it tests understanding of data structures (such as maps) and string manipulation, as well as proficiency in Kotlin and Jetpack Compose. The goal is simple: Take a long URL from …
Read More »Testing Cheatsheet in Android Kotlin Compose (Basic to Advanced) | by Dharma Kshetri | Feb, 2025
Testing is a vital part of any Android development workflow, and when using Jetpack Compose, it becomes even more essential to ensure that your UI behaves as intended. Android Kotlin Compose covers basic to advanced techniques, including unit tests, UI testing, mock data, and API integration. Unit, UI, and Instrumentation Tests in Android Unit Tests Purpose: Unit tests focus on …
Read More »Jetpack Compose Cheatsheet/Tips for Android Engineer | by Dharma Kshetri | Feb, 2025
Source: Grok Here’s a Jetpack Compose cheatsheet/Tips that every Android engineer should know: 1. Basic Composables Text: Text("Hello, Jetpack Compose") Button: Button(onClick = {/* Handle click */}) {Text("Click Me")} Image(painter = painterResource(id = R.drawable.image),contentDescription = "Image") 2. Layouts Column: Align items vertically. Column { Text("First Item") Text("Second Item") } Row: Align items horizontally. Row {Text("Item 1") Spacer(modifier = Modifier.width(8.dp)) Text("Item …
Read More »Stopwatch App with MVVM, Coroutines, and Jetpack Compose | by Dharma Kshetri | Jan, 2025
Before we get into the implementation, let’s first define the concepts that will guide our design approach: MVVM Architecture (Model-View-ViewModel): Model: Manages the business logic and data of the stopwatch. ViewModel: Interacts with the model and provides data to the view while managing lifecycle issues. View: Displays data provided by the ViewModel and handles user interactions. Coroutines: A lightweight way …
Read More »Mahakumbh 2025: Sanatana Dharma is India’s national religion, says Yogi Adityanath
Uttar Pradesh Chief Minister Yogi Adityanath has called ‘Sanatana Dharma,’ country’s national religion. ‘Sanatana Dharma’ is a Sanskrit term that is often used to describe a traditional form of Hinduism “Sanatana Dharma is the national religion of India. It is the religion of humanity. The process of worship can be different. But religion is one and that religion is Sanatana …
Read More »Best Practices for Kotlin Extension Functions in Android | by Dharma Kshetri | Jan, 2025
Kotlin’s extension function feature allows you to add new functionality to existing classes (including Android framework classes) without modifying their code. This is particularly useful in Android development, where you often work with classes provided by the Android SDK or third-party libraries that you cannot directly modify. Key Features of Extension Functions No Class Modification: You can extend a class’s …
Read More »Ultra HDR: Elevating Image Quality on Android 📸 | by Dharma Kshetri | Jan, 2025
source: AI generated Android developers and users rejoice! With the introduction of Ultra HDR in Android 14 (API level 34), capturing and displaying images on Android devices has reached a whole new level of brilliance. Let’s explore Ultra HDR, how it transforms image quality, and how you can integrate it into your Android apps using Kotlin, Jetpack Compose, and essential …
Read More »