

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


AP PLIED COMPUTING • CH AP T ER 16
Platform Architectures, Lifecycle States, Offline Storage & Battery Efficiency
Mobile applications must balance hardware access, rendering speed, and code reuse across iOS and Android ecosystems.
Approach Tech Examples Key Advantage Main Trade-Off Native Swift (iOS), Kotlin (Android)
Direct OS API access & peak GPU performance
Two separate codebases to maintain
Cross- Platform
Flutter, React Native Single shared codebase with near- native UI
Bridge overhead or delayed access to brand-new OS features PWA (Web) HTML5, Service Workers
Instant updates without app store review
Restricted back ground tasks & Bluetooth/NFC hardware limits
Unlike desktop programs, mobile operating systems aggressively pause or terminate back ground apps to preserve RAM and battery life.
Figure 16.1 — OS State Transitions When a User Switches Apps or Locks the Screen
State Serialization: Save unsaved form inputs and scroll positions during the onPause / background callback before the OS reclaims memory. Thread Safety: Never run network requests or database queries on the Main UI Thread ; blocking it for over 16ms drops frames below 60 FPS.
Local Persistence: Use embedded SQLite databases or encrypted key-value stores so users can view and edit records in tunnels or airplanes.
Launched Foreground Background Suspended
Conflict Resolution: When reconnecting, resolve offline edits using timestamps (Last-Write-Wins) or version vectors. Battery Hygiene: Batch network calls together instead of waking the cellular radio every few seconds, and lower GPS polling accuracy when turn-by-turn navigation is not active.
Quick Exam Checklist: Mobile Constraints Always design for variable screen densities (dp/pt units instead of raw pixels), intermittent connectivity, and strict runtime permission prompts (camera, location, microphone).