Giter Club home page Giter Club logo

rotbolt / flaker Goto Github PK

View Code? Open in Web Editor NEW
226.0 3.0 10.0 15.53 MB

A flaky network simulator for your mobile app

Home Page: https://rotbolt.github.io/Flaker/

License: Apache License 2.0

Kotlin 96.43% Ruby 3.57%
android-library ios-library kmm kmm-library kotlin kotlin-library kotlin-multiplatform mobile mobile-development mobile-library network networking android datastore-preferences ios jetpack-compose jetpackdatastore sqldelight swiftui jetpackcompose

flaker's Introduction

๐Ÿšง Flaker ๐Ÿšง

flaker build Maven Central

Developing a mobile app that performs flawlessly in the real world requires thorough testing under a variety of network conditions. Introducing Flaker โ€“ your assistant tool for recreating real-world network scenarios directly in your mobile app development environment. ๐Ÿ“ฑ๐Ÿ’ก

What is Flaker?

Flaker is a network simulator designed to make your mobile app development process smoother and more efficient. With Flaker, you can effortlessly emulate a wide range of network conditions, enabling you to fine-tune your app's performance and ensure it delivers an exceptional user experience under any circumstance. ๐ŸŒ๐Ÿ› ๏ธ

Key Features:

Experience Slow Networks ๐Ÿข

Ever wondered how your app would perform on a slow and sluggish network? With Flaker, you can replicate these scenarios with ease. Test your app's responsiveness and optimize its behavior under adverse network conditions. ๐Ÿš€๐ŸŒ

Emulate Flaky Networks ๐Ÿ“ถ

Network connections in the real world are rarely stable. Flaker allows you to introduce fail percentage and variance controls, mirroring the unpredictable nature of network connections. Gain a firsthand understanding of the challenges your mobile app might face and ensure it remains resilient. ๐Ÿ”ฎ๐Ÿ”Œ

Focused Impact ๐ŸŽฏ

Flaker is designed to impact only your app's network conditions, leaving your device's overall network functionality undisturbed. This means you can test and fine-tune your app's performance without affecting your entire device's connectivity. ๐Ÿ“ก๐Ÿ”

Who Can Benefit from Flaker?

Whether you're a mobile app developer looking to enhance user experiences or a tester seeking to validate your app's resilience, Flaker provides an intuitive and indispensable tool within your development workflow. Elevate your testing strategies and boost your app's performance with Flaker.

Flaker empowers you to:

โœ… Test under various network conditions

โœ… Optimize your app for slow networks

โœ… Prepare your app for flaky network connections

โœ… Ensure your app's stability and reliability

โœ… Enhance user satisfaction and retention

Demo

๐Ÿ“บ Check out the to see Flaker in action.

flaker-android-demo.mov

Usage

Please refer to the ๐Ÿ“š docs for detailed usage instructions.

Built with

Kotlin: ๐Ÿš€ The primary programming language.

Kotlin Multiplatform: ๐Ÿ“ฑ๐Ÿ Sharing common logic across Android and iOS.

Jetpack Compose: ๐Ÿ–ผ๏ธ For building the UI for the Android companion app. Supports dynamic theming.

SqlDelight: ๐Ÿ“Š For a shared database and persistence layer between multiple platforms.

Jetpack DataStore: ๐Ÿ“ฆ For the shared persistence layer to store user preferences and configuration of Flaker.

Okhttp: ๐Ÿ“ก For creating Flaker for Android apps using Okhttp3 for networking.

Ktor: ๐ŸŒ For creating Flaker targeting both Android and iOS apps using Ktor for networking. (๐Ÿšง In Progress)

SwiftUI: ๐Ÿ For building the UI for the iOS UI. (๐Ÿšง In Progress)

Roadmap

  • flaker-android-okhttp
  • flaker-android-ktor
  • flaker-ios-ktor

Find this repository useful?

Support it by joining stargazers for this repository. โญ

Contributing

If you've found an error in this sample, please ๐Ÿšฉ file an issue.

Patches are encouraged and may be submitted by forking this project and submitting a pull request. Since this project is still in its very early stages, if your change is substantial, please raise an issue first to discuss it. ๐Ÿค

License

Copyright 2023 Rohan Maity

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

flaker's People

Contributors

rotbolt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

flaker's Issues

Can not move to preference screen in flaker app.

ava.lang.NoSuchMethodError: No interface method ExposedDropdownMenu(ZLkotlin/jvm/functions/Function0;Landroidx/compose/ui/Modifier;Lkotlin/jvm/f
	at io.github.rotbolt.flakerandroidui.screens.prefs.FlakerPrefsScreenKt$PrefDropDownItem$1$3.invoke(FlakerPrefsScreen.kt:214)
	at io.github.rotbolt.flakerandroidui.screens.prefs.FlakerPrefsScreenKt$PrefDropDownItem$1$3.invoke(FlakerPrefsScreen.kt:202)
	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:117)
	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35)
	at androidx.compose.material3.ExposedDropdownMenuKt.ExposedDropdownMenuBox(ExposedDropdownMenu.kt:169)
	at io.github.rotbolt.flakerandroidui.screens.prefs.FlakerPrefsScreenKt.PrefDropDownItem(FlakerPrefsScreen.kt:198)
	at io.github.rotbolt.flakerandroidui.screens.prefs.FlakerPrefsScreenKt.access$PrefDropDownItem(FlakerPrefsScreen.kt:1)
	at io.github.rotbolt.flakerandroidui.screens.prefs.FlakerPrefsScreenKt$FlakerPrefsDialog$3$1$1$1.invoke(FlakerPrefsScreen.kt:95)
	at io.github.rotbolt.flakerandroidui.screens.prefs.FlakerPrefsScreenKt$FlakerPrefsDialog$3$1$1$1.invoke(FlakerPrefsScreen.kt:94)
	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:117)
	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35)
	at androidx.compose.foundation.lazy.LazyListIntervalContent$item$3.invoke(LazyListIntervalContent.kt:59)
	at androidx.compose.foundation.lazy.LazyListIntervalContent$item$3.invoke(LazyListIntervalContent.kt:59)
	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:138)
	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35)
	at androidx.compose.foundation.lazy.LazyListItemProviderImpl$Item$1.invoke(LazyListItemProvider.kt:79)
	at androidx.compose.foundation.lazy.LazyListItemProviderImpl$Item$1.invoke(LazyListItemProvider.kt:77)
	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:108)
	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35)
	at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:248)
	at androidx.compose.foundation.lazy.layout.LazyLayoutPinnableItemKt.LazyLayoutPinnableItem(LazyLayoutPinnableItem.kt:58)
	at androidx.compose.foundation.lazy.LazyListItemProviderImpl.Item(LazyListItemProvider.kt:77)
	at androidx.compose.foundation.lazy.layout.LazyLayoutItemContentFactoryKt$SkippableItem$1.invoke(LazyLayoutItemContentFactory.kt:135)
	at androidx.compose.foundation.lazy.layout.LazyLayoutItemContentFactoryKt$SkippableItem$1.invoke(LazyLayoutItemContentFactory.kt:134)
	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:108)
	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35)
	at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:248)
	at androidx.compose.runtime.saveable.SaveableStateHolderImpl.SaveableStateProvider(SaveableStateHolder.kt:84)
	at androidx.compose.foundation.lazy.layout.LazySaveableStateHolder.SaveableStateProvider(LazySaveableStateHolder.kt:85)
	at androidx.compose.foundation.lazy.layout.LazyLayoutItemContentFactoryKt.SkippableItem-JVlU9Rs(LazyLayoutItemContentFactory.kt:134)
	at androidx.compose.foundation.lazy.layout.LazyLayoutItemContentFactoryKt.access$SkippableItem-JVlU9Rs(LazyLayoutItemContentFactory.kt:1)

We are using compose version, 2023.10.00.

I've checked library version is using 2023.06.01, I don't know it is actually compatibility issue but it crashes anyway.

Please review for it. Thank you. @RotBolt

Add Data Retention Policy option in UI

We should add Data Retention policy which will tell for how long the data will be stored in the flaker companion app

We should give following options to the user to configure it instead of indefinitely storing the data

  • 1 day
  • 7 days
  • 15 days
  • 30 days

Work with minSDK 22

It appears the minimum SDK is 24 and this may be due to sql delight. I got very unhelpful error messages from AS trying to use it until I finally figured out it was a minimum SDK issue.

I know 22 is just not fun be we have to be there due to old specialized hardware.

Would love to use the project but I really needed to test crappy network so I wrote an OKHTTP interceptor that put in a 1s delay and was able to replicate and fix the code issue I had that I planned to use this project for.

Cannot be used for qa/release builds

Should not be used for Release builds but QA builds are a valid use case scenario and when we try to use the library for qa builds it fails to build with the following exception.

" implementation(deplibs.flaker)" version 0.1.2

Error while evaluating property 'content' of task ':app:generateQaFeatureTransitiveDeps'.
   > Could not resolve all artifacts for configuration ':app:qaRuntimeClasspath'.
      > Could not resolve app.cash.sqldelight:android-driver:2.0.0.
        Required by:
            project :app > io.github.rotbolt:flaker-android-okhttp:0.1.2 > io.github.rotbolt:flaker-data:0.1.2 > io.github.rotbolt:flaker-data-android:0.1.2
         > No matching variant of app.cash.sqldelight:android-driver:2.0.0 was found. The consumer was configured to find a component for use during runtime, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'qa', attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.1.1', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' but:
             - Variant 'debugVariantMavenApiPublication' capability app.cash.sqldelight:android-driver:2.0.0:
                 - Incompatible because this component declares a component for use during compile-time, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug' and the consumer needed a component for use during runtime, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'qa'
                 - Other compatible attributes:
                     - Doesn't say anything about com.android.build.api.attributes.AgpVersionAttr (required '8.1.1')
                     - Doesn't say anything about its target Java environment (preferred optimized for Android)
                     - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'androidJvm')
             - Variant 'debugVariantMavenJavaDocPublication' capability app.cash.sqldelight:android-driver:2.0.0 declares a component for use during runtime:
                 - Incompatible because this component declares a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug' and the consumer needed a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'qa'
                 - Other compatible attributes:
                     - Doesn't say anything about com.android.build.api.attributes.AgpVersionAttr (required '8.1.1')
                     - Doesn't say anything about its target Java environment (preferred optimized for Android)
                     - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'androidJvm')

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.