Posts

The Hidden Layer of Android: ABIs Explained (armeabi-v7a vs. arm64-v8a)

Image
 A deep dive into Application Binary Interfaces (ABIs), 64-bit mandates, and ensuring your native code runs on every device. If you have ever seen a  .so  file in your project or peeked inside your Gradle build output, you have already been dealing with  Application Binary Interfaces (ABIs) —whether you realize it or not. Understanding ABIs is essential for modern Android app delivery. They act as the low-level “handshake” between your compiled code and the device’s physical hardware. What exactly is an ABI? An ABI is a  low-level contract . While an API defines how code talks to other code, an ABI defines how your compiled binary  interacts  with the CPU’s instruction set. It dictates how data is arranged in memory and how functions are called at the register level. Without the correct ABI, your app and the phone’s hardware simply cannot communicate. 🔹 armeabi-v7a (32-bit): The Resilient Legacy The  v7a  architecture has been the backbone o...

SavedStateHandle vs. rememberSaveable: Which One Should You Choose?

Image
 A senior developer's guide to clean state management in Jetpack Compose—where to store your data and why it matters for app stability. TL;DR: SavedStateHandle:  Use for  Business/Presentation State  (IDs, search queries) in the ViewModel. It is the most reliable anchor for process restoration. rememberSaveable:  Use for  Pure UI State  (scroll position, animation toggles) in the Composable. Rule of Thumb:  If losing the state breaks the screen’s logic, use the ViewModel. If it only resets a visual preference, keep it in the UI. 1. The Architecture Gap In a modern Jetpack Compose app, state lives in two distinct layers. Choosing the wrong bucket leads to “State Leakage,” where your business logic becomes tangled with your UI or your UI becomes unresponsive after a background kill. SavedStateHandle (The ViewModel Layer) This is your  Architectural Anchor . It allows the ViewModel to interact with the system’s saved instance state. Because the ...

Your ViewModel Won't Save You: Designing for Android Process Death

Image
  How to use SavedStateHandle and the Single Source of Truth pattern to build "death-proof" apps that never lose user progress. TL;DR: ViewModel  survives rotations, but  not  process death. LMK (Low Memory Killer)  will kill your background app to reclaim RAM. SavedStateHandle  is your tool for restoring small UI states (IDs, flags). Room/DataStore  is required for critical business data persistence. Test  using  adb shell am kill <package>  to see your app's true resilience. The Ghost in the Machine You’re in a banking app, halfway through a wire transfer. You switch to your email to copy an OTP. When you return, the app has reset to the login screen, and your progress is gone. To the user, this is a “glitch.” To a  seasoned Android developer , this is a failure to architect for  Process Death . Android enforces strict process management regardless of available RAM. If you want to build professional software, you must s...