Avoid Redundant Network Checks in Android: Smart Offline-Aware API Handling | by Dobri Kostadinov | Apr, 2025

Avoid Redundant Network Checks in Android: Smart Offline-Aware API Handling | by Dobri Kostadinov | Apr, 2025

Learn how to prevent unnecessary API calls in Android by detecting offline state centrally using Kotlin Flows and interceptors — no repetitive checks required. image source: istockphoto.com As Android developers, we’ve all been there — adding if (isNetworkAvailable()) before almost every API call to avoid crashes or wasted calls when the user is offline. But … Read more

Top 3 Android Use Cases for Every SOLID Principle (with Code) | by Dobri Kostadinov | Apr, 2025

Top 3 Android Use Cases for Every SOLID Principle (with Code) | by Dobri Kostadinov | Apr, 2025

Learn how to apply each SOLID principle in Android apps with 15 focused use cases and Kotlin code examples. source: istockphoto.com As Android developers, we often hear about the SOLID principles, but let’s be real — it’s not always clear how to apply them specifically in our projects. SOLID is a set of five design … Read more

Hybrid Encryption in Android: Secure Communication Between Mobile and Backend Systems | by Dobri Kostadinov | Mar, 2025

Hybrid Encryption in Android: Secure Communication Between Mobile and Backend Systems | by Dobri Kostadinov | Mar, 2025

Why Asymmetric Encryption Alone Isn’t Enough — and How Combining RSA & AES Keeps Your App Fast and Secure Image source: www.istockphoto.com In modern Android development, security is no longer optional — especially when your app handles sensitive data such as user credentials, banking information, or health records. While asymmetric encryption (like RSA or EC) … Read more

Man-in-the-Middle (MITM) Attacks in Android Development: How to Secure Your App | by Dobri Kostadinov | Mar, 2025

Man-in-the-Middle (MITM) Attacks in Android Development: How to Secure Your App | by Dobri Kostadinov | Mar, 2025

Protecting Your Android App from Cyber Threats Security in Android development is an essential concern, especially when handling sensitive user data, authentication tokens, and financial transactions. One of the most dangerous yet common security vulnerabilities is the Man-in-the-Middle (MITM) attack. This aligns closely with the OWASP Mobile Top 10 security risks, particularly M3: Insecure Communication … Read more

Handling Token Expiration in Ktor: Automatic Token Refresh for API Calls | by Dobri Kostadinov | Feb, 2025

Handling Token Expiration in Ktor: Automatic Token Refresh for API Calls | by Dobri Kostadinov | Feb, 2025

A Complete Guide to Seamlessly Managing Token Expiry and Refresh in Ktor-based Android Apps In my previous article on Retrofit, I explained how to handle token expiration using OkHttp’s Authenticator and Interceptor. However, many modern Android applications are switching to Ktor Client as a lightweight and flexible alternative to Retrofit. If your app relies on … Read more

Why Your Network Calls on the Main Thread Aren’t Crashing your Android App | by Dobri Kostadinov | Feb, 2025

Why Your Network Calls on the Main Thread Aren’t Crashing your Android App | by Dobri Kostadinov | Feb, 2025

Understanding Why Your App Does Not Crash Despite Running Network Requests on the Main Thread and Why Following Best Practices is Essential As an Android developer, you have probably heard many times that network calls should never be executed on the main thread. However, you may have noticed that your app does not crash even … Read more

Advanced Exception Handling in Kotlin Coroutines: A Guide for Android Developers | by Dobri Kostadinov | Feb, 2025

Advanced Exception Handling in Kotlin Coroutines: A Guide for Android Developers | by Dobri Kostadinov | Feb, 2025

Mastering Exception Handling in Kotlin Coroutines: Handling Failures Like a Pro Exception handling in Kotlin Coroutines is often misunderstood, especially when dealing with structured concurrency, exception propagation, and parallel execution. A poorly handled coroutine failure can crash your Android app or lead to silent failures, making debugging difficult. In this article, we will cover advanced … Read more

Dealing with READ_MEDIA_IMAGES Permissions in Android | by Dobri Kostadinov | Feb, 2025

Dealing with READ_MEDIA_IMAGES Permissions in Android | by Dobri Kostadinov | Feb, 2025

/*** DialogFragment for selecting an image by either capturing it using the camera* or picking an existing one from the gallery. Ensures compliance with scoped storage.*/class FileSelectionDialog : DialogFragment() { private lateinit var cameraLauncher: ActivityResultLauncherprivate lateinit var galleryLauncher: ActivityResultLauncherprivate lateinit var cameraPermissionLauncher: ActivityResultLauncherprivate var currentPhotoPath: String = “” override fun onCreate(savedInstanceState: Bundle?) {super.onCreate(savedInstanceState) cameraPermissionLauncher =registerForActivityResult(ActivityResultContracts.RequestPermission()) … Read more

The Elephant in the Room for Android Devs: Jetpack Compose and Edge-to-Edge on Android 15 | by Dobri Kostadinov | Jan, 2025

The Elephant in the Room for Android Devs: Jetpack Compose and Edge-to-Edge on Android 15 | by Dobri Kostadinov | Jan, 2025

How Android 15’s Edge-to-Edge Feature Impacts Jetpack Compose Development With the release of Android 15 (API 35), one significant change that has stirred discussions among developers is the Edge-to-Edge feature. The transition from API 34 to API 35 introduces subtle but important differences in how we handle system bars, especially if your app currently uses … Read more

Top 3 Most Common Animations You Can Use in Your Jetpack Compose Project | by Dobri Kostadinov | Jan, 2025

Top 3 Most Common Animations You Can Use in Your Jetpack Compose Project | by Dobri Kostadinov | Jan, 2025

Enhance Your App’s User Experience with These Simple and Effective Animation Techniques in Jetpack Compose Animations are a vital part of modern app design, providing delightful user experiences and improving the overall look and feel of your application. With Jetpack Compose, animations are simpler and more intuitive to implement, thanks to its declarative nature and … Read more