Learning Mobile Development
Intercept the Start of iOS and Android Application
It’s Not Provided by Default On Your New iOS or Android Project
In In mobile app development, setting up initial configurations for an app is often necessary, but these aren’t provided by default when creating a new project. Experienced developers know where and how to set this up manually, but for newcomers, the correct approach isn’t always obvious, risking one code in the wrong place!
In this guide, I’ll walk you through how to intercept the start of both iOS and Android applications, using examples from a new iOS project with SwiftUI and an Android project with Jetpack Compose.
The iOS Project
When we first create an iOS Project, it shall have the App.swift
file created with the @Main
annotation shown below.
There’s no right place where to intercept the start of the App here, as we cannot put out initialization in the body
of the code above.