Skip to main content

Base App and Launching

Overview

This page explains how the app boots: IoC container creation, platform-specific initialization, loading style.json, and starting the main loop.

Base App Classes

Launch Sequence

Launch Sequence

Key Steps

  • Base constructor calls begin() which orchestrates setup.
  • IoC is created via PlatformAppInitializer.createIOCContainer(custom), merging base → platform → custom services.
  • beforeLaunch() invokes PlatformAppInitializer.beforePlatformLaunch(app) for platform hooks.
  • runAppLaunchSequence() runs: initializeAsyncServices()loadAppConfig() (reads assets/meta/style.config.json) → precreateSGViews().
  • resolveIOCDependencies() pulls core services from IoC and registers app for convenience.
  • Main loop starts; onLaunch() is called when ready.
Tip: Initialization Order

Order matters. IoC must exist before any views relying on injected services are instantiated.

IoC Access

  • Use @inject() without args to resolve by property name, or @inject('key') to resolve by explicit key.
  • IocContainer.resolve/register are exposed via AppUtils.resolve<T>(key) and AppUtils.register(key, value) for convenience with generics.
Where Services Come From

PlatformAppInitializer provides platform overrides (e.g., hosannaDevice), while apps add custom services via getCustomIOCServices().