Prayer Times KMM

A sophisticated Kotlin Multiplatform library for precise, customizable Islamic prayer time calculations across global locations.

Powerful Features

🌍

Global Precision

Accurate prayer time calculations for any geographical location with advanced astronomical computations.

🕰️

Comprehensive Calculations

Calculate all prayer times with precise solar time tracking, seasonal adjustments, and twilight calculations.

🔧

Flexible Configuration

Extensive customization options including multiple calculation methods, Madhab support, and rounding preferences.

Quick Start Guide


// Define geographical coordinates
val coordinates = Coordinates(
    latitude = 21.4225,   // Makkah Latitude
    longitude = 39.8262   // Makkah Longitude
)

// Configure calculation parameters
val calculationParameters = CalculationParameters(
    method = CalculationMethod.UMM_AL_QURA,
    madhab = Madhab.SHAFI,
    rounding = RoundingType.NEAREST
)

// Calculate prayer times
val prayerTimes = PrayerTimes(
    coordinates = coordinates,
    dateComponents = DateComponents.now(),
    calculationParameters = calculationParameters
)

// Access individual prayer times
println("Fajr: ${prayerTimes.fajr}")
println("Sunrise: ${prayerTimes.sunrise}")
println("Dhuhr: ${prayerTimes.dhuhr}")
println("Asr: ${prayerTimes.asr}")
println("Maghrib: ${prayerTimes.maghrib}")
println("Isha: ${prayerTimes.isha}")

Platform Support

🤖

Android

Full Native Support

📱

iOS

Complete Integration

💻

JVM

Desktop Applications

Supported Calculation Methods

Islamic Methods

  • Muslim World League
  • Egyptian Authority
  • Umm Al-Qura University
  • Gulf Region

Regional Methods

  • Kuwait
  • Qatar
  • Singapore
  • Moon Sighting Committee

Additional Methods

  • Karachi
  • Tehran
  • North America
  • Custom Configuration

Why Choose PrayerTimesAPI?

🌐 Truly Cross-Platform

Unlike other solutions, PrayerTimesAPI is built with Kotlin Multiplatform, allowing seamless integration across Android, iOS, and desktop platforms. Write once, deploy everywhere.

🧮 Advanced Astronomical Calculations

Leveraging complex astronomical algorithms to provide the most accurate prayer times. We account for geographical nuances, seasonal variations, and precise solar positioning.

🔒 Open Source & Community-Driven

Transparent, community-vetted codebase with continuous improvements. Benefit from collective expertise and contribute to making prayer time calculations more accessible.

🌈 Extensive Customization

Flexible configuration options to match local practices. Support for multiple calculation methods, Madhabs, and custom rounding preferences ensures global usability.

<

Easy Installation

Gradle Setup


// Add to your shared module's build.gradle.kts
dependencies {
    implementation("com.alimrepo:prayer-times-kmm:1.0.0")
}

// Multiplatform configuration
kotlin {
    android()
    ios()
    jvm()
}

Dependency Management

  • No external dependencies beyond Kotlin standard library
  • Lightweight and optimized for performance
  • Compatible with major dependency management systems

Advanced Configuration


// Advanced Configuration Example
val advancedConfiguration = PrayerConfiguration(
    method = CalculationMethod.MUSLIM_WORLD_LEAGUE,
    madhab = Madhab.HANAFI,
    highLatitudeMethod = HighLatitudeMethod.MIDDLE_OF_THE_NIGHT,
    adjustments = PrayerTimeAdjustments(
        fajr = -2,      // Minute adjustments
        sunrise = 0,
        dhuhr = 1,
        asr = 0,
        maghrib = -1,
        isha = 2
    ),
    timeFormat = TimeFormat.TWENTY_FOUR_HOUR
)

// Dynamic location updates
locationManager.setLocationUpdateListener { newCoordinates ->
    prayerTimesCalculator.updateLocation(newCoordinates)
}

Community & Ecosystem

🌟

GitHub Stars

500+ Stars

🤝

Contributors

25+ Active Contributors

📦

Downloads

10,000+ Downloads

What Developers Say

"The most comprehensive and accurate prayer times library I've used. The multiplatform support is a game-changer!"
AK

Ahmed Khan

Mobile App Developer

"Incredible flexibility and ease of use. Handles complex calculation methods with remarkable precision."
MR

Mohammad Raza

Software Architect

Contribute to the Project

Join our open-source community and help improve PrayerTimesAPI. Whether it's bug fixes, documentation, or new features, your contribution is valuable.