<commit_before>AB Tester for Amazon AB Testing SDK
==============
AB testing wrapper library for the Amazon AB Testing SDK for Android. Adds interface improvements and new features to the existing sdk. The primamry interface improvements allow a much easier integration in existing code as it doesn't require implementation of callbacks and dealing with waiting for variation values.
Features:
- Pre-fetching of experiments + non blocking methods for getting the pre-fetched variable values later in the code.
- Support for tracking of unique events and goals
- Support for setting a default value for variables for when the API isn't available, times out, or when a test is over.
- Sync fetching of experiments with configurable timeout and fallback to a default value
- Ability to lock variable values so that current users won't be affected by launch configurations of winning variants
- Ability to segment percentage of the users to each project.

Setup
==============

- Download the latest *AmazonInsights-android-sdk* jar to the bin folder (tested with AmazonInsights-android-sdk-2.1.16.jar) from https://developer.amazon.com/public/apis/manage/ab-testing
- Import the project to eclipse
- Add this project as a library to your project
- There are classes *ABTester* and *SafeABTester*, the safe class contains try-catch for all the method calls, an error will be logged to the instance logger

progard
--------------
if you use progard, add those lines, other wise it won't compile (still don't know why)

	keep class com.amazon.** { *; }
	dontwarn com.amazon.**


Code samples
==============

Initialization 
--------------
must be called first (first Activity or Application)

	ABTesterSafe.init(this, "publickey", "privatekey", new DefualtLogger());
	
Prefetching
--------------
Fetch the test and the desired variables

sync fetching with timeout:

	try {
		ABTesterSafe.syncPreFetch(msTimeout, new ABTest("SampleProject", false, "TITLE","RED_BTN","BLUE_BTN"));
	} catch (TimeoutException e) {
	}
	
If the timeout is reached before the values are fetched, the user won't be part of the test (won't report events and goals)
	
async:

	ABTesterSafe.preFetch( new ABTest("SampleProject", false, "TITLE","RED_BTN","BLUE_BTN") );
	
The Async method can be used in a splash screen or early in the App's launch sequence to pre fetch the tests and use it later in the code without blocking. 
	
Getting the value
--------------

	String s = ABTesterSafe.getString("SampleProject","WANT_BTN","want");
	Long s = ABTesterSafe.getLong("SampleProject","SPEED",90);
	
Events
--------------
Store non unique event:<commit_msg>README fixes<commit_after>AB Tester for Amazon AB Testing SDK
==============
AB testing wrapper library for the Amazon AB Testing SDK for Android. Adds interface improvements and new features to the existing sdk. The primamry interface improvements allow a much easier integration in existing code as it doesn't require implementation of callbacks and dealing with waiting for variation values.
Features:
- Pre-fetching of experiments + non blocking methods for getting the pre-fetched variable values later in the code.
- Support for tracking of unique events and goals
- Support for setting a default value for variables for when the API isn't available, times out, or when a test is over.
- Sync fetching of experiments with configurable timeout and fallback to a default value
- Ability to lock variable values so that current users won't be affected by launch configurations of winning variants
- Ability to segment percentage of the users to each project.

Setup
==============

- Download the latest *AmazonInsights-android-sdk* jar to the bin folder (tested with AmazonInsights-android-sdk-2.1.16.jar) from https://developer.amazon.com/public/apis/manage/ab-testing
- Import the project to eclipse
- Add this project as a library to your project

progard
--------------
if you use progard, add those lines, other wise it won't compile (still don't know why)

	keep class com.amazon.** { *; }
	dontwarn com.amazon.**


Code samples
==============

Initialization 
--------------
must be called first (first Activity or Application)

	ABTester.init(this, "publickey", "privatekey", new DefualtLogger());
	
Prefetching
--------------
Fetch the test and the desired variables

sync fetching with timeout:

	try {
		ABTesterSafe.syncPreFetch(msTimeout, new ABTest("SampleProject", false, "TITLE","RED_BTN","BLUE_BTN"));
	} catch (TimeoutException e) {
	}
	
If the timeout is reached before the values are fetched, the user won't be part of the test (won't report events and goals)
	
async:

	ABTesterSafe.preFetch( new ABTest("SampleProject", false, "TITLE","RED_BTN","BLUE_BTN") );
	
The Async method can be used in a splash screen or early in the App's launch sequence to pre fetch the tests and use it later in the code without blocking. 
	
Getting the value
--------------

	String s = ABTesterSafe.getString("SampleProject","WANT_BTN","want");
	Long s = ABTesterSafe.getLong("SampleProject","SPEED",90);
	
Events
--------------
Store non unique event:
{'fraction_non_alphanumeric': 0.1082464081873647, 'fraction_numerical': 0.002361739814997048, 'mean_word_length': 4.102409638554217, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6729236', 'n_tokens_mistral': 1378, 'n_tokens_neox': 1286, 'n_words': 635}