Skip to content

Tprabath/Alarmer_01

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

121 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Alarmer - Command Line Alarm Application

A lightweight Java-based command-line alarm application that monitors scheduled alarms and plays audio notifications at specified times.

Version: v0.1.0-beta-cli

Overview

Alarmer is a simple yet powerful CLI alarm manager that allows you to create, manage, and monitor multiple alarms. Each alarm plays a custom audio file at a specified time, with support for enabling/disabling alarms without deletion.

Features

  • Multiple Alarms: Create and manage multiple alarms simultaneously
  • 🔊 Custom Audio: Set custom audio files for each alarm (supports .wav and other audio formats)
  • 🎚️ Enable/Disable: Easily enable or disable alarms without deleting them
  • ⚙️ Easy Configuration: Simple JSON-based alarm storage and property-based configuration
  • 🧵 Background Monitoring: Runs alarm checks in a separate thread for non-blocking operation
  • 🐛 Debug Mode: Toggle debug mode for troubleshooting via configuration file
  • 💾 Persistent Storage: All alarms saved to JSON file for persistence across sessions

Requirements

  • Java: JDK 8 or higher
  • Operating System: Windows, Linux, or macOS
  • Audio Support: System must support audio playback

Installation & Setup

1. Clone or Download

git clone <repository-url>
cd Alarmer_01

2. Compile the Project

# Using javac (ensure JAVA_HOME is set)
javac -d bin src/**/*.java

# Or compile from the src directory
javac -d ../bin *.java

3. Run the Application

java -cp bin App

Usage

Starting the Application

java -cp bin App

When started, the application displays:

App Name : Alarmer
App version : v0.1.0-beta-cli

Alarm Commands are listening...

Available Commands

Add Alarm

add <alarm_name> <description> <time_HH:mm_AM/PM> <audio_file_path>

Example:

add MorningAlarm "Time to wake up" "07:30 AM" "C:\Users\YourUser\Downloads\alarm_sound.wav"

Note: Include the add prefix, name, description, time, and full path to audio file.

List Alarms

list

Displays all alarms with their ID, name, status, and scheduled time.

Delete Alarm

delete <alarm_id>

Removes an alarm from the system.

Enable/Disable Alarm

enable <alarm_id>
disable <alarm_id>

Toggle alarms on or off without deleting them.

Exit Application

exit

Cleanly shutdown the application.

Help

help

Displays available commands.

Configuration

Edit config/config.properties to customize behavior:

# Application name
app.name = Alarmer

# Application version
app.version = v0.1.0-beta-cli

# Path to alarms JSON file
app.alarms_path = alarms.json

# Alarm check interval in milliseconds (how often to check if alarm time has been reached)
app.alarm_wait_time = 1000

# Enable debug mode (1 = true, 0 = false)
app.isDebug = 0

Configuration Details

Property Description Default
app.name Application display name Alarmer
app.version Application version v0.1.0-beta-cli
app.alarms_path Path to alarms.json file alarms.json
app.alarm_wait_time Time interval (ms) between alarm checks 1000
app.isDebug Debug mode (1=on, 0=off) 0

Alarms File Format

Alarms are stored in JSON format (alarms.json). Each alarm contains:

[
  {
    "id": 0,
    "name": "Morning Alarm",
    "discription": "Daily morning wake-up",
    "alarmTime": "07:30 AM",
    "sound_path": "C:\\Users\\YourUser\\Downloads\\alarm_sound.wav",
    "enable": true
  },
  {
    "id": 1,
    "name": "Lunch Reminder",
    "discription": "Lunch break reminder",
    "alarmTime": "12:00 PM",
    "sound_path": "C:\\Users\\YourUser\\Downloads\\notification.wav",
    "enable": true
  }
]

Alarm Properties

Property Type Description
id Integer Unique alarm identifier
name String Alarm name
discription String Alarm description
alarmTime String Time to trigger alarm (format: "HH:mm AM/PM")
sound_path String Full path to audio file
enable Boolean Enable/disable status

Project Structure

Alarmer_01/
├── src/
│   ├── App.java                          # Main entry point
│   ├── alarm/
│   │   ├── entities/dto/
│   │   │   └── Alarm.java               # Alarm data model
│   │   ├── factorys/
│   │   │   └── AlarmFactory.java        # Factory for creating alarms
│   │   ├── io/
│   │   │   └── AlarmJsonRW.java         # JSON read/write operations
│   │   ├── sound/
│   │   │   └── Sound.java               # Audio playback handler
│   │   └── threads/
│   │       └── AlarmThread.java         # Background alarm monitoring
│   ├── config/
│   │   ├── config.properties            # Configuration file
│   │   └── ReadConfig.java              # Config file reader
│   ├── core/
│   │   ├── Core.java                    # Core application logic
│   │   └── CoreProcess.java             # Command processing
│   └── util/
│       └── Logger.java                  # Logging utility
├── config/
│   └── config.properties                # Main config file
├── lib/                                 # Dependencies (if any)
├── bin/                                 # Compiled output
├── alarms.json                          # Alarms database
└── README.md                            # This file

Building from Source

Using javac:

javac -d bin -sourcepath src src/App.java

Cleaning compiled files:

rm -rf bin/*

Troubleshooting

Alarm doesn't trigger

  • Check time format: Ensure time is in "HH:mm AM/PM" format
  • Verify enabled status: Check if alarm is enabled using list command
  • Check audio file path: Ensure the file path exists and is accessible
  • Enable debug mode: Set app.isDebug = 1 in config.properties for detailed logs

Audio file not playing

  • Verify file path: Use absolute file paths (e.g., C:\Users\...\alarm.wav)
  • Check file format: Ensure file is a supported audio format (.wav, .mp3, etc.)
  • System audio: Verify system volume is not muted

Application crashes on startup

  • Check config.properties: Ensure all required properties are set
  • Verify alarms.json: Ensure it's valid JSON format
  • Java version: Confirm Java 8 or higher is installed

Commands not recognized

  • Syntax: Ensure correct command format with proper spacing
  • Case sensitivity: Commands are uppercase but typed as lowercase
  • Debug mode: Enable debug mode to see command parsing details

Tips & Best Practices

  1. Backup alarms.json: Keep a backup copy (alarms.json.bak) before making changes
  2. Full paths: Always use absolute file paths for audio files
  3. Time format: Use consistent "HH:mm AM/PM" format (e.g., "07:30 AM", "02:45 PM")
  4. Test audio files: Ensure audio files play on your system before adding to alarms
  5. Unique names: Use descriptive unique names for each alarm to avoid confusion

Known Limitations

  • Alpha version - stability not guaranteed
  • Single user mode
  • Time-based alarms only (no recurring patterns in v0.1.0)
  • CLI interface only (no GUI)

Future Enhancements

  • Recurring alarm patterns (daily, weekly, etc.)
  • Snooze functionality
  • Graphical User Interface (GUI)
  • System notifications
  • Multiple time zones support
  • Sound volume control

Releases

Pre-built releases are available in the releases/ directory:

  • v0.1.0-beta-cli: CLI wrapper with installer

License & Support

This project is provided as-is for educational and personal use.

For bug reports or feature requests, please check the releases/ folder for version information.


Last Updated: 2026-06-17
Current Version: v0.1.0-beta-cli

About

This is a simple Alarm project.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages