44 lines
1.7 KiB
Markdown
44 lines
1.7 KiB
Markdown
# Countdown Timer
|
|
|
|
A minimal Android application that demonstrates a simple countdown functionality with an audible alert.
|
|
|
|
## Description
|
|
The Countdown Timer app is a lightweight utility that launches a modal dialog to count down from 10 seconds. Once the timer reaches zero, the app plays a system error tone and closes the dialog. This project serves as a basic example of using `CountDownTimer`, `ToneGenerator`, and custom `Dialog` implementation in Android.
|
|
|
|
## Key Features
|
|
- **Single-Action Interface**: A simple main screen with a start button.
|
|
- **Modal Countdown**: A non-cancelable dialog that prevents user interference during the countdown.
|
|
- **Audible Alert**: Integration with Android's `ToneGenerator` to play `TONE_SUP_ERROR` upon completion.
|
|
- **Real-time Updates**: UI updates every second to reflect the remaining time.
|
|
|
|
## Getting Started
|
|
|
|
### Prerequisites
|
|
- Android Studio (Ladybug or newer recommended)
|
|
- JDK 17
|
|
- An Android device or emulator running API level 24 or higher.
|
|
|
|
### Building the App
|
|
To build the debug APK from the command line:
|
|
```bash
|
|
./gradlew assembleDebug
|
|
```
|
|
|
|
### Running the App
|
|
1. Open the project in Android Studio.
|
|
2. Select your target device/emulator.
|
|
3. Click the **Run** button or press `Shift + F10`.
|
|
|
|
## Project Structure
|
|
```text
|
|
app/
|
|
├── src/
|
|
│ └── main/
|
|
│ ├── java/com/example/countdowntimer/
|
|
│ │ ├── MainActivity.kt # Main entry point; launches the timer
|
|
│ │ └── CountdownDialog.kt # Logic for the 10s countdown and tone
|
|
│ ├── res/ # UI layouts and resources
|
|
│ └── AndroidManifest.xml # Application manifest
|
|
└── build.gradle # App-level build configuration
|
|
```
|