Core
A central point for Monterosa SDK configuration. Coordinates communication between Monterosa SDK components (kits).
Configure a Core once, then hand it to whichever kits you need. Each kit registers itself with the Core it is given and is reused on subsequent calls, so from(core) is cheap to repeat.
// Configure before using any kit, typically in Application.onCreate
Core.enableLogging(BuildConfig.DEBUG) // optional, must precede configure
Core.configure(context, host = "cdn.monterosa.cloud", projectId = "<project-uuid>")
// Kits hang off the configured Core
val launcher = Launcher.default
val interactKit = InteractKit.defaultContent copied to clipboard
Pass a name to run more than one project at a time. Each named Core keeps its own options and its own set of kits, and is retrieved with core rather than default:
Core.configure(context, host, projectId, name = "second-project")
val interactKit = InteractKit.from(Core.core("second-project"))
// When that screen goes away, release the Core and close every kit it owns
Core.purgeCore("second-project")Content copied to clipboard