mirror of
https://github.com/Software-Guardians/CalculatorAppinAndroidwithKotlin.git
synced 2025-07-19 07:45:16 +00:00
İlk Android Studio uygulamam
.idea | ||
app | ||
gradle | ||
.gitignore | ||
build.gradle.kts | ||
gradle.properties | ||
gradlew | ||
gradlew.bat | ||
LICENSE | ||
README.md | ||
README_EN.md | ||
Screenshot.png | ||
settings.gradle.kts |
📱 Calculator Demo – Android Calculator App Using Kotlin
This project is a simple yet functional calculator application developed using the Kotlin programming language in Android Studio. The application consists of two main parts: a user interface (AnasayfaFragment
) and a backend logic handler (Operations
).
🚀 Features
- Basic arithmetic operations supported: ➕ ➖ ✖️ ➗
- Real-time display of the current input
- Invalid input detection (e.g., prevents entering two operation symbols consecutively)
- Division-by-zero error handling
- Persistent state with SharedPreferences
🧩 Application Structure
🧱 AnasayfaFragment.kt
- Manages UI buttons and interactions.
- Updates the
islem
string with user input. - On pressing the equals button (
buttonesit
), the input is passed to theOperations
class for processing. - Uses SharedPreferences to save the last operation string when the app is paused or stopped.
🧠 Operations.kt
parcalama(islem: String)
: Splits the input string into numbers and operators.getNumbers()
/getIsaretler()
: Returns parsed numbers and operators.kontrolFonksiyonu(islem: String)
: Checks for invalid sequences like multiple consecutive operators.
📂 File Structure
hesapmakinesidemo/
├── AnasayfaFragment.kt # UI and interaction logic
├── Operations.kt # Parsing and calculation logic
├── fragment_anasayfa.xml # UI layout (linked via ViewBinding)
🛠️ Setup
To run the project on your local machine:
- Clone the repository:
git clone https://github.com/emrullah-enis-ctnky/CalculatorAppAssignment.git
- Open the project in Android Studio.
- Ensure all SDKs and dependencies are installed.
- Run on an emulator or a physical device.
⚙️ Technologies Used
- Kotlin
- Android SDK
- ViewBinding
- Fragment architecture
- SharedPreferences
🧠 What You'll Learn
By reviewing this project, you'll gain experience in:
- Fragment management in Kotlin
- Safe UI handling with ViewBinding
- Parsing user input for arithmetic evaluation
- Persisting state with SharedPreferences
🖼️ Screenshots
👤 Developer
Emrullah Enis Çetinkaya
🎓 Turkish-German University – Computer Engineering
🔗 GitHub Profile
📝 License
This project is licensed under the MIT License. For more information, see the LICENSE
file.
💡 Feel free to open a pull request if you'd like to contribute, report an issue, or suggest improvements!