Skip to content

Commit 506473f

Browse files
committed
Minor Update
1 parent 91651b5 commit 506473f

File tree

12 files changed

+324
-167
lines changed

12 files changed

+324
-167
lines changed

.gitignore

Lines changed: 68 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,83 @@
22
*.apk
33
*.ap_
44
*.aab
5+
*.apks
6+
*.dex
57

6-
# Local configuration file (sdk path, etc)
7-
local.properties
8+
# Files for the ART/Dalvik VM
9+
*.class
810

9-
# Windows thumbnail db
10-
Thumbs.db
11+
# Generated files
12+
bin/
13+
gen/
14+
out/
15+
release/
1116

12-
# OSX files
13-
.DS_Store
17+
# Gradle files
18+
.gradle/
19+
build/
20+
*/build/
21+
22+
# Local configuration file (sdk path, etc)
23+
local.properties
24+
*.properties
25+
!gradle.properties
1426

1527
# Android Studio
1628
*.iml
17-
.idea
18-
.gradle
19-
/build
20-
/captures
29+
.idea/
30+
.idea_modules/
31+
*.swp
32+
*.swo
33+
*~
2134

2235
# NDK
2336
obj/
24-
.externalNativeBuild
25-
app/release/output-metadata.json
37+
.externalNativeBuild/
38+
.cxx/
39+
40+
# IntelliJ IDEA
41+
*.iws
42+
/out/
43+
44+
# User-specific configurations
45+
.idea/libraries
46+
.idea/workspace.xml
47+
.idea/tasks.xml
48+
.idea/.name
49+
.idea/compiler.xml
50+
.idea/copyright/profiles_settings.xml
51+
.idea/misc.xml
52+
.idea/modules.xml
53+
.idea/vcs.xml
54+
55+
# OS-specific files
56+
.DS_Store
57+
.DS_Store?
58+
._*
59+
.Spotlight-V100
60+
.Trashes
61+
ehthumbs.db
62+
Thumbs.db
63+
64+
# Captures
65+
/captures/
66+
67+
# ProGuard
68+
*.pro
69+
70+
# Release files
71+
/releases/
72+
*.mapping
73+
seeds.txt
74+
usage.txt
2675

76+
# Kotlin
77+
*.kotlin_module
78+
.kotlin/
2779

80+
# Miscellaneous
2881
*.salive
29-
/app/release/*
82+
*.log
83+
.cache/
84+
docs/

README.md

Lines changed: 89 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -1,149 +1,129 @@
11
# Android Calculator
22

3-
A modern, feature-rich calculator application for Android devices with a clean interface and powerful computation capabilities.
3+
An Android calculator application implementing basic and scientific mathematical operations with custom expression parsing.
44

5-
## Features
5+
## Features
66

7-
- **Basic Arithmetic**: Addition, subtraction, multiplication, and division
8-
- **Scientific Functions**: Trigonometric functions, logarithms, exponentials, and more
9-
- **Multiple Themes**: Light, dark, and AMOLED themes with Material Design 3 support
10-
- **Calculation History**: Keep track of previous calculations with persistent storage
11-
- **Expression Parsing**: Custom-built mathematical expression parser for accurate results
12-
- **Responsive Design**: Optimized for both portrait and landscape orientations
13-
- **Precision Control**: Configurable decimal precision and scientific notation
14-
- **Intuitive UI**: Clean, modern interface with haptic feedback support
7+
- Basic arithmetic operations (addition, subtraction, multiplication, division)
8+
- Scientific functions (trigonometric, logarithmic, exponential)
9+
- Expression parsing with operator precedence and parentheses
10+
- Multiple numbering system support (international, Arabic-Indic, etc.)
11+
- Calculation history with persistent storage
12+
- Theme configuration (light, dark, AMOLED)
13+
- Precision control for decimal output
14+
- Scientific notation support
15+
- Quick Settings tile integration
1516

16-
## 🔧 Technical Details
17+
## Technical Details
1718

18-
### Architecture
19+
### Technology Stack
1920
- **Language**: Kotlin
20-
- **UI Framework**: Android Views with View Binding
21-
- **Minimum SDK**: API 21 (Android 5.0)
22-
- **Target SDK**: API 34 (Android 14)
21+
- **Platform**: Android (API 21-34)
2322
- **Build System**: Gradle with Kotlin DSL
23+
- **UI**: Android Views with View Binding
24+
- **Architecture**: Activity-based with service components
2425

25-
### Key Components
26-
- **Custom Calculator Engine**: Built-in mathematical expression evaluator using BigDecimal for precision
27-
- **Theme System**: Dynamic theming with support for system themes and custom color schemes
28-
- **History Management**: JSON-based calculation history with configurable storage limits
29-
- **Preference System**: Comprehensive settings with automatic migration support
26+
### Core Components
3027

31-
## 📸 Screenshots
28+
#### Calculator Engine (`calculator/Calculator.kt`)
29+
- Mathematical expression evaluation using `BigDecimal` for precision
30+
- Supports trigonometric, logarithmic, and exponential functions
31+
- Handles special cases (division by zero, domain errors, syntax errors)
3232

33-
### Light Theme
34-
<p align="center">
35-
<img src="app/src/main/res/drawable/screenshots/Screenshot_20250905_235435.png" alt="Light Mode Portrait" width="250">
36-
</p>
33+
#### Expression Parser (`calculator/parser/Expression.kt`)
34+
- Converts user input into evaluable mathematical expressions
35+
- Handles symbol substitution (× → *, ÷ → /)
36+
- Manages operator precedence and parentheses
37+
- Formats percentage calculations
3738

38-
### Dark Theme
39-
<p align="center">
40-
<img src="app/src/main/res/drawable/screenshots/Screenshot_20250906_000106.png" alt="Dark Mode Portrait" width="250">
41-
<img src="app/src/main/res/drawable/screenshots/Screenshot_20250906_000121.png" alt="Dark Mode Settings" width="250">
42-
</p>
39+
#### History Management (`history/History.kt`)
40+
- JSON-based storage using Gson
41+
- Persistent calculation records with timestamps
42+
- Configurable history limits
4343

44-
### Scientific Mode & Features
45-
<p align="center">
46-
<img src="app/src/main/res/drawable/screenshots/Screenshot_20250906_000718.png" alt="Scientific Mode" width="250">
47-
<img src="app/src/main/res/drawable/screenshots/Screenshot_20250906_000742.png" alt="History View" width="250">
48-
<img src="app/src/main/res/drawable/screenshots/Screenshot_20250906_001533.png" alt="Advanced Calculations" width="250">
49-
</p>
44+
### Project Structure
5045

51-
## 🚀 Getting Started
46+
```
47+
app/src/main/
48+
├── java/com/android/calculator/
49+
│ ├── activities/ # Activity classes (MainActivity, SettingsActivity, AboutActivity)
50+
│ ├── calculator/ # Core calculation logic
51+
│ │ ├── Calculator.kt # Mathematical operations implementation
52+
│ │ └── parser/ # Expression parsing utilities
53+
│ ├── history/ # Calculation history management
54+
│ ├── services/ # Background services (Quick Settings tile)
55+
│ └── util/ # Utility classes (theme, preferences, scientific mode)
56+
└── res/ # Android resources (layouts, values, drawables)
57+
```
58+
59+
## Building the Project
5260

5361
### Prerequisites
54-
- Android Studio Arctic Fox (2020.3.1) or later
62+
- Android Studio Hedgehog (2023.1.1) or later
5563
- JDK 8 or higher
5664
- Android SDK with API 34
65+
- Gradle 8.0+
5766

58-
### Building the Project
59-
60-
1. Clone the repository:
61-
```bash
62-
git clone <your-repository-url>
63-
cd Android_Calculator
64-
```
67+
### Build Commands
6568

66-
2. Open in Android Studio or build from command line:
67-
```bash
68-
./gradlew assembleDebug
69-
```
69+
```bash
70+
# Clone repository
71+
git clone https://github.com/HRG-OFFICIAL/Android-Calculator.git
72+
cd Android-Calculator
7073

71-
3. Install on device:
72-
```bash
73-
./gradlew installDebug
74-
```
74+
# Build debug APK
75+
./gradlew assembleDebug
7576

76-
## 🧪 Testing
77+
# Install on connected device
78+
./gradlew installDebug
7779

78-
Run the test suite:
79-
```bash
80-
# Unit tests
80+
# Run unit tests
8181
./gradlew testDebugUnitTest
8282

83-
# Instrumented tests
83+
# Run instrumented tests
8484
./gradlew connectedAndroidTest
85-
86-
# All tests
87-
./gradlew test
8885
```
8986

90-
## 🎨 Customization
91-
92-
The calculator supports extensive theming through:
93-
- **Color schemes**: Defined in `values/colors.xml` and `values-night/colors.xml`
94-
- **Typography**: Configurable font families and sizes
95-
- **Button styles**: Customizable button appearances and behaviors
87+
## Configuration
9688

97-
## 📱 Supported Features
89+
### Supported Operations
90+
- Arithmetic: `+`, `-`, `×`, `÷`
91+
- Exponentiation: `^`, `E` (scientific notation)
92+
- Functions: `sin`, `cos`, `tan`, `ln`, `log`, `log₂`, ``, `!`
93+
- Constants: `π`, `e`
94+
- Parentheses for precedence control
9895

99-
### Mathematical Operations
100-
- Basic arithmetic (+, -, ×, ÷)
101-
- Parentheses for operation precedence
102-
- Percentage calculations
103-
- Square root and power operations
104-
- Factorial calculations
105-
- Trigonometric functions (sin, cos, tan)
106-
- Logarithmic functions (ln, log, log₂)
107-
- Constants (π, e)
96+
### Precision Settings
97+
- Configurable decimal places (0-15)
98+
- Scientific notation toggle
99+
- Rounding mode: HALF_UP
108100

109-
### User Interface
110-
- Material Design 3 components
111-
- Adaptive layouts for different screen sizes
112-
- Smooth animations and transitions
113-
- Accessibility support
101+
## Testing
114102

115-
## 🔒 Privacy
103+
Unit tests are located in `app/src/test/java/` and cover:
104+
- Expression parsing
105+
- Mathematical operations
106+
- Edge cases (division by zero, invalid operations)
116107

117-
This calculator app:
118-
- **No network permissions**: All calculations are performed locally
119-
- **No data collection**: No user data is transmitted or stored externally
120-
- **Minimal permissions**: Only requests essential permissions for functionality
108+
Run tests:
109+
```bash
110+
./gradlew test
111+
```
121112

122-
## 🤝 Contributing
113+
## Permissions
123114

124-
Contributions are welcome! Please feel free to submit pull requests or open issues for bugs and feature requests.
115+
- `VIBRATE`: Haptic feedback on button presses
116+
- `SYSTEM_ALERT_WINDOW`: Display overlay for quick access
117+
- `USE_FULL_SCREEN_INTENT`: Quick Settings tile functionality
125118

126-
### Development Guidelines
127-
- Follow Kotlin coding conventions
128-
- Write unit tests for new functionality
129-
- Update documentation for significant changes
130-
- Test on multiple screen sizes and orientations
119+
## Support
131120

132-
## 📄 License
121+
If you find this project useful and would like to support its development, you can:
133122

134-
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
123+
- Star this repository
124+
- Report bugs or suggest features
125+
- [Buy me a coffee](https://buymeacoffee.com/hrgofficial) to support continued development
135126

136-
## 🏗️ Project Structure
127+
## License
137128

138-
```
139-
app/
140-
├── src/main/
141-
│ ├── java/com/android/calculator/
142-
│ │ ├── activities/ # UI activities
143-
│ │ ├── calculator/ # Core calculation logic
144-
│ │ ├── history/ # History management
145-
│ │ ├── services/ # Background services
146-
│ │ └── util/ # Utility classes
147-
│ └── res/ # Resources (layouts, strings, themes)
148-
└── src/test/ # Unit and integration tests
149-
```
129+
This project is licensed under the MIT License - see [LICENSE](LICENSE) file for details.

0 commit comments

Comments
 (0)