com.splitforce.lib
Class SplitforceManager

java.lang.Object
  extended by com.splitforce.lib.SplitforceManager
All Implemented Interfaces:
SfManager

public class SplitforceManager
extends java.lang.Object
implements SfManager


Field Summary
static boolean DEBUG
           
static java.lang.String INITIALIZED_KEY
           
static java.lang.String PREFS_NAME
           
static java.lang.String SESSION_TOKEN_KEY
           
static java.lang.String SYNCED_DATE_KEY
           
 
Method Summary
 java.lang.String getAppId()
           
 java.lang.String getAppPassword()
           
 android.content.Context getContext()
           
 SfVariation getExperiment(java.lang.String name)
          Retrieve an experiment that was previously initialized.
static SfManager getInstance()
           
 void init(android.content.Context context)
          Initializes the Splitforce library.
 void initExperiment(java.lang.String name, boolean forceReload, SfListener listener)
          * Initializes a Spilitforce Experiment from the manifest stored on the device.
 void initExperiment(java.lang.String name, SfListener listener)
          Initializes a Splitforce Experiment from the manifest stored on the device.
 boolean isInitialized()
          Determines if Splitforce sdk is initialized.
 SplitforceManager setAppId(java.lang.String appId)
           
 SplitforceManager setAppPassword(java.lang.String appPassword)
           
 SplitforceManager setDebug(boolean debug)
          Turn debug mode on or off.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PREFS_NAME

public static final java.lang.String PREFS_NAME
See Also:
Constant Field Values

SESSION_TOKEN_KEY

public static final java.lang.String SESSION_TOKEN_KEY
See Also:
Constant Field Values

INITIALIZED_KEY

public static final java.lang.String INITIALIZED_KEY
See Also:
Constant Field Values

SYNCED_DATE_KEY

public static final java.lang.String SYNCED_DATE_KEY
See Also:
Constant Field Values

DEBUG

public static boolean DEBUG
Method Detail

getInstance

public static SfManager getInstance()

init

public void init(android.content.Context context)
Description copied from interface: SfManager
Initializes the Splitforce library. Data will be synced with the Splitforce servers.

Specified by:
init in interface SfManager
Parameters:
context - Your app's context from Activity or Application

initExperiment

public void initExperiment(java.lang.String name,
                           boolean forceReload,
                           SfListener listener)
Description copied from interface: SfManager
* Initializes a Spilitforce Experiment from the manifest stored on the device. Implementors of SfListener will receive a callback to SfListener.onInitExperiment(com.splitforce.lib.SfVariation)

Specified by:
initExperiment in interface SfManager
Parameters:
name - The name of the experiment
forceReload - Load a new variation even if one was previously loaded.
listener - implementation of the listener.

initExperiment

public void initExperiment(java.lang.String name,
                           SfListener listener)
Description copied from interface: SfManager
Initializes a Splitforce Experiment from the manifest stored on the device. Implementers of SfListener will receive a callback to SfListener.onInitExperiment(com.splitforce.lib.SfVariation)

Specified by:
initExperiment in interface SfManager
Parameters:
name - The name of the experiment
listener - implementation of the listener

getExperiment

public SfVariation getExperiment(java.lang.String name)
Description copied from interface: SfManager
Retrieve an experiment that was previously initialized.

Specified by:
getExperiment in interface SfManager
Parameters:
name - The name of the experiment.
Returns:
SplitforceVariation or null

getContext

public android.content.Context getContext()
Specified by:
getContext in interface SfManager

isInitialized

public boolean isInitialized()
Description copied from interface: SfManager
Determines if Splitforce sdk is initialized.

Specified by:
isInitialized in interface SfManager
Returns:
true if initialized otherwise false.

setDebug

public SplitforceManager setDebug(boolean debug)
Description copied from interface: SfManager
Turn debug mode on or off. The library logs a lot more in debug mode.

Specified by:
setDebug in interface SfManager
Parameters:
debug - flag
Returns:
the SplitforceManager instance for method chaining

setAppId

public SplitforceManager setAppId(java.lang.String appId)
Specified by:
setAppId in interface SfManager

setAppPassword

public SplitforceManager setAppPassword(java.lang.String appPassword)
Specified by:
setAppPassword in interface SfManager

getAppId

public java.lang.String getAppId()
Specified by:
getAppId in interface SfManager

getAppPassword

public java.lang.String getAppPassword()
Specified by:
getAppPassword in interface SfManager