Docsity

Chapter_16_Mobile_Application_Development, Lecture notes of Computer Fundamentals

Toggle sidebar
bg1
AP PL IED CO MPU TI NG • CH AP TER 1 6
Mobile Application Development
Platform Architectures, Lifecycle States, Offline Storage & Battery Efficiency
1. Native vs. Cross-Platform Architecture
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
2. Mobile App Lifecycle Management
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.
3. Offline-First Sync & Resource Optimization
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
•
•
•
pf2

Partial preview of the text

Download Chapter_16_Mobile_Application_Development and more Lecture notes Computer Fundamentals in PDF only on Docsity!

AP PLIED COMPUTING • CH AP T ER 16

Mobile Application Development

Platform Architectures, Lifecycle States, Offline Storage & Battery Efficiency

1. Native vs. Cross-Platform Architecture

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

2. Mobile App Lifecycle Management

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.

3. Offline-First Sync & Resource Optimization

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).