Skip to content
dev-AatifPublic

About

100% offline, zero-telemetry Islamic prayer reminder & spiritual companion for Android. Built with Kotlin, Jetpack Compose & Glance widgets, featuring Doze-resilient exact alarms, mosque auto-silent, Qibla compass, Tasbih, Tahajjud, Ramadan hub, and Larkana Division coverage.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Hayya

An ultra-minimalist, offline-first Islamic prayer reminder, Hadith hub, and spiritual companion app for Android.

Built with pure Kotlin, Jetpack Compose (Material 3), and Jetpack Glance AppWidgets, Hayya prioritizes deterministic astronomical accuracy, Doze-resilient exact alarms, and zero telemetry.

Regional Scope — Pakistan (Larkana Division): Calibrated and verified for Pakistan, featuring complete offline directory coverage for Larkana Division (all 5 districts and 37 towns/talukas), University of Islamic Sciences, Karachi (18.0° / 18.0°) twilight angles, and Hanafi Asr defaults.


Table of Contents


Core Features

Prayer Time & Astronomical Engine

  • Offline-First & Private: Zero analytics, zero ads, zero trackers. All prayer times, Hijri calendar dates (java.time.chrono.HijrahDate with configurable -2d to +2d regional moonsighting offset for Pakistan Ruet-e-Hilal), Qibla bearings, city coordinates, and bundled starter Hadiths execute locally on-device.
  • Dual Astronomical Solver: Powered by Batoul Apps adhan (1.2.1) with an offline Jean Meeus solar solver (SolarAstronomicalCalculator) fallback for extreme latitudes.
  • Regional Mosque Conventions (SindhMosqueSchedule): Models Sehri Ihtiyat (10m safety window), Ishraq, Zawal, pre-Maghrib Makrooh buffers, and seasonal Summer/Winter Adhan-to-Jama'at intervals.
  • Larkana Division Offline Directory: Covers 37 municipal corporations, taluka headquarters, and town committees across Larkana, Qambar Shahdadkot, Shikarpur, Jacobabad, and Kashmore.

Alarms & Mosque Mode

  • 3-Tier Alert Pipeline: Optional 15-minute Pre-Reminder (T0 - 15m), Main Call (T0) with lockscreen FullScreenIntent wake (using setShowWhenLocked without forcing premature keyguard unlock), and 20-minute Last Call warning (T_end - 20m).
  • Familiar Alarm Audio: Uses your device's default alarm tone (RingtoneManager.TYPE_ALARM) on USAGE_ALARM, with dedicated foreground notification IDs/actions, transient AudioFocus handling, active phone/VoIP call suppression (MODE_IN_CALL / MODE_IN_COMMUNICATION), optional gradual volume escalation (10s–30s), and smooth 2-second fade-out.
  • Mosque Auto-Silent (AutoMuteManager): Automatically switches the ringer to Silent (via Do Not Disturb access) or Vibrate during Salah (15–30m) and Jumu'ah Khutbah (45–60m), saving exact prior ringer mode and stream volumes and retaining recovery state with an actionable prompt if DND access is revoked mid-window.

Hadith Hub & Shareable Status Cards

  • Multilingual Offline Library: Bundled authentic starter Hadiths across 5 spiritual pillars (Prayer & Worship, Creed, Virtues, Manners, Quran & Tafsir) in Arabic, English, Urdu, and Sindhi, stored locally in SQLite + FTS4 (docid-indexed updates and sanitized queries) with Noto Naskh Arabic RTL typography across Hadith, Dua, Takbirat, Tasbih, and Wake views.
  • Optional On-Demand Sync: Download thematic packs from HadeethEnc.com (with resumable page tracking and Sindhi support) or full canonical Hadith collections (40 Nawawi, 40 Qudsi, Sahih al-Bukhari, Sahih Muslim, Tirmidhi, Abu Dawud, Nasa'i, Ibn Majah, Muwatta Malik) from fawazahmed0/hadith-api.
  • WhatsApp Status Card Generator & Sunrise Reminder: Export clean 9:16 or 1:1 PNG cards (HadithStatusCardRenderer with RTL bidi directionality and safe canvas clipping) and receive an optional daily Sunrise Hadith notification.

Spiritual Companion, Widgets & In-App Updates

  • Companion Suite: True-north magnetic-declination-calibrated Qibla compass (QiblaOrientationSensor + GeomagneticField, lifecycle-aware pause/resume), tactile OLED Tasbih counter, 7-day Prayer Habits tracker, Night & Tahajjud calculator (Islamic Midnight & Last Third), Friday (Jumu'ah) checklist & Salawat counter, and Ramadan & Eid Hub (30-day timetable, fast tracker, Qadha counter, Sunnah Duas, Suhoor wake-up alarm).
  • 5 Jetpack Glance Home Screen Widgets:
    • Hayya Next Prayer (2x2) — Upcoming prayer, countdown, and window progress bar
    • Hayya Full Timetable (4x2) — Dual-pane next prayer hero and full 5-prayer schedule
    • Hayya Daily Prayers (4x2) — Interactive 1-tap prayer check-off tracker
    • Hayya Quick Strip (4x1) — Compact bar with interactive prayer completion pips
    • Hayya Night & Fasting (3x2) — Suhoor, Iftar, Last Third (Tahajjud), and Midnight times
  • In-App GitHub Releases Updater (AppUpdateEngine): User-togglable update checker (Auto-Check Updates on Launch, disableable for strict zero-network operation) enforcing strict HTTPS GitHub host allowlisting across redirects and fail-closed SHA-256 checksum verification before guided APK installation.
  • Visual Craft: Pure OLED Dark (#07080A / #000000 lockscreen), Warm Sand Light (#F8F4EC), System Auto, optional Material You dynamic color (Android 12+), and tnum tabular figures for jitter-free countdowns.

Download & Installation

  1. Download Hayya-v1.1.2.apk (and optionally Hayya-v1.1.2.apk.sha256) from the GitHub Releases page.
  2. (Optional) Verify the APK integrity before installing:
    sha256sum -c Hayya-v1.1.2.apk.sha256
  3. Install on Android 8.0+ (API 26+):
    • Open the APK on your device and allow installation from your browser/file manager, or install via ADB:
      adb install -r Hayya-v1.1.2.apk
  4. Complete the 3-step Welcome Setup to select your town in Larkana Division, choose your Asr juristic school (Hanafi or Standard), and grant Notifications, Unrestricted Battery, and Exact Alarm permissions.

Background & Alarm Reliability

  1. Doze Bypass (AlarmManager.setAlarmClock): Schedules a 7-day rolling queue exclusively via AlarmManager.setAlarmClock with deterministic request codes: requestCode = (dayOfYear * 100) + (prayerOrdinal * 10) + tierOrdinal.
  2. WakeLock Safety Contract: PrayerAlarmReceiver acquires a bounded PARTIAL_WAKE_LOCK inside goAsync(), dispatches notifications or starts PrayerAudioService, and releases the WakeLock in finally.
  3. Foreground Protection & Safe Shutdown: PrayerAudioService (mediaPlayback) uses a dedicated foreground notification ID decoupled from CHANNEL_MAIN_CALL alerts; an optional PinnedPrayerStatusService (specialUse) anchors the process and falls back gracefully to a static ongoing notification when Android 12–16 restricts background FGS starts from system broadcasts.
  4. Reboot & Clock Resilience (SystemClockChangedReceiver): Validates incoming system actions (BOOT_COMPLETED, TIME_SET, TIMEZONE_CHANGED, MY_PACKAGE_REPLACED), runs inside an 8-second goAsync()/WakeLock budget, clears prior/shifted alarm windows on backward clock jumps, refreshes Glance widgets once via PrayerWidgetReceiver, and recovers interrupted auto-mute state.

Permissions

Permission Purpose
USE_EXACT_ALARM, SCHEDULE_EXACT_ALARM (maxSdkVersion="32") Exact prayer, Suhoor, Tahajjud, and auto-unmute scheduling
WAKE_LOCK, RECEIVE_BOOT_COMPLETED CPU retention during dispatch and post-reboot rescheduling
USE_FULL_SCREEN_INTENT Lockscreen wake screen (PrayerWakeActivity)
POST_NOTIFICATIONS Prayer alerts, pre-reminders, and ongoing status (Android 13+)
VIBRATE Haptic feedback and vibrate-mode auto-mute
ACCESS_NOTIFICATION_POLICY Optional Mosque Auto-Silent Do Not Disturb control
FOREGROUND_SERVICE (MEDIA_PLAYBACK, SPECIAL_USE) Active alarm playback and optional pinned status notification
REQUEST_IGNORE_BATTERY_OPTIMIZATIONS Battery optimization check and OEM exemption shortcut
INTERNET Optional GitHub Releases update checks and on-demand Hadith library sync
REQUEST_INSTALL_PACKAGES User-initiated in-app APK installation from GitHub Releases

Hardware features android.hardware.sensor.compass and android.hardware.sensor.accelerometer are declared with required="false" for the offline Qibla compass.


Tech Stack & Architecture

  • Language & Build: Kotlin 2.0.21, Android Gradle Plugin 8.7.2, JDK 17, minSdk 26 / targetSdk 36 / compileSdk 36
  • UI & Widgets: Jetpack Compose (BOM 2024.10.01, Material 3), Jetpack Glance 1.1.1
  • Persistence & Time: Jetpack DataStore Preferences 1.1.1, SQLite + FTS4, kotlinx-datetime 0.6.0, kotlinx-coroutines 1.8.1
  • Astronomical Engine: com.batoulapps.adhan:adhan:1.2.1
core/src/main/kotlin/dev/hayya/core/
├── HayyaApplication.kt                   # App-scoped DataStore, engine, Hadith & updater singletons
├── data/
│   ├── hadith/                           # HadithDatabase (SQLite+FTS4), sync clients & starter pack
│   ├── preferences/                      # UserPreferencesRepository (DataStore)
│   ├── prayerlog/                        # PrayerLogRepository (7-day prayer habit history)
│   └── ramadan/                          # FastTrackerRepository (fasting log, Qadha & Suhoor)
├── domain/
│   ├── calculation/                      # Astronomical calculators, PrayerCalculationEngine,
│   │                                     # NightFastingCalculator, SindhMosqueSchedule
│   ├── friday/                           # FridayReminders (Surah Al-Kahf & Salawat)
│   ├── hadith/                           # HadithModels, parsers, topic filter & daily selector
│   ├── model/                            # PrayerModels, PreferenceModels, CityCatalog, PostAdhanDua
│   ├── prayerlog/                        # DailyPrayerLog & RollingPrayerHistory
│   ├── qibla/                            # QiblaCalculator (great-circle bearing & smoothing)
│   ├── ramadan/                          # RamadanModels, RamadanDuasStore, EidGuide, Hijri helper
│   ├── tasbih/                           # TasbihModels & milestone helper
│   └── update/                           # UpdateModels, SemVer comparator & SimpleJsonParser
├── system/
│   ├── alarm/                            # PrayerAlarmScheduler (7-day setAlarmClock queue)
│   ├── audio/                            # PrayerAudioService & AutoMuteManager
│   ├── hadith/                           # HadithStatusCardRenderer (PNG share cards)
│   ├── notifications/                    # PinnedPrayerStatusService
│   ├── oem/                              # OemPowerManager (battery & autostart settings)
│   ├── receivers/                        # PrayerAlarmReceiver & SystemClockChangedReceiver
│   ├── sensor/                           # QiblaOrientationSensor
│   ├── ui/                               # PrayerWakeActivity (lockscreen wake host)
│   └── update/                           # AppUpdateEngine (GitHub Releases & SHA-256 verifier)
├── ui/
│   ├── MainActivity.kt                   # Root navigation, permissions, updater & FGS sync
│   ├── components/                       # DockedNavBar, UpdateComponents & VisualComponents
│   ├── screens/                          # Dashboard, Hadith, Companion, Settings, Onboarding & tools
│   ├── theme/                            # OLED Dark, Warm Sand Light, Dynamic Color & typography
│   └── viewmodel/                        # PrayerViewModel & HadithViewModel (StateFlow)
└── widget/                               # 5 Glance AppWidgets, receivers, updater & theme

Build & Verification

1. Local Configuration

  • Android SDK: Copy local.properties.example to local.properties and set sdk.dir to your local Android SDK path.
  • Release Signing: Copy keystore.properties.example to keystore.properties and set storeFile, storePassword, keyAlias, and keyPassword — or export HAYYA_KEYSTORE_FILE, HAYYA_KEYSTORE_PASSWORD, HAYYA_KEY_ALIAS, and HAYYA_KEY_PASSWORD.

2. Gradle Verification & Release Build

# Run all unit tests (domain, data, system, UI, widgets)
./gradlew :core:testDebugUnitTest

# Run Android Lint
./gradlew :core:lintDebug

# Assemble minified & signed release APK -> core/build/outputs/apk/release/core-release.apk
./gradlew :core:assembleRelease

3. On-Device Alarm Stress Test (ADB)

./scripts/verify_alarm_engine.sh

4. GitHub Actions CI & Automated Releases

  • Pushes and pull requests to main run :core:testDebugUnitTest and :core:lintDebug.
  • Pushing a v* tag (e.g., v1.0.0) runs verification, decodes HAYYA_KEYSTORE_BASE64, signs :core:assembleRelease, and publishes Hayya-<tag>.apk and Hayya-<tag>.apk.sha256 to GitHub Releases.
  • Required repository secrets: HAYYA_KEYSTORE_BASE64, HAYYA_KEYSTORE_PASSWORD, HAYYA_KEY_ALIAS, HAYYA_KEY_PASSWORD.

Changelog & License

  • See CHANGELOG.md for release notes.
  • Copyright © 2026 dev-Aatif. All Rights Reserved. Licensed under a proprietary license — see LICENSE for full terms. Public source visibility on GitHub is provided for transparency and security inspection only and does not grant rights to copy, modify, redistribute, or publish derivative builds.

About

100% offline, zero-telemetry Islamic prayer reminder & spiritual companion for Android. Built with Kotlin, Jetpack Compose & Glance widgets, featuring Doze-resilient exact alarms, mosque auto-silent, Qibla compass, Tasbih, Tahajjud, Ramadan hub, and Larkana Division coverage.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages