GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - splitio/android-thin-client

BranchesTags
Open more actions menu

Latest commit

 

History

7 Commits
7 Commits

Folders and files

NameName
Last commit message
Last commit date
.githooks
.githooks
 
 
.harness
.harness
 
 
android-client @ 894237a
android-client @ 894237a
 
 
android-thin-client
android-thin-client
 
 
api
api
 
 
auth
auth
 
 
cdn-bypass
cdn-bypass
 
 
e2e
e2e
 
 
evaluation
evaluation
 
 
events-tracking
events-tracking
 
 
gradle
gradle
 
 
models
models
 
 
observer
observer
 
 
persistence-domain
persistence-domain
 
 
persistence
persistence
 
 
retryable-http-client
retryable-http-client
 
 
sdk
sdk
 
 
secure-http-client
secure-http-client
 
 
streaming-thin
streaming-thin
 
 
.gitignore
.gitignore
 
 
.gitmodules
.gitmodules
 
 
CHANGES.txt
CHANGES.txt
 
 
CONTRIBUTORS-GUIDE.md
CONTRIBUTORS-GUIDE.md
 
 
LICENSE.txt
LICENSE.txt
 
 
NOTICE.txt
NOTICE.txt
 
 
README.md
README.md
 
 
build.gradle.kts
build.gradle.kts
 
 
gradle.properties
gradle.properties
 
 
gradlew
gradlew
 
 
gradlew.bat
gradlew.bat
 
 
settings.gradle.kts
settings.gradle.kts
 
 

Repository files navigation

Harness FME Thin Client SDK for Android

Overview

This SDK is designed to work with Harness FME, the platform for controlled rollouts, which serves features to your users via feature flags to manage your complete customer experience.

The thin client delegates flag evaluation to the Remote Evaluator service.

Compatibility

This SDK is compatible with Android SDK versions 21 and later (5.0 Lollipop).

Getting started

Below are simple examples that describe the instantiation and most basic usage of the SDK.

Kotlin

val sdkKey = SdkKey("YOUR_SDK_KEY")
val key = Key(matchingKey = "CUSTOMER_ID")
val target = Target(key = key, trafficType = "user")

val config = splitClientConfig {
    logLevel = SplitClientConfig.LogLevel.DEBUG
    filters {
        flagSets = setOf("my_flag_set")
    }
    fallbackTreatments {
        global("off")
        byFlagStrings(mapOf("FEATURE_FLAG_NAME" to "on"))
    }
}

val splitFactory = SplitFactoryBuilder.build(
    context = applicationContext,
    sdkKey = sdkKey,
    defaultTarget = target,
    config = config,
)

val splitClient = splitFactory.getClient()

splitClient.addEventListener(object : SplitEventListener() {
    override fun onReady(client: SplitClient, metadata: SdkReadyMetadata?) {
        val result = client.getTreatment("FEATURE_FLAG_NAME")

        when (result.treatment) {
            "on"  -> Log.i("TAG", "I'm ON")
            "off" -> Log.i("TAG", "I'm OFF")
            else  -> Log.i("TAG", "CONTROL was returned, there was an error")
        }
    }

    override fun onReadyView(client: SplitClient, metadata: SdkReadyMetadata?) {
        Log.i("TAG", "Do some UI work")
    }

    override fun onUpdate(client: SplitClient, metadata: SdkUpdateMetadata?) {
        val updatedFlags = metadata?.names ?: return
        val results = client.getTreatments(updatedFlags)
        results.forEach { result ->
            Log.i("TAG", "Flag ${result.flag} updated, new treatment: ${result.treatment}")
        }
    }
})

Java

SdkKey sdkKey = new SdkKey("YOUR_SDK_KEY");
Key key = new Key("CUSTOMER_ID");
Target target = new Target(key, new HashMap<>(), "user");

SplitClientConfig config = new SplitClientConfig.Builder()
    .logLevel(SplitClientConfig.LogLevel.DEBUG)
    .filters(new SplitClientConfig.FiltersConfig.Builder()
        .flagSets(new HashSet<>(Collections.singletonList("my_flag_set")))
        .build())
    .fallbackTreatments(FallbackTreatmentsConfiguration.builder()
        .global("off")
        .byFlagStrings(Collections.singletonMap("FEATURE_FLAG_NAME", "on"))
        .build())
    .build();

SplitFactory splitFactory = SplitFactoryBuilder.build(
    getApplicationContext(),
    sdkKey,
    target,
    config
);

SplitClient splitClient = splitFactory.getClient(null);

splitClient.addEventListener(new SplitEventListener() {
    @Override
    public void onReady(SplitClient client, SdkReadyMetadata metadata) {
        EvaluationResult result = client.getTreatment("FEATURE_FLAG_NAME");

        if (result.getTreatment().equals("on")) {
            Log.i("TAG", "I'm ON");
        } else if (result.getTreatment().equals("off")) {
            Log.i("TAG", "I'm OFF");
        } else {
            Log.i("TAG", "CONTROL was returned, there was an error");
        }
    }

    @Override
    public void onReadyView(SplitClient client, SdkReadyMetadata metadata) {
        Log.i("TAG", "Do some UI work");
    }

    @Override
    public void onUpdate(SplitClient client, SdkUpdateMetadata metadata) {
        if (metadata == null || metadata.getNames() == null) return;
        List<EvaluationResult> results = client.getTreatments(metadata.getNames());
        for (EvaluationResult result : results) {
            Log.i("TAG", "Flag " + result.getFlag() + " updated, new treatment: " + result.getTreatment());
        }
    }
});

Submitting issues

The team monitors all issues submitted to this issue tracker. We encourage you to use this issue tracker to submit any bug reports, feedback, and feature enhancements. We'll do our best to respond in a timely manner.

License

Licensed under the Apache License, Version 2.0. See: Apache License.

About

No description, website, or topics provided.

Resources

Readme
Apache-2.0 license
Activity
Custom properties

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.