|
1 | 1 | # :construction: Flaker :construction:
|
2 |
| - |
| 2 | + [](https://maven-badges.herokuapp.com/maven-central/io.github.rotbolt/flaker-android-okhttp) |
3 | 3 |
|
| 4 | +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. 📱💡 |
4 | 5 |
|
5 |
| -A flaky network simulator for your mobile app. |
| 6 | +## What is Flaker? |
| 7 | +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. 🌐🛠️ |
6 | 8 |
|
7 |
| -Imagine effortlessly recreating real-world network scenarios directly for your mobile app development. With Flaker,- you gain the ability to mimic a variety of network conditions tailored for mobile app development. |
8 |
| -- **Experience Slow Networks**: Wondering how your app performs on a slow network? Flaker lets you replicate these scenarios, helping you fine-tune your app's responsiveness. |
9 |
| -- **Emulate Flaky Networks**: Use fail percentage and variance controls to mirror the unpredictable nature of network connections. Get a firsthand feel for the scenarios your mobile app might encounter. |
10 |
| -- **Focused Impact**: Flaker only affects your app's network conditions, leaving your device's overall network functionality undisturbed. |
| 9 | +## Key Features: |
| 10 | +### Experience Slow Networks 🐢 |
| 11 | +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. 🚀🐌 |
11 | 12 |
|
12 |
| -Whether you're a mobile app developer refining user experiences or a tester validating app resilience, Flaker offers an intuitive solution within your development workflow. Elevate your testing strategies and boost your app's performance with Flaker. |
| 13 | +### Emulate Flaky Networks 📶 |
| 14 | +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. 🔮🔌 |
13 | 15 |
|
14 |
| -## Demo |
15 |
| - |
16 |
| -https://github.com/RotBolt/Flaker/assets/24780524/3d00e644-0f47-4755-8402-74001fa96a2c |
| 16 | +### Focused Impact 🎯 |
| 17 | +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. 📡🔍 |
17 | 18 |
|
| 19 | +## Who Can Benefit from Flaker? |
| 20 | +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. |
18 | 21 |
|
19 |
| -## Getting Started |
| 22 | +Flaker empowers you to: |
20 | 23 |
|
21 |
| -#### Installation (In Progress - Not yet published to maven central) |
| 24 | +✅ Test under various network conditions |
22 | 25 |
|
23 |
| -Add the following dependency to your project. |
24 |
| - |
25 |
| -```kotlin |
26 |
| - debugImplementation("io.github.rotbolt:flaker-android-okhttp:${latest_version}") |
27 |
| - releaseImplementation("io.github.rotbolt:flaker-android-okhttp-no-op:${latest_version}") |
28 |
| -``` |
| 26 | +✅ Optimize your app for slow networks |
29 | 27 |
|
30 |
| -**_NOTE:_** It is not yet published to maven central. But you can download all the modules from [github packages](https://github.com/RotBolt?tab=packages&repo_name=Flaker) and add them to your project for now. |
31 |
| - |
32 |
| -#### flaker-android-okhttp |
33 |
| -Add the following statement to your app's onCreate method. |
34 |
| -```kotlin |
35 |
| - class MainApplication: Application() { |
36 |
| - override fun onCreate() { |
37 |
| - super.onCreate() |
38 |
| - FlakerAndroidOkhttpContainer.install(this) |
39 |
| - } |
40 |
| - } |
41 |
| -``` |
| 28 | +✅ Prepare your app for flaky network connections |
42 | 29 |
|
43 |
| -Then in your okhttp client builder, add the following interceptor. |
44 |
| -```kotlin |
45 |
| - val client = OkHttpClient.Builder() |
46 |
| - .addInterceptor(FlakerInterceptor.Builder().build()) |
47 |
| - .build() |
48 |
| -``` |
| 30 | +✅ Ensure your app's stability and reliability |
49 | 31 |
|
50 |
| -#### flaker-android-ktor (In Progress) |
| 32 | +✅ Enhance user satisfaction and retention |
51 | 33 |
|
52 |
| -#### flaker-ios-ktor (In Progress) |
| 34 | +## Demo |
| 35 | +📺 Check out the to see Flaker in action. |
53 | 36 |
|
54 |
| -That's it. Now you can use the companion app to simulate the network conditions. |
| 37 | +https://github.com/RotBolt/Flaker/assets/24780524/3d00e644-0f47-4755-8402-74001fa96a2c |
55 | 38 |
|
56 |
| -## Development |
| 39 | +## Usage |
| 40 | +Please refer to the [📚 docs](https://rotbolt.github.io/Flaker/) for detailed usage instructions. |
57 | 41 |
|
58 |
| -### Library Code Map |
59 |
| - |
60 |
| - |
| 42 | +## Built with |
61 | 43 |
|
| 44 | +**Kotlin:** 🚀 The primary programming language. |
62 | 45 |
|
63 |
| -### :hammer: Build |
64 |
| - Simply clone this repository in Android Studio Giraffe or above and build the project. |
| 46 | +**Kotlin Multiplatform:** 📱🍏 Sharing common logic across Android and iOS. |
65 | 47 |
|
66 |
| -### Module Details |
67 |
| -- **flaker-domain**: Contains domain of flaker library which is used by other modules. Like Network Request and preferences by the user. |
68 |
| -- **flaker-data**: Contains data layer of flaker library which is used by other modules to get the locally stored data. All the persistent data should stay here. |
69 |
| -- **flaker-okhttp-core**: Core module containing the functionality to intercept the network request and simulate the network conditions using OkHttp Interceptor. |
70 |
| -- **flaker-ktor-core**: Core module containing the functionality to intercept the network request and simulate the network conditions using Ktor |
71 |
| -- **flaker-android-ui**: Contains the reusable UI elements and components for the android companion app. |
72 |
| -- **flaker-android-okhttp**: Contains the companion app which gets installed as a part of library. This should be used for the apps which uses OkHttp as their networking library. |
73 |
| -- **flaker-android-ktor**: Contains the companion app which gets installed as a part of library. This should be used for the apps which uses Ktor as their networking library. |
74 |
| -- **flaker-android**: Contains the companion app which gets installed as a part of library. This should be used for the apps which uses both okhttp and Ktor as their networking library. |
| 48 | +**Jetpack Compose**: 🖼️ For building the UI for the Android companion app. Supports dynamic theming. |
75 | 49 |
|
76 |
| -### Verify |
77 |
| -We use `detekt` for static code analyis and a job is setup in github actions to run it on every PR. You can run it locally using the following command: |
78 |
| -```bash |
79 |
| -// For android related changes |
80 |
| -./gradlew detekt |
| 50 | +**SqlDelight:** 📊 For a shared database and persistence layer between multiple platforms. |
81 | 51 |
|
82 |
| -// For iOS related changes |
83 |
| -./gradlew detektMetadataIosMain |
| 52 | +**Jetpack DataStore:** 📦 For the shared persistence layer to store user preferences and configuration of Flaker. |
84 | 53 |
|
85 |
| -// For common code changes |
86 |
| -./gradlew detektMetadataCommonMain |
87 |
| -``` |
| 54 | +**Okhttp:** 📡 For creating Flaker for Android apps using Okhttp3 for networking. |
88 | 55 |
|
89 |
| -If you want to `detekt` to auto correct some of the stuff, please add the flag `--auto-correct` to the above commands. |
| 56 | +**Ktor:** 🌐 For creating Flaker targeting both Android and iOS apps using Ktor for networking. (🚧 In Progress) |
90 | 57 |
|
| 58 | +**SwiftUI:** 🍎 For building the UI for the iOS companion app. Supports dynamic theming. (🚧 In Progress) |
91 | 59 |
|
92 | 60 | ## Roadmap
|
93 | 61 | - [x] flaker-android-okhttp
|
94 | 62 | - [ ] flaker-android-ktor
|
95 | 63 | - [ ] flaker-ios-ktor
|
96 | 64 |
|
97 | 65 | ## Contributing
|
98 |
| -If you've found an error in this sample, please file an issue. |
| 66 | +If you've found an error in this sample, please 🚩 file an issue. |
99 | 67 |
|
100 |
| -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. |
| 68 | +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. 🤝 |
101 | 69 |
|
102 | 70 | ## License
|
103 | 71 | ```
|
|
0 commit comments