6ba2f2cfdfac14a77ab7ad02152183432c67de0c
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
ToneGeneratorto playTONE_SUP_ERRORupon 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:
./gradlew assembleDebug
Running the App
- Open the project in Android Studio.
- Select your target device/emulator.
- Click the Run button or press
Shift + F10.
Project Structure
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
Languages
Kotlin
93.9%
Dockerfile
6.1%