Architecture, Engineering, and the Future of Platform-Native Apps
- About this book
Introduction: The Moment of Decision
- The Promise That Was
- The Cracks in the Foundation
- What Changed
- A New Maturity
- What This Book Is
- What This Book Is Not
- How to Use This Book
- The Journey Ahead
Chapter 1: The History and Architecture of React Native
- From Web to Mobile
- The Bridge: How React Native Communicates with Native Code
- The New Architecture: Fabric, TurboModules, and the JavaScript Interface
- Execution Model: Threads, Event Loops, and Message Passing
- Why the Architecture Limits Performance
- The Developer Experience Story
Chapter 2: Cross-Platform Development: A Taxonomy of Approaches
- The Spectrum of Cross-Platform Development
- WebView-Based: Cordova, Ionic, and the Legacy Stack
- JavaScript Plus Native Rendering: React Native, NativeScript
- Self-Contained Runtime Plus Custom Rendering: Flutter
- Shared Business Logic: Kotlin Multiplatform, Swift Package for Android
- WebAssembly in Mobile: The Emerging Third Path
- A Decision Framework for Cross-Platform Choices
Chapter 3: Flutter Deep Dive: The Main Rival
- Flutter’s Unique Architecture
- How Flutter Renders: Frames, Layers, and the Pipeline
- Dart’s Concurrency Model: Isolates and Event Loop
- State Management: From Provider to Riverpod to Bloc
- Flutter vs Native: The Performance Reality
- Why Flutter’s Approach Makes Trade-offs Native Can’t Avoid
Chapter 4: Kotlin Multiplatform: Sharing Logic, Not UI
- KMP Philosophy: What to Share and What Not to
- Project Structure and Gradle Configuration
- Shared Code: Expect/Actual and Platform Abstractions
- Compose Multiplatform: Sharing UI (or Not)
- Real-World Adoption Patterns
- KMP vs React Native vs Pure Native
Chapter 5: The iOS Platform: Architecture and Execution
- From Binary to Launch: Loading, Linking, and Initialization
- Process Model, Sandboxing, and Memory Isolation
- The Run Loop: Events, Timers, and Scheduling
- View Hierarchy and Auto Layout Mechanics
- UIKit Internals: UIResponder Chain and Event Delivery
- How the System Manages App Lifecycle
Chapter 6: Swift: Language and Runtime
- Swift’s Type System: Value Types, Reference Types, and Protocols
- The Swift Standard Library and Its Design Philosophy
- Memory Management: ARC, Retain Cycles, and Stack Allocation
- Swift’s Compile-Time Model and ABI Stability
- Performance: What Swift Does Well and Where It Struggles
- Modern Swift: Concurrency, Actors, and Structured Concurrency
Chapter 7: SwiftUI: Declarative UI on iOS
- SwiftUI’s Declarative Model: Views, State, and Recomposition
- How SwiftUI Renders: View Updaters, Transaction System, and Layout Passes
- State Management: @State, @Binding, @ObservedObject, @Environment
- Navigation Architecture in SwiftUI
- Animations and Transitions: The Declarative Way
- SwiftUI Limitations: When to Fall Back to UIKit
- Complete Example: Building a Production Application in SwiftUI
Chapter 8: The Android Platform: Architecture and Execution
- Android Process Model: Apps, Services, and System Server
- Application Package Structure: APKs, AABs, and Dynamic Delivery
- Activity Manager and the App Lifecycle
- The Android Runtime: Compilation and Execution
- Handler, Looper, and the Main Thread Model
- System Services: Binder IPC and Interprocess Communication
Chapter 9: Kotlin: Language and Ecosystem
- Kotlin’s Design: Why Google Chose It Over Java
- Type System, Null Safety, and Extension Functions
- Coroutines: Kotlin’s Concurrency Revolution
- The Kotlin Standard Library and Compiler Plugins
- Kotlin on the JVM and Native: Compilation Targets
- Kotlin Performance: Optimization and Bytecode
Chapter 10: Jetpack Compose: Declarative UI on Android
- Composable Functions and the Composition Model
- How Compose Renders: Snapshot, Recomposition, and Diffing
- State Management in Compose: remember, State, and Derived State
- Navigation with Compose Navigation
- Animations in Compose
- Compose vs View System: Architecture and Performance
- Complete Example: Building a Production Application in Compose
Chapter 11: Concurrency and Asynchronous Programming
- The Concurrency Challenge in Mobile
- iOS Concurrency: Grand Central Dispatch, Operation Queues, and async/await
- Android Concurrency: Threads, Handlers, and Coroutines
- Structured Concurrency: Why It Matters
- Avoiding Race Conditions and Deadlocks
- Complete Examples: Concurrency Patterns on Both Platforms
Chapter 12: Memory Management and Performance
- iOS Memory: ARC, Stack vs Heap, and Retain Cycle Detection
- Profiling Tools: Instruments, Xcode Debugger, Android Profiler
- Common Memory Pitfalls on Each Platform
- Reducing Memory Footprint: Practical Techniques
- Case Study: Debugging a Memory Leak on Each Platform
Chapter 13: Networking and Data Synchronization
- iOS Networking: URLSession, HTTP Pipelines, and TLS
- Android Networking: OkHttp, HttpURLConnection, and TLS
- Architecture Patterns: REST, GraphQL, and WebSockets
- Offline-First Design: Caching, Queueing, and Conflict Resolution
- Push Notifications: APNs, FCM, and Local Notifications
- Complete Example: Building an Offline-First Data Layer
Chapter 14: Persistence and Databases
- iOS Persistence: UserDefaults, Keychain, CoreData, and SQLite
- Android Persistence: SharedPreferences, DataStore, Room, and SQLite
- CoreData Architecture: Managed Objects, Contexts, and Migrations
- Room Architecture: Entities, DAOs, and Compilation
- Migration Strategies: Versioning and Data Integrity
- Complete Example: A Cross-Platform Data Layer Architecture
Chapter 15: App Architecture Patterns
- The Clean Architecture Principle Applied to Mobile
- MVVM, MVI, and Redux-Style Patterns on Mobile
- Dependency Injection: Swift’s Approach vs Android’s Hilt/Dagger
- Feature-Based Modularization: Breaking Up Monolithic Apps
- Domain Layer Design: Use Cases, Entities, and Repository Pattern
- Complete Example: Structuring a Medium-Scale Application
Chapter 16: State Management at Scale
- Local vs Global State: When to Use Each
- iOS Patterns: SwiftUI Environment, Combine, and Custom Stores
- Android Patterns: ViewModel, MVI Stores, and Flow
- Unidirectional Data Flow and Its Benefits
- Server-Driven State: Keeping UI and Server in Sync
- Complete Example: State Management in a Social Feed Application
Chapter 17: Navigation and Deep Linking
- Navigation Patterns: Stacks, Tabs, and Custom Flows
- iOS Navigation: SwiftUI NavigationStack and UIKit UINavigation
- Android Navigation: Jetpack Navigation and Compose Navigation
- Handling Authentication Flows and Complex Transitions
- Android Animations: Compose Animations and ViewPropertyAnimator
- Complex Animations: Choreographing Multiple Elements
- Performance: Avoiding Jank and Frame Drops
- Complete Example: Animated Onboarding Flow on Both Platforms
Chapter 19: Accessibility and Internationalization
- Accessibility: VoiceOver, TalkBack, and Dynamic Type
- Accessibility Architecture: Labeling, Focus, and Semantics
- Internationalization: String Management, RTL, and Localization
- Plurals, Date Formats, and Cultural Sensitivity
- Testing Accessibility and Localization
- Complete Example: Making an App Fully Accessible and Localized
Chapter 20: Security in Mobile Applications
- Threat Model for Mobile Applications
- iOS Security: Keychain, Enclaves, and App Sandboxing
- Android Security: Keystore, BiometricPrompt, and App Sandboxing
- Secure Networking: TLS Pinning and Certificate Validation
- Protecting Against Reverse Engineering and Tampering
- Complete Example: Implementing Secure Authentication and Storage
Chapter 21: Testing Strategies
- Testing Pyramid for Mobile Applications
- iOS Testing: XCTest, UI Testing, and SwiftUI Previews
- Android Testing: JUnit, Espresso, and Compose Testing
- Testing Architecture: Making Your Code Testable
- Mocking and Dependency Injection for Tests
- Performance Monitoring and Alerting
- Complete Example: Debugging a Production Performance Issue
Chapter 23: CI/CD and Release Management
- Build Systems: Xcode Build System and Gradle
- Continuous Integration: Building and Testing in the Cloud
- Code Signing and Provisioning: iOS and Android
- App Store Deployment: Review, Release Tracks, and Rollouts
- Feature Flags and Gradual Rollouts
- Complete Example: Setting Up CI/CD for a Production Mobile App
Chapter 24: Migrating from React Native to Native
- Deciding to Migrate: Signals and Metrics That Matter
- Strategic Options: Big Bang, Strangler Fig, or Side-by-Side
- Parallel Architectures: Running React Native and Native Together
- Migrating UI: Mapping React Native Components to SwiftUI and Compose
- Migrating State Management and Business Logic
- Complete Case Study: Migrating a Large React Native App to Native
Chapter 25: Team Organization and Developer Productivity
- Team Models: Unified, Platform-Siloed, and Feature-Team Approaches
- The Cost of Cross-Platform vs Native: A Realistic Analysis
- Hiring, Onboarding, and Knowledge Transfer
- Developer Experience: Tooling, Documentation, and Conventions
- Making Technology Decisions That Last
- Complete Case Study: How a Large Organization Structured Its Mobile Teams
Conclusion: The Future of Native Mobile Development
- Platform Roadmaps: Where Apple and Google Are Headed
- The AI and Machine Learning Shift in Mobile
- New Form Factors: Wearables, Foldables, and Beyond
- The Next Cross-Platform Challenge
- Final Recommendations for Teams and Developers
- Closing Thoughts