public class ApptimizeOptions
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
ApptimizeOptions.LogLevel
When used as an argument to
setLogLevel(com.apptimize.ApptimizeOptions.LogLevel) ,
Apptimize will log all messages of the given importance or higher |
Constructor and Description |
---|
ApptimizeOptions() |
Modifier and Type | Method and Description |
---|---|
ApptimizeOptions |
disableVisualChangesAndThirdPartyEventImport()
Helper function to turn off visual changes (e.g.
|
java.lang.String |
getDeviceName() |
ApptimizeOptions.LogLevel |
getLogLevel() |
java.lang.Long |
getUpdateMetaDataTimeout() |
boolean |
isDeveloperModeDisabled() |
boolean |
isExplicitEnablingRequired() |
boolean |
isMultiprocessModeEnabled() |
boolean |
isThirdPartyEventExportingEnabled() |
boolean |
isThirdPartyEventImportingEnabled() |
boolean |
isVisualChangesEnabled() |
ApptimizeOptions |
setDeveloperModeDisabled(boolean developerModeDisabled)
A device in developer mode can be connected to the Apptimize dashboard in order to create
visual variants and metrics or try out different variants in real-time.
|
ApptimizeOptions |
setDeviceName(java.lang.String deviceName)
Set the name of the device which will appear when connecting to the Visual Apptimizer.
|
ApptimizeOptions |
setExplicitEnablingRequired(boolean explicitEnablingRequired)
By default, this is set to false, in which case visual variants and metrics (which can be setup through the
Visual Apptimizer) are allowed on any
Activity . |
ApptimizeOptions |
setLogLevel(ApptimizeOptions.LogLevel logLevel)
Allows you to tune Apptimize's log level.
|
ApptimizeOptions |
setMultiprocessMode(boolean multiprocessMode)
Allows Apptimize to run in every process of an app with multiple processes.
|
ApptimizeOptions |
setThirdPartyEventExportingEnabled(boolean enabled)
Allows Apptimize to export events to 3rd party analytics services.
|
ApptimizeOptions |
setThirdPartyEventImportingEnabled(boolean enabled)
Allows Apptimize to import 3rd party analytics events.
|
ApptimizeOptions |
setUpdateMetadataTimeout(long updateMetadataTimeout)
Setting this option indicates to Apptimize that it is okay to wait for
the specified amount of time to receive the first metadata update.
|
ApptimizeOptions |
setVisualChangesEnabled(boolean enabled)
Allows Apptimize for visual changes (e.g.
|
public java.lang.Long getUpdateMetaDataTimeout()
public java.lang.String getDeviceName()
public boolean isDeveloperModeDisabled()
public boolean isExplicitEnablingRequired()
public ApptimizeOptions.LogLevel getLogLevel()
public boolean isMultiprocessModeEnabled()
public boolean isVisualChangesEnabled()
public boolean isThirdPartyEventImportingEnabled()
public boolean isThirdPartyEventExportingEnabled()
public ApptimizeOptions setUpdateMetadataTimeout(long updateMetadataTimeout)
Setting this option indicates to Apptimize that it is okay to wait for the specified amount of time to receive the first metadata update. If not set, Apptimize will not wait.
Apptimize receives metadata that indicates whether this device is
allocated to any currently running A/B tests and, if so, which variant of
each test the device is allocated to. Methods like
Apptimize.runTest(String, ApptimizeTest, ApptimizeOptions)
or
Apptimize.stringForTest(String, String, ApptimizeOptions)
behave differently depending on which tests the device belongs to. If
these methods are run before Apptimize has received its first metadata
update, since Apptimize cannot determine if the user is allocated to the
test, it will fall back to the default behavior and assume the user is
not allocated to the test.
Setting this option indicates that in this scenario, Apptimize should
wait the specified amount of time to receive the first metadata update.
This option is especially useful if you will be calling methods like
Apptimize.runTest(String, ApptimizeTest, ApptimizeOptions)
or
Apptimize.stringForTest(String, String, ApptimizeOptions)
soon after you have called
Apptimize.setup(android.content.Context, String)
.
Note that updateMetadataTimeout
is a maximum, in milliseconds, of
the amount of time we are willing to wait. As soon as Apptimize receives
metadata, it will stop waiting. If Apptimize has already received
metadata in the past, it will not wait at all. The parameter will be
capped at a maximum value of 5000 (i.e., 5 seconds). If
updateMetadataTimeout
is set to the special values of 0 or
negative numbers, Apptimize will use the maximum value of 5000 (i.e., 5
seconds)
updateMetadataTimeout
- The maximum amount of time, in milliseconds, that Apptimize is
allowed to wait for the initial metadata.ApptimizeOptions
object.public ApptimizeOptions setDeveloperModeDisabled(boolean developerModeDisabled)
A device in developer mode can be connected to the Apptimize dashboard in order to create visual variants and metrics or try out different variants in real-time.
By default, Apptimize will put a device into developer mode if the app is debug-signed. Setting this option to true will override this behavior, causing the device to never connect to the Apptimize dashboard.
developerModeDisabled
- Whether developer mode should be disabledApptimizeOptions
objectpublic ApptimizeOptions setDeviceName(java.lang.String deviceName)
Set the name of the device which will appear when connecting to the Visual Apptimizer. If null, Apptimize will generate a name based on the device model and a random unique identifier.
deviceName
- The device name, or nullApptimizeOptions
objectpublic ApptimizeOptions setExplicitEnablingRequired(boolean explicitEnablingRequired)
By default, this is set to false, in which case visual variants and metrics (which can be setup through the
Visual Apptimizer) are allowed on any Activity
.
If you set this option to true, visual variants and metrics will only be allowed for an
Activity
if you have explicitly enabled it by annotating it
with ApptimizeExplicitlyEnabled
.
explicitEnablingRequired
- Whether visual variants and metrics should only be allowed when explicitly enabled for an
Activity
.ApptimizeOptions
objectpublic ApptimizeOptions setLogLevel(ApptimizeOptions.LogLevel logLevel)
Allows you to tune Apptimize's log level. By default, Apptimize contains a moderate amount of logging about its operations such as reporting when a user is enrolled in experiments. With this option, you can limit Apptimize to only log errors and exceptional circumstances. Note that you will still be able to view the Apptimize logs through the Advanced Verify feature on the Apptimize dashboard. By default, this is set to LogLevel.VERBOSE.
logLevel
- A ApptimizeOptions.LogLevel
specifying that Apptimize will only
output log messages of importance logLevel
or higherApptimizeOptions
objectpublic ApptimizeOptions disableVisualChangesAndThirdPartyEventImport()
Helper function to turn off visual changes (e.g. hotfixes and visual experiments) and automatic third-party event imports.
Also seesetVisualChangesEnabled(boolean)
and setThirdPartyEventImportingEnabled(boolean)
ApptimizeOptions
objectpublic ApptimizeOptions setMultiprocessMode(boolean multiprocessMode)
Allows Apptimize to run in every process of an app with multiple processes. If most of your app is in one process, and you only need to test in that process, you do not need to use this option. You should only use this option if your app is split across multiple Android proccesses. Very few apps will need to use this option, as Google itself recommends against designing apps this way (see official documentation). Use of this option comes with some performance penalty, due to the increased synchronization required.
multiprocessMode
- Whether Apptimize should be allowed to run in multiple processes, thereby requiring additional synchronizationApptimizeOptions
objectpublic ApptimizeOptions setVisualChangesEnabled(boolean enabled)
Allows Apptimize for visual changes (e.g. hotfixes and visual experiments).
enabled
- defaults to true. Set to false to disable visual changes.
ApptimizeOptions
objectpublic ApptimizeOptions setThirdPartyEventImportingEnabled(boolean enabled)
Allows Apptimize to import 3rd party analytics events.
enabled
- defaults to true. Set to false to prevent automatic importing of other 3rd party analytic events.ApptimizeOptions
object
public ApptimizeOptions setThirdPartyEventExportingEnabled(boolean enabled)
Allows Apptimize to export events to 3rd party analytics services.
enabled
- defaults to true. Set to false to prevent automatic exporting of our events to 3rd party analytics services.ApptimizeOptions
object