Skip to content

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Oops!Alarm ⏰📸

Oops!Alarm is a fully-featured Android alarm clock with a devious twist: if you don't dismiss your alarm within one minute, it will randomly select a photo from your gallery and automatically post it to your Instagram account! It's the ultimate motivation to get out of bed.

The "Oops" Feature

The core of this app is the optional "Oops" penalty. When enabled:

  1. Your alarm rings at the set time.
  2. A 60-second countdown begins.
  3. If you don't press "Dismiss" in time... OOPS!
  4. The app selects a random photo from your device's gallery.
  5. It then opens Instagram and automatically navigates through the posting process to share that photo with a default caption.

It's a high-stakes game to make sure you wake up on time.

Features

  • Standard Alarm: Set alarms easily with a time picker.
  • "Oops" Penalty: Toggle the auto-posting feature on or off.
  • Volume Crescendo: The alarm sound gradually increases in volume for a gentler wakeup.
  • Reliable Scheduling: Uses AlarmManager and a ForegroundService to ensure the alarm rings even if the app is closed or the phone is asleep.
  • Reboot Persistent: Automatically reschedules your alarm if you restart your device.
  • Clean UI: A simple, dark-mode interface built with Material Design components.

⚠️ A Word of Warning

The auto-posting feature is a clever hack, not a standard API call. It relies on an Accessibility Service to simulate user clicks ("Next", "Share") inside the official Instagram app.

  • This can break! If Instagram updates its app and changes its UI (button text, layout IDs, etc.), the auto-posting feature will fail.
  • Permissions Required: This feature requires you to grant Storage/Photo access (to select a photo) and enable the Accessibility Service for the app in your device's settings. The app will guide you through this process.

How It Works (Technical Breakdown)

  • AlarmManager: Schedules a precise alarm that will trigger even if the app is not running.
  • BroadcastReceiver: Catches the alarm event from the system.
  • ForegroundService: The receiver starts a long-running service that:
    • Plays the alarm sound and vibrates.
    • Shows a persistent notification.
    • Manages the 60-second "Oops" timer.
    • Acquires a WakeLock to keep the CPU active.
  • AccessibilityService: A service that can interact with the UI of other apps. When activated by the alarm, it looks for specific buttons in the Instagram app and clicks them to complete the post.

Technologies Used

  • Language: Kotlin
  • Architecture: Standard Android (Activities, Services, BroadcastReceivers)
  • UI: View Binding, XML Layouts, Material Design Components
  • Asynchronicity: Kotlin Coroutines
  • Android APIs: AlarmManager, Foreground Services, Accessibility Services, MediaPlayer, Vibrator

Setup & Build

  1. Clone the repository: git clone https://github.com/umaarov/Oops-Alarm.git
  2. Open the project in Android Studio.
  3. Build and run on an Android device or emulator.
  4. When setting an alarm with the "Oops" feature, the app will prompt you to grant the necessary permissions.

About

Android alarm clock that posts a random photo to your Instagram from your Gallery if you don't wake up on time.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages