https://github.com/animesh/clock-ticker

Automatically exported from code.google.com/p/clock-ticker

https://github.com/animesh/clock-ticker

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (9.9%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

Automatically exported from code.google.com/p/clock-ticker

Basic Info
  • Host: GitHub
  • Owner: animesh
  • License: gpl-3.0
  • Language: Java
  • Default Branch: master
  • Size: 4.85 MB
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created over 11 years ago · Last pushed 11 months ago
Metadata Files
Readme License

README.md

Hourly Buzz (Clock Ticker)

A simple Android application that provides a discreet vibration reminder every hour available at Google Play Store.

Overview

The Hourly Buzz app is designed to help users keep track of time by providing a short vibration at the top of every hour. It features a simple interface to start and stop the hourly vibration service.

How it Works

The app utilizes core Android components to achieve its functionality:

  1. Main Interface (MainActivity.java):

    • Provides "Start" and "Stop" buttons to control the hourly vibration service.
    • Displays informative messages to the user based on the service's status (e.g., "Hourly vibration started," "Hourly vibration is already started," "No service running to stop").
    • Handles runtime permission requests for SCHEDULE_EXACT_ALARM on Android 12 (API 31) and newer. If the permission is not granted, the app guides the user to the system settings.
  2. Scheduling Alarms (AlarmManager):

    • When the "Start" button is pressed (and the service isn't already running), the app uses AlarmManager to schedule an alarm that will trigger at the next exact hour.
    • For devices running Android Marshmallow (API 23) and above, it uses setExactAndAllowWhileIdle() for precise timing, crucial for an hourly reminder.
    • For older devices (pre-Marshmallow), it uses setRepeating() to schedule the alarm.
    • The SCHEDULE_EXACT_ALARM permission is declared in the AndroidManifest.xml and requested at runtime on Android 12+ to ensure alarms can be scheduled reliably.
  3. Handling Alarms (VibrationReceiver.java):

    • This BroadcastReceiver is triggered when the AlarmManager's scheduled alarm goes off.
    • Upon receiving the alarm event:
      • It triggers the device's vibrator (requires android.permission.VIBRATE, declared in AndroidManifest.xml).
      • (Optional) It can display a notification to the user. On Android 13 (API 33) and newer, this requires the POST_NOTIFICATIONS permission. The app currently checks for this permission before attempting to post a notification. (Note: A runtime request for this permission still needs to be implemented in MainActivity if notifications are a critical feature).
      • For devices on Android Marshmallow and above, it then reschedules the next alarm for the subsequent hour using setExactAndAllowWhileIdle(). This rescheduling also checks for the SCHEDULE_EXACT_ALARM permission on Android 12+. Rescheduling is skipped for pre-Marshmallow devices as setRepeating handles this.

Key Features & Recent Improvements

  • Reliable Hourly Vibrations: Utilizes AlarmManager for timely hourly reminders.
  • Simple User Interface: Easy-to-use "Start" and "Stop" buttons.
  • Informative Feedback:
    • The "Start" button now correctly indicates if the service is already scheduled ("Hourly vibration is already started").
    • The "Stop" button accurately informs the user if there's no service running ("No service running to stop").
  • Modern Android Compatibility:
    • Exact Alarm Scheduling: Includes runtime checks and guidance for the SCHEDULE_EXACT_ALARM permission on Android 12 (API 31) and newer, essential for the app's core functionality.
    • Notification Handling: Added checks for POST_NOTIFICATIONS permission in the VibrationReceiver for Android 13 (API 33) and newer before attempting to display a notification.
  • Accurate Rescheduling:
    • Refined alarm rescheduling logic in VibrationReceiver to more accurately target the next exact hour.
    • Rescheduling logic in the receiver is now correctly skipped for pre-Marshmallow devices as setRepeating handles this.

Links

Owner

  • Name: Ani
  • Login: animesh
  • Kind: user
  • Location: Norway
  • Company: Norwegian University of Science and Technology

A medical graduate from Delhi University with post-graduation in bioinformatics from Jawaharlal Nehru University, India.

GitHub Events

Total
  • Push event: 3
Last Year
  • Push event: 3

Dependencies

app/build.gradle.kts maven
build.gradle.kts maven