A clean, modern unit conversion application built with Jetpack Compose and Material 3. This project demonstrates a generic, scalable architecture for handling various measurement types including Length, Mass, Area, Data, Speed, Time, and Temperature.
-
Generic Conversion Logic
Uses a shared interface for all units, making it easy to add new categories without duplicating UI code. -
Real-time Calculation
Inputs are processed instantly usingderivedStateOffor a seamless user experience. -
Material 3 UI
Features a modern interface with scrollable category chips and integrated dropdowns within input fields. -
Precision Handling
Automatically formats results and trims unnecessary trailing zeros for a clean display. -
Swap Functionality
Quickly switch between From and To units with a single tap.
The app follows a Zero-Repetition Architecture.
Instead of writing separate UI logic for every measurement category, a single reusable composable named ConverterContent handles all conversion operations by accepting any class implementing the ConversionUnit interface.
Meters, Kilometers, Inches, Feet, Miles, Centimeters, and more.
Grams, Kilograms, Pounds, Ounces, Tons.
Square Meters, Acres, Hectares, Square Feet.
Bytes, KB, MB, GB, TB.
Meters per Second, Kilometers per Hour, Miles per Hour.
Seconds, Minutes, Hours, Days.
Celsius, Fahrenheit, Kelvin with custom offset-based conversion handling.
- Android Studio Ladybug or newer
- Kotlin 1.9.0+
- Minimum SDK 24+
- Clone the repository
git clone https://github.com/yourusername/unit-converter.git-
Open the project in Android Studio
-
Sync Gradle files
-
Run the app on an emulator or physical device
This shared interface allows all measurement categories to use the same UI and conversion engine.
interface ConversionUnit {
val symbol: String
val theRatio: Double
val offset: Double
get() = 0.0
}The app uses a base-unit normalization strategy for accurate conversion across different scales.
- Kotlin
- Jetpack Compose
- Material 3
- State Management with Compose APIs
derivedStateOffor optimized recomposition
- Currency conversion with live exchange rates
- Scientific notation support
- History and favorites
- Tablet and foldable optimization
- Unit search functionality
Manish Kumar Shrestha
Mobile and Game Developer
Built with ❤️ in Kathmandu, Nepal.
