GithubHelp home page GithubHelp logo

isabella232 / android-sdk-2 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from optimizely/android-sdk

0.0 0.0 0.0 4.08 MB

Optimizely X Android SDK

Home Page: https://developers.optimizely.com/x/solutions/sdks/introduction/index.html?language=android&platform=mobile

License: Apache License 2.0

Java 95.85% Shell 0.15% Kotlin 4.00%

android-sdk-2's Introduction

Optimizely Android SDK

Apache 2.0 Build Status

Overview

This repository houses the Android SDK for use with Optimizely Full Stack and Optimizely Rollouts. The Android SDK depends on the Optimizely Java SDK.

Optimizely Full Stack is A/B testing and feature flag management for product development teams. Experiment in any application. Make every feature on your roadmap an opportunity to learn. Learn more at https://www.optimizely.com/platform/full-stack/, or see the documentation.

Optimizely Rollouts is free feature flags for development teams. Easily roll out and roll back features in any application without code deploys. Mitigate risk for every feature on your roadmap. Learn more at https://www.optimizely.com/rollouts/, or see the documentation.

Getting Started

Using the SDK

See the Mobile developer documentation to learn how to set up an Optimizely X project and start using the SDK.

Requirements

  • Android API 14 or higher

Installing the SDK

To add the android-sdk and all modules to your project, include the following in your app's build.gradle:

repositories {
  	jcenter()
}

dependencies {
	implementation 'com.optimizely.ab:android-sdk:3.8.0'
}

Samples

A sample code for SDK initialization and experiments:

OptimizelyManager optimizelyManager = OptimizelyManager.builder()
            .withSDKKey("my_sdk_key")
            .withDatafileDownloadInterval(TimeUnit.MINUTES.toSeconds(15))
            .build(getApplicationContext());
            
optimizelyManager.initialize(this, null, (OptimizelyClient optimizely) -> {
	OptimizelyClient optimizely = optimizelyManager.getOptimizely();
	
	Variation variation = optimizely.activate("background_experiment", userId);
	
	optimizely.track("sample_conversion", userId);
});

Architecture

This project includes 5 library modules and a test app.

  1. Android SDK
  • Users who want all modules should declare a dependency on this module.
  • This is the outer module that depends on all other modules.
  • This builds Optimizely objects and provides all public APIs.
  1. Datafile Handler
  • This handles downloading the datafile from the Optimizely server.
  1. Event Handler
  • This handles dispatching events to the Optimizely server.
  • This uses a Service so events can be sent without the app being re-opened.
  • Events remain persistent until dispatching completed successfully.
  1. User Profile
  • Persistent bucketing
  • Once a user is bucketed in a variation, the user will remain in that variation.
  1. Shared
  • Common utils for all modules
  1. Test App
  • A simple app showing how to use the Optimizely Android SDK

Development

Command Line

  1. Clone the repo
  1. Create, or use an existing, Optimizely Android project
  2. Build the project (from the project root)
  • ./gradlew assemble
  1. Run tests for all modules
  • ./gradlew testAllModules
  • A device or emulator must be connected.
  1. Install the test app onto all connected devices and emulators
  • ./gradlew test-app:installDebug
  • The test app depends on all of the other project modules.
  • The modules are built from source.
  1. Discover more gradle tasks
  • ./gradlew tasks
  • To see the task of an individual module: ./gradlew user-profile:tasks

Android Studio

Android Studio is an IDE that wraps gradle. Everything you can do in Android Studio can be done from the command line tools.

You can import this project into Android Studio by opening Android Studio and selecting Import Project from the first dialog or from the File menu. Simply select the project's root build.gradle file and Android Studio will do the rest.

Tests can be run by right clicking the file in the project pane or by clicking the method name in source and selecting run. You will be prompted to create an AVD or connect a device if one isn't connected.

Contributing

Please see CONTRIBUTING.

Credits

First-party code (under android-sdk/, datafile-handler/, event-handler/, shared/, user-profile/) is copyright Optimizely, Inc. and contributors, licensed under Apache 2.0

Additional Code

This software incorporates code from the following open source projects:

Optimizely.ab:core-api https://github.com/optimizely/java-sdk License (Apache 2.0): https://github.com/optimizely/java-sdk/blob/master/LICENSE Additional credits from java-sdk:https://github.com/optimizely/java-sdk/blob/master/README.md

Android Logger https://github.com/noveogroup/android-logger License (Public Domain): https://github.com/noveogroup/android-logger/blob/master/LICENSE.txt

android-sdk-2's People

Contributors

thomaszurkan-optimizely avatar jophde avatar elliotykim avatar mikeproeng37 avatar mnoman09 avatar jaeopt avatar juancarlostong avatar wangjoshuah avatar oakbani avatar onufryk avatar ceimaj avatar aliabbasrizvi avatar fingertricks avatar jamesneimanconsulting avatar yuanc avatar nchilada avatar shihpatrick avatar fayyazarshad avatar msohailhussain avatar yasirfolio3 avatar zashraf1985 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.