tezvyn:

📱Mobile Dev

Mobile app development across platforms

1306 bites

More in Mobile Dev — page 4

React Native86 sec read

useMemo and useCallback for stable references

WHAT IT TESTS: Memoization hooks. OUTLINE: useMemo caches a computed value, useCallback caches a function identity across renders; both prevent recompute and unnecessary re-renders of memoized children.

React Native2 min read

Cost of console.log and production-safe debugging

WHAT IT TESTS: Debug logging cost. OUTLINE: each console.log serializes data and, when devtools are attached, crosses the bridge synchronously, blocking the JS thread; strip logs in release and use Flipper, dev tools, or remote crash and analytics tools.

React Native2 min read

FlatList and list virtualization

WHAT IT TESTS: Efficient long lists. OUTLINE: use FlatList (or SectionList) which virtualizes, rendering only items near the viewport and recycling as you scroll, unlike ScrollView which mounts everything. RED FLAG: putting a huge map of items in a ScrollView.

React Native2 min read

The JS thread and why it bottlenecks performance

WHAT IT TESTS: RN threading basics. OUTLINE: a single thread runs your JS, React reconciliation, and event handling; blocking it delays updates and gestures, and it is separate from the UI thread.

React Native2 min read

Streaming accelerometer data without bridge overload

WHAT IT TESTS: High-frequency data on the bridge. OUTLINE: the bottleneck is flooding the async bridge and re-rendering at sensor rate; fix by throttling, processing in worklets or native, and animating via shared values not setState.

React Native2 min read

Handling push notifications across app states

WHAT IT TESTS: State-aware notification handling. OUTLINE: foreground onMessage, background and quit setBackgroundMessageHandler and getInitialNotification, plus data-only messages and native background tasks like Background Fetch or Notification Service…

React Native2 min read

Building a custom native module

WHAT IT TESTS: Bridging native SDKs to JS. OUTLINE: write native classes in Kotlin/Java and Swift/Objective-C, expose methods via the module macros, register the module, and import via NativeModules with promises or events.

React Native2 min read

Managing camera lifecycle in Vision Camera

WHAT IT TESTS: Camera resource lifecycle. OUTLINE: bind the isActive prop to screen focus via useIsFocused and to app state, so the camera stops when blurred or backgrounded. RED FLAG: leaving isActive always true or unmounting instead of toggling isActive.

React Native2 min read

Background GPS tracking challenges and approaches

WHAT IT TESTS: Background execution constraints. OUTLINE: request always-allow permission, declare background modes, use a native background task or geofencing API rather than JS timers, manage battery and OS throttling.

React Native2 min read

Push notification data flow with APNs and FCM

WHAT IT TESTS: End-to-end push architecture. OUTLINE: device registers and gets a token, server sends to FCM, FCM routes to APNs for iOS and directly for Android, the OS delivers to the app. RED FLAG: thinking your server pushes straight to the device.

React Native83 sec read

Getting a one-time GPS location

WHAT IT TESTS: One-shot location retrieval. OUTLINE: ensure permission, then call a getCurrentPosition wrapped in a promise (or Expo Location.getCurrentPositionAsync) with await inside try/catch, reading coords.latitude and longitude.

React Native83 sec read

Requesting runtime permissions on iOS and Android

WHAT IT TESTS: Permission lifecycle awareness. OUTLINE: declare permissions in Info.plist and AndroidManifest, then check status and request at runtime just before use, handling granted, denied, and blocked.

React Native83 sec read

Persisting key-value preferences across launches

WHAT IT TESTS: Local persistence choices. OUTLINE: AsyncStorage for simple non-sensitive key-value, MMKV for speed, SecureStore or Keychain for secrets. RED FLAG: storing tokens in AsyncStorage or treating its async API as synchronous.

React Native85 sec read

Shared element transitions with Reanimated

WHAT IT TESTS: Cross-screen animated continuity. OUTLINE: wrap both views in Animated.View with the same sharedTransitionTag, use a native-stack navigator so Reanimated interpolates between source and target.

React Native2 min read

What is a worklet in Reanimated

WHAT IT TESTS: Reanimated's execution model. OUTLINE: a worklet is a JS function marked to run on the UI thread runtime with a captured snapshot of its scope, enabling synchronous per-frame work.

React Native80 sec read

Animated.event for scroll-driven parallax

WHAT IT TESTS: Mapping native events to animated values. OUTLINE: Animated.event maps an event path to an Animated.Value, wire it to onScroll with useNativeDriver, then interpolate the value for header transform.

React Native80 sec read

Shared values and useAnimatedStyle in Reanimated

WHAT IT TESTS: Reanimated core hooks. OUTLINE: useSharedValue holds a mutable .value readable on both threads, useAnimatedStyle derives styles as a worklet, mutate .value with withTiming or withSpring. RED FLAG: reading .value during render to set state.

React Native86 sec read

Animated API versus Reanimated architecture

WHAT IT TESTS: Where animation work runs. OUTLINE: Animated declares animations that the native driver runs, but logic and gestures cross the bridge; Reanimated runs worklets directly on the UI thread. RED FLAG: saying both run fully on JS.

React Native80 sec read

Animated.sequence versus Animated.parallel

WHAT IT TESTS: Composing multiple animations. OUTLINE: sequence runs animations one after another in order, parallel starts them at the same time. RED FLAG: thinking parallel waits for the slowest before others begin, or confusing them with stagger.

React Native78 sec read

Build a mount fade-in with Animated API

WHAT IT TESTS: Basic Animated API fluency. OUTLINE: create an Animated.Value(0) in a ref, drive it with Animated.timing inside useEffect, bind it to opacity on Animated.View. RED FLAG: animating opacity via setState every frame.