Project 1: Android Calculator
Screenshots
Demo
Project Synopsis
This is a personal project that I made in Summer 2025. It is a basic calculator for Android devices.
It has basic functions like addition, subtraction, multiplication and division.
Numbers are also not limited to being whole numbers, but can be decimals as well.
It also is able to create and solve complex mathematical expressions through the use of parentheses. If the user misclicks, the clear function exists to erase their last input by using the "Clear" ("C") button.
If the user wishes to erase their entire inputted expression, then they can press the "All Clear" ("AC") button to erase their entire inputted expression.
Finally, a unique feature this calculator has is being able to evaluate expressions as the user inputs them at the bottom of the screen. The inputs are shown at the top of the screen, while the result of the inputted expression so far is shown at the bottom of the screen. After the user clicks the "Equals" ("=") to evaluate their inputted expression, the result is shown at the top, where they inputted their expression, as well as the bottom of the screen.
For accessibility, the Android calculator has the option for dark mode and light mode. The calculator uses vibrant colors that stand out in each mode so there is good contrast for the user.
Tech Stack
- Kotlin
- Jetpack Compose
- Android Studio
Key Challenges
Implementing the expression solver for the inputted expressions by the user was tricky, since creating an entire expression solver for the calculator would require a lot of development time, and I would rather use a public module to handle it.
So, instead of creating an entirely new solver and extending the development time of the calculator, I used a public module called Rhino, which is an open-source implementation of JavaScript written entirely in Java.
I used this module to evaluate mathematical expressions as strings, since JavaScript has an eval() function that has the capability of doing so. Thus, I was able to avoid having to create an entire solver from scratch, and reduce development time by a large margin.