Android Open Source - CustomersChoice Customers Choice Application






From Project

Back to project page CustomersChoice.

License

The source code is released under:

Apache License

If you think the Android project CustomersChoice listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package de.alosdev.android.customerschoice.demo;
/*  w w w. j  ava 2  s  .  c o  m*/
import android.app.Application;
import de.alosdev.android.customerschoice.CustomersChoice;
import de.alosdev.android.customerschoice.CustomersChoice.LifeTime;
import de.alosdev.android.customerschoice.VariantBuilder;
import de.alosdev.android.customerschoice.logger.AndroidLogger;
import de.alosdev.android.customerschoice.logger.NoLogger;
import de.alosdev.android.customerschoice.reporter.LogReporter;
import de.alosdev.customerschoice.demo.R;


public class CustomersChoiceApplication extends Application {
  @Override
  public void onCreate() {
    super.onCreate();

    final AndroidLogger androidLogger = new AndroidLogger();
    CustomersChoice.addLoggers(androidLogger, new NoLogger());
    CustomersChoice.addReporters(new LogReporter(androidLogger));
    CustomersChoice.addVariant(new VariantBuilder("buttonColor").setSpreading(new int[] { 50, 50 }).build());
    CustomersChoice.addVariant(new VariantBuilder("Variant2").setSpreading(new int[] { 5, 50 }).build());
    CustomersChoice.configureByResource(this, R.string.test_config);
    CustomersChoice.configureBySD(getPackageName() + ".conf");
    /*
    fileName: de.alosdev.customerschoice.demo.conf put on the SDcard root with conent:
    {"variants":
    [
    {"startTime": 51, "spreading": [ 1, 2], "name": "sd_conf_1" },
    {"endTime": 53, "spreading": [ 3, 3], "name": "sd_conf_2" }
    ]
    }
     */

    CustomersChoice.configureByNetwork(this,
      "https://raw.github.com/alosdev/CustomersChoice/master/sample/files/customerschoice.net.conf");
    CustomersChoice.setLifeTimeForVariants(this, LifeTime.Persistent);
  }
}




Java Source Code List

de.alosdev.android.customerschoice.CustomersChoice.java
de.alosdev.android.customerschoice.VariantBuilder.java
de.alosdev.android.customerschoice.Variant.java
de.alosdev.android.customerschoice.broadcast.OverwriteVariantBroadCastReceiver.java
de.alosdev.android.customerschoice.demo.CustomersChoiceApplication.java
de.alosdev.android.customerschoice.demo.CustomersChoiceDemo.java
de.alosdev.android.customerschoice.demo.ShoppingCardActivity.java
de.alosdev.android.customerschoice.logger.AndroidLogger.java
de.alosdev.android.customerschoice.logger.ChainedLogger.java
de.alosdev.android.customerschoice.logger.Logger.java
de.alosdev.android.customerschoice.logger.NoLogger.java
de.alosdev.android.customerschoice.reporter.ChainedReporter.java
de.alosdev.android.customerschoice.reporter.LogReporter.java
de.alosdev.android.customerschoice.reporter.NoReporter.java
de.alosdev.android.customerschoice.reporter.Reporter.java