android-components / mozilla.components.service.experiments / Experiments


object Experiments : ExperimentsInternalAPI (source)

The main Experiments object.

This is a global object that must be initialized by the application by calling the initialize function before the experiments library can fetch updates from the server or be used to determine experiment enrollment.


Inherited Functions

Name Summary
initialize fun initialize(applicationContext: <ERROR CLASS>, configuration: Configuration = Configuration(), onExperimentsUpdated: () -> Unit = null): Unit
Initialize the experiments library.
withExperiment fun withExperiment(experimentId: String, block: (branch: String) -> Unit): Unit
Performs an action if the user is part of the specified experiment

Extension Functions

Name Summary
loadResourceAsString fun Any.loadResourceAsString(path: String): String
Loads a file from the resources folder and returns its content as a string object.