This module houses the demo app used to demonstrate how to get started with the Android SDK. The app is also used to run integration tests with the Android Espresso framework.
We run the following experiment:
- Background change in second activity, which is loaded after the splash screen.
The SDK is implemented in the following way:
- The splash screen initializes the Optimizely manager asynchronously. This starts the datafile fetch.
- Once the datafile is fetched and the Optimizely manager is started, we grab the
optimizelyClient
from the manager and use it to activate the experiment namedbackground_experiment
. This buckets the user and sends an impression event. - We then use the bucketed variation to determine which activity to show.
VariationAActivity
forvariation_a
,VariationBActivity
forvariation_b
, orActivationErrorActivity
for the control. - Each of the variation activities includes a
Test Conversion
button. - Clicking on that button will call
optimizelyClient.track()
and send a conversion event for the event namedsample_conversion
. - Then the application will navigate to the conversion page to confirm that a conversion event has been sent.
Run ./gradlew test-app:connectedAndroidTest
to run the Espresso tests.