Droid Dex helps you make smart, device-aware decisions like:
- Delivering high-definition images and advanced animations only to capable devices
- Optimize layouts for mid-tier phones to prevent lag and freezes
- Skip heavy video playback on lower-end hardware to avoid crashes
It is a powerful tool that classifies and analyzes Android device performance across multiple parameters:
| PARAMETER | DESCRIPTION |
|---|---|
| Total RAM, Core Count, CPU Frequency | |
| Heap Limit, Heap Remaining, Available RAM | |
| Bandwidth Strength, Download Speed, Signal Strength | |
| Available Storage | |
| Percentage Remaining, If Phone is Charging or Not |
into various levels: EXCELLENT, HIGH, AVERAGE, LOW
Droid Dex enhances your Android application's performance and elevates user experience by addressing key performance challenges such as Janky scrolling, Out of Memory (OOM) errors, High battery consumption, and Application Not Responding (ANR) instances.
More Info: https://lambda.blinkit.com/droid-dex-1f807901626f
-
Battery-Aware API Polling: When background polling of an API is required, frequent requests can significantly drain the device's battery. Use the
BATTERYperformance level to dynamically adjust polling intervals:DroidDex.getPerformanceLevelLd(PerformanceClass.BATTERY).observe(this) { // Adjust the polling time interval }
-
Adaptive Image Quality: When tailoring image quality based on device capabilities, both
NETWORKandMEMORYconditions are important. Better image quality requires larger file sizes (impacting network) and generates heavier bitmaps (consuming memory). Optimize image quality delivery using weighted performance levels:DroidDex.getWeightedPerformanceLevelLd(PerformanceClass.NETWORK to 2F, PerformanceClass.MEMORY to 1F).observe(this) { // Implement image quality optimization }
Initialize the library in your Application class using the following code snippet:
DroidDex.init(this) // Parameter: Application Context-
To get performance level for single/multiple parameters:
DroidDex.getPerformanceLevel(params)For observing the changes:
DroidDex.getPerformanceLevelLd(params).observe(this) { }
Replace
paramswith a comma-separated list ofPerformance Class(es).Example:
DroidDex.getPerformanceLevel(PerformanceClass.CPU, PerformanceClass.MEMORY)
-
To get performance level for multiple parameters with unequal weights:
DroidDex.getWeightedPerformanceLevel(params)For observing the changes:
DroidDex.getWeightedPerformanceLevelLd(params).observe(this) { }
Replace
paramswith a comma-separated list ofPerformance Classesmapped to theirWeights.Example:
DroidDex.getWeightedPerformanceLevelLd(PerformanceClass.CPU to 2F, PerformanceClass.MEMORY to 1F).observe(this) { }
See Example Project for further usage
For versions 3.+
The latest release is available on Maven Central.
implementation("com.eternal.kits:droid-dex:<<latest_version>>")For versions 2.x and before
Add this to your settings.gradle[.kts] file
dependencyResolutionManagement {
repositories {
maven {
url = uri("https://maven.pkg.github.com/grofers/*")
credentials {
username = "Blinkit"
password = GITHUB_PERSONAL_ACCESS_TOKEN
}
}
}
}And add this dependency to your project level build.gradle[.kts] file:
implementation("com.blinkit.kits:droid-dex:<<your_version>>")