.. This file was automatically generated by RstDoclet. Do not touch. .. _AbTesting: AbTesting ========= Scopely A/B testing client. It allows you to get the values for the variants this device is enrolled into. Public methods -------------- getInstance() ^^^^^^^^^^^^^ Initializes the AbTesting client. ---------- getEnrollmentsValues() ^^^^^^^^^^^^^^^^^^^^^^ Synchronously retrieves a dictionary of values for the variants this device got enrolled and caches them for further use via ``getValue`` methods. This method throws a ``AbTestingException`` if something went wrong. This cannot be run in the UI-Thread or an exception will be thrown. **Example** Retrieves the value of the key ``label_msg``: .. code-block:: java AbTesting abTesting = AbTesting.getInstance(); Map dict = abTesting.getEnrollmentsValues(); String labelMsg = dict.get("label_msg"); ---------- getEnrollmentsValues(AbTestValuesListener abTestValuesListener) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Asynchronously retrieves a dictionary of values for the variants this device got enrolled. - ``abTestValuesListener`` a callback object used to notify success or error **Example** Retrieves the value of the key ``label_msg``: .. code-block:: java AbTesting abTesting = AbTesting.getInstance(); abTesting.getEnrollmentsValues(new AbTestValuesListener() { @Override public void onValuesReceived(Map values) { String labelMsg = values.get("label_msg"); } @Override public void onError(String message) { // something wrong happened } }); ---------- getValueOr(String key, String defaultValue) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Returns the value of the provided ``key`` or ``defaultValue`` if none was found ---------- getValue(String key) ^^^^^^^^^^^^^^^^^^^^ Returns the value of the provided ``key`` or ``null`` if none was found