public class

LiveVariable

extends Object
java.lang.Object
   ↳ com.optimizely.Variable.LiveVariable<T>

Class Overview

Live Variables allow you to designate variables in your app that can be assigned values in the Optimizely editor. These values can be modified by Optimizely's editor even after you have released your app to the app store. For example, you might want to create an experiment that tests various values for gravity. Live Variables are declared as static variables in your code and then can be accessed anywhere in your application. These values can be used as feature flags, to modify the behavior of your app, or as a convenient way to update your app with new stylings. Live variables must be declared as static variables in your app in order for the Optimizely Editor to detect them. To declare a LiveVariable use one of the following functions:
booleanForKey(String, Boolean)
stringForKey(String, String)
integerForKey(String, int)
floatForKey(String, float)
rectForKey(String, android.graphics.Rect)
pointForKey(String, android.graphics.Point)
colorForKey(String, int)

Summary

Nested Classes
interface LiveVariable.Callback<T>  
Protected Constructors
LiveVariable(String variableKey, T defaultValue, OptimizelyVariables optimizelyVariables, Class<T> clazz)
Public Methods
T get()
Retrieve the value for this variable by resolving it from the currently active variation.
[Expand]
Inherited Methods
From class java.lang.Object

Protected Constructors

protected LiveVariable (String variableKey, T defaultValue, OptimizelyVariables optimizelyVariables, Class<T> clazz)

Public Methods

public T get ()

Retrieve the value for this variable by resolving it from the currently active variation.

Returns
  • the object represented by this variable