A feature flag framework for Android using Kotlin and Jetpack Compose

Overview

Feature Flags Debug Menu

Feature Flags are essential for software development and release management

This work is inspired and is an update and improvement (in my opinion) of the original Feature Flags architecture done by Joeren Mols

  • UI was built with Jetpack Compose
  • Dependency Injection was added using Hilt
  • Several components were renamed and completely re-imagined
  • TestFeatureFlagProvider moved to test source set and configured to easily enable or disable feature but still used with FeatureManager
  • FeatureManager will be used in Test but a different instance will be injected. The test instance will remove all the other providers and keep only TestFeatureFlagProvider
  • Removed the priority system as it was ambiguous and was adding complexity
  • Added an exclusion system to enforce uniqueness of Flags provider by provider
  • Created specific types of feature flags for each provider except Local provider which can provider feature from other providers in debug mode.

Screenshots

Architecture implementation

Feature

A Feature uniquely identifies a part of the app code that can either be enabled or disabled. Features only have two states by design to simplify the implementation

Feature Manager

Check whether a feature is enabled or not. Will first look into the providers to see which one has the feature Normally, based on how the framework is built, two provider should provide the same feature flag at the same time That would be a violation of the design. Each provider should provider a pool of feature flags that are different from what the providers are providing.

Feature Flag Providers

Every provider has an explicit priority so they can override each other (e.g. "Remote Config tool" > Store). Not every provider has to provide a flag value for every feature. This is to avoid implicitly relying on build-in defaults (e.g. "Remote Config tool" returns false when no value for a feature) and to avoid that every provider has to provide a value for every feature. (e.g. no "Remote Config tool" configuration needed, unless you want the toggle to be remote)

Firebase Feature Flag Provider

Provider of feature flags set up on Firebase Remote Config. Usually used in production for toggling mobile feature. Used by both mobile engineers and product managers This is refreshable because Firebase Remote Configs can be refresh programmatically from the app code

Server Feature Flag Provider

Provider of Feature Flags own by the backend. These feature flags are based on business logic. The one implemented in this repository is purely fictional. A real world implementation might look very different.

Local Feature Flag Provider

Provides all possible feature flags in the system. This include RemoteConfigFlag, ServerFlag and its own DebugConfig. This is the priority feature flag provider for a Debug build It has the ability to enable FirebaseFeatureFlagProvider and ServerFeatureFlagProvider and when that's the case, the flags provided by those provider are just ignored (excluded) This provider is the one that is used to build and auto-generate the debug menu It is `UpdatableFeatureFlagProvider because these flags can be turned on/off from the debug menu

Inspired by

You might also like...
A minimalist framework for rapidly building Jetpack compose apps.
A minimalist framework for rapidly building Jetpack compose apps.

VelocityX Show some ❤️ and star the repo. Subscribe to Codepur VelocityX is a 100% free Jetpack open-source minimalist UI Framework built with Kotlin

Compose-navigation - Set of utils to help with integrating Jetpack Compose and Jetpack's Navigation

Jetpack Compose Navigation Set of utils to help with integrating Jetpack Compose

Learn Jetpack Compose for Android by Examples. Learn how to use Jetpack Compose for Android App Development. Android’s modern toolkit for building native UI.
Learn Jetpack Compose for Android by Examples. Learn how to use Jetpack Compose for Android App Development. Android’s modern toolkit for building native UI.

Learn Jetpack Compose for Android by Examples. Learn how to use Jetpack Compose for Android App Development. Android’s modern toolkit for building native UI.

List-programminglanguage-compose - Simple implementation of a list of programming languages using LazyColumn and Coil in Jetpack Compose A Simple Blog App using Jetpack Compose, Flow, Navigation Compose, Room and Firebase
A Simple Blog App using Jetpack Compose, Flow, Navigation Compose, Room and Firebase

BlogCompose A Simple Blog App using Jetpack Compose, Flow, Navigation Compose, Room and Firebase Instructions Download your Firebase configuration fil

Jetpack-compose-animations-examples - Cool animations implemented with Jetpack compose
Jetpack-compose-animations-examples - Cool animations implemented with Jetpack compose

Jetpack-compose-animations-examples This repository consists of 4 animations: St

Compose-Instagram-Profile-UI - Instagram profile screen UI using android jetpack compose
Compose-Instagram-Profile-UI - Instagram profile screen UI using android jetpack compose

Compose-Intsgram-Profile-UI Instagram profile screen UI using android jetpack co

Fractal Trees 🌴 using recursion | Demonstrated using Jetpack Compose 🚀

Fractal Trees 📜 Description Implementing Fractal Trees 🌴 with recursion ➰ and using Jetpack Compose to demonstrate it 🚀 💡 Motivation and Context H

Koin-compose - A pragmatic lightweight dependency injection framework for Kotlin developers
Koin-compose - A pragmatic lightweight dependency injection framework for Kotlin developers

What is KOIN? - https://insert-koin.io A pragmatic lightweight dependency inject

Owner
Rygel Louv
Software Engineer | Android, Kotlin, Python, and some Flutter.
Rygel Louv
Highly experimental routing feature for Compose Web

RoutingCompose Highly experimental routing feature for Compose Web Install This package is uploaded to GitHub Packages. repositories { maven {

Philip Wedemann 86 Dec 20, 2022
Jetpack Compose Boids | Flocking Insect 🐜. bird or Fish simulation using Jetpack Compose Desktop 🚀, using Canvas API 🎨

?? ?? ?? Compose flocking Ants(boids) ?? ?? ?? Jetpack compose Boids | Flocking Insect. bird or Fish simulation using Jetpack Compose Desktop ?? , usi

Chetan Gupta 38 Sep 25, 2022
Jetpack-compose-uis - A collection of some UIs using Jetpack Compose. built using Katalog

Jetpack Compose UIs This is a collection of some UIs using Jetpack Compose. It i

Mori Atsushi 3 Dec 15, 2022
🚀📒📍 Indicators for Horizontal or Vertical Pager with different orientation, color, size options and optional touch feature.

Compose Pager Indicator Indicators for Horizontal or Vertical pager with different orientation, color, size options and optional touch feature. indica

Smart Tool Factory 5 Oct 7, 2022
A framework for building responsive Android apps using Jetpack Compose

Jetmagic - A framework for building responsive Android apps using Jetpack Compose Jetmagic is an Android framework that can be used to develop respons

Johann Blake 93 Dec 17, 2022
A collection of animations, compositions, UIs using Jetpack Compose. You can say Jetpack Compose cookbook or play-ground if you want!

Why Not Compose! A collection of animations, compositions, UIs using Jetpack Compose. You can say Jetpack Compose cookbook or play-ground if you want!

Md. Mahmudul Hasan Shohag 186 Jan 1, 2023
This is a sample app(For beginners - App #2) built using Jetpack Compose. It demonstrates the concept of State Hoisting in Jetpack Compose.

JetBMICalculator This is a sample app(For beginners - App #2) built using Jetpack Compose. It demonstrates the concept of State Hoisting in Jetpack Co

BHAVNA THACKER 3 Dec 31, 2022
Jetpack-Compose-Demo - Instagram Profile UI using Jetpack Compose

Jetpack-Compose-Demo Instagram Profile UI using Jetpack Compose

omar 1 Aug 11, 2022
Ecormmerce app built using Android latest UI framework - Compose UI and data coming from Fake Store API

BuyCart ?? Android shopping app built with Jetpack Compose consuming FAKE STORE API I am trying to learn and follow some standard Android architecture

Henry Udorji 4 Aug 5, 2022
Particle clock created with Jetpack Compose framework

Jetpack Compose Particle Clock made with Jetpack Compose This project is inspired by Flutter Particle Clock. License Copyright 2018 Adib Faramarzi. Li

Adib Faramarzi 366 Dec 29, 2022