The life of an app

An app is not a lonely island. It is always executed by the operating system, within bounds that it imposes. Depending on the type of the app, we could be interested in responding to different application lifecycle events that the operating system sends to it. Every operating system has a slightly different app lifecycle model, but in the case of mobile the most tricky part could be properly handling the situation when our apps move from foreground execution to background, and back.

FireMonkey provides common abstraction for handling an application lifecycle through different types of application events defined in the FMX.Platform unit:

type  TApplicationEvent = (FinishedLaunching, BecameActive, WillBecomeInactive, EnteredBackground, ...

Get Expert Delphi now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.