Easy concepts in Mobile Dev, page 6

Preferences DataStore: The Safe SharedPreferences
Preferences DataStore is Android's modern way to save simple key-value data. It uses Kotlin's Flow to read data asynchronously, preventing UI freezes. Use it for user settings, but remember you can't read values synchronously like with SharedPreferences.
Provider: Pass Data Down Your Widget Tree
Think of Provider as a delivery service for your app's data, passing it down the widget tree without sending it through every widget's constructor. It's a lightweight way to manage state. The footgun: never use .value to create a new object.
ValueNotifier: Notifies on Replacement, Not Mutation
ValueNotifier is a simple state holder that tells widgets to rebuild when its single value is replaced. It's great for immutable data like a boolean toggle or counter.
Animated.Value: The Driver for React Native Animations
Animated.Value is a single number that drives multiple UI properties, like one dimmer switch controlling many lights. Use it to fade, move, or scale components. The main footgun: you cannot read its value synchronously and must use an asynchronous listener.
Animated: Drive Styles with Values, Not Setters
React Native's Animated API lets you drive styles with a value, not manual setters. Use it for performant fades and slides. The biggest footgun is forgetting useNativeDriver: true, which keeps animations smooth by running them off the JS thread.
useNativeDriver: Offload Animations from the JS Thread
useNativeDriver offloads animations from the JavaScript thread to the native UI thread for smoother performance. Use it in Animated API calls to prevent dropped frames.

CALayer
CALayer is the Core Animation object that actually draws and animates a UIView's content on screen, while the view itself handles touch input, layout, and event routing on top of it.

UIBezierPath: Drawing Custom Shapes in Code
UIBezierPath is a digital pen for drawing custom shapes. You define a path with lines and curves, then fill or stroke it. It's essential for custom charts, icons, or non-rectangular views.
REST: The Architectural Style for Web APIs
REST is the architectural style for web APIs, using standard HTTP methods like GET and POST to manage data. Your Android app uses it to fetch user profiles from a server. The footgun is treating REST as a strict protocol; it's a set of guidelines.
Retrofit: Turn Your HTTP API into an Interface
Retrofit turns your HTTP API into a simple interface, letting you define network calls as annotated methods. It's the standard for most Android network tasks. Footgun: forgetting to run calls off the main thread will crash your app.

Kotlinx.serialization: Kotlin's Native Data Converter
Kotlinx.serialization is Kotlin's native way to convert data classes into formats like JSON. It uses a compiler plugin to automate the process, making it ideal for API calls or saving data.
OkHttp: A Smarter HTTP Client for Your App
OkHttp is a smart, resilient HTTP client for Android and Java. It automatically handles complexities like connection pooling, caching, and GZIP compression to make requests faster and more reliable.
Dart's `http` Package: Simple Requests vs. Composable Clients
Dart's http package simplifies web requests. Use top-level functions like http.get() for one-off calls, or a Client for persistent connections. Forgetting to call client.close() is a common footgun that leaks resources.
JSON in Dart: Using `dart:convert`
dart:convert is Dart's built-in translator for JSON. It turns Dart Maps into JSON strings (jsonEncode) for APIs and file storage, and parses JSON strings back into Maps (jsonDecode). The footgun: jsonDecode returns a generic Map, not your custom class.
Handling Permissions in React Native
A unified permissions API gives you one way to request device features, avoiding separate logic for iOS and Android. It's essential for apps needing the camera or location. The main footgun is forgetting to configure the native project files.
Manual JSON Serialization with fromJson/toJson
Manually map your Dart objects to JSON by writing your own fromJson and toJson methods. This is ideal for simple data models or quick prototypes where code generation is overkill.
React Native's Share API: Use the Native Share Sheet
The React Native Share API opens the native OS share sheet, letting users share content like URLs or text. It provides a familiar UI with a single cross-platform method call.
FutureBuilder: Handling Async UI in Flutter
FutureBuilder rebuilds UI based on an async operation's state, showing loading, error, or data. Use it for network requests or slow computations. Footgun: Never create the Future inside build; it will restart on every rebuild, causing an infinite loading…

Core Location: Your App's Sense of Place
Core Location gives your app its sense of place, from a precise coordinate to a general region. It powers maps, ride-sharing, and location-based reminders. Use it for one-time fixes, continuous tracking, or geofencing.

Dependency Injection: Your Objects Shouldn't Create Their Own Helpers
Instead of creating its own helpers (like a network client), an object receives them from an outside source. This is crucial for building testable Android apps, as it lets you swap a real UserRepository with a fake one during tests.
We are hiring for this. Every open role lists the topics its interview covers, so you can prepare for the real thing rather than guessing.
See open roles