Skip to content

Add FeatBit Kotlin/Android client SDK (port of .NET client SDK) - #1

Merged
alexheidl merged 2 commits into
mainfrom
feat/initial-kotlin-sdk
Jun 9, 2026
Merged

Add FeatBit Kotlin/Android client SDK (port of .NET client SDK)#1
alexheidl merged 2 commits into
mainfrom
feat/initial-kotlin-sdk

Conversation

@alexheidl

Copy link
Copy Markdown
Contributor

What

A native Kotlin/Android client-side SDK for FeatBit — a port of FeatBit's official .NET client SDK, since FeatBit ships no Kotlin SDK and our production app is native Kotlin.

Highlights

  • FBClient with suspend start() / identify() and synchronous typed variations (boolVariation, stringVariation, int/float/double, + *Detail)
  • Polling data synchronizer (coroutine loop), thread-safe in-memory store, evaluator
  • FlagTracker: .NET-style listener API plus a flagChanges: Flow for coroutine/Compose consumers
  • Offline mode + bootstrap; insight (analytics) tracking
  • OkHttp + kotlinx.serialization; public API takes plain String URLs (no OkHttp type leak)
  • Android library (AAR), minSdk 21, JVM target 11, Gradle wrapper 8.9

Testing

  • 28 unit tests (JUnit4 + OkHttp MockWebServer + Turbine), all passing
  • Verified locally: ./gradlew :featbit-client:testDebugUnitTest :featbit-client:assembleRelease :example-app:assembleDebug — green; AAR + example APK build

Notes / follow-ups

  • v1 syncs via polling (faithful to the .NET SDK); WebSocket streaming is a roadmap item
  • End-to-end tests against a real FeatBit stack (Testcontainers) are a follow-up in progress
  • Deviations from a strict port: explicitApi() not enforced; tests use JUnit4 (AGP-native)

🤖 Generated with Claude Code

alexheidl and others added 2 commits June 9, 2026 11:07
Port of FeatBit's official .NET client-side SDK to an idiomatic Kotlin/Android
library, since FeatBit ships no native Kotlin SDK and our production app is
native Kotlin.

- FBClient with suspend start()/identify() and synchronous typed variations
- Polling data synchronizer (coroutine loop), in-memory store, evaluator
- FlagTracker: listener API + flagChanges Flow
- OkHttp + kotlinx.serialization; String-based URLs (no OkHttp type leak)
- 28 unit tests (JUnit4 + MockWebServer + Turbine), all passing
- Example app + Gradle wrapper (8.9)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Modeled on the gravitee-policy-token-exchange CI (Temurin JDK, dependency
caching, sequential test -> build -> upload-artifact), adapted from Maven to
this Gradle/Android build. Triggers on pull_request only; release automation
is intentionally omitted.

- Unit tests (:featbit-client:testDebugUnitTest)
- Assemble library AAR + example app
- Upload AAR and unit test report artifacts

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@alexheidl
alexheidl merged commit af742f4 into main Jun 9, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant