A sophisticated Kotlin Multiplatform library for precise, customizable Islamic prayer time calculations across global locations.
Accurate prayer time calculations for any geographical location with advanced astronomical computations.
Calculate all prayer times with precise solar time tracking, seasonal adjustments, and twilight calculations.
Extensive customization options including multiple calculation methods, Madhab support, and rounding preferences.
// 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}")
Full Native Support
Complete Integration
Desktop Applications
Unlike other solutions, PrayerTimesAPI is built with Kotlin Multiplatform, allowing seamless integration across Android, iOS, and desktop platforms. Write once, deploy everywhere.
Leveraging complex astronomical algorithms to provide the most accurate prayer times. We account for geographical nuances, seasonal variations, and precise solar positioning.
Transparent, community-vetted codebase with continuous improvements. Benefit from collective expertise and contribute to making prayer time calculations more accessible.
Flexible configuration options to match local practices. Support for multiple calculation methods, Madhabs, and custom rounding preferences ensures global usability.
// 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()
}
// 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)
}
500+ Stars
25+ Active Contributors
10,000+ Downloads
"The most comprehensive and accurate prayer times library I've used. The multiplatform support is a game-changer!"
Ahmed Khan
Mobile App Developer
"Incredible flexibility and ease of use. Handles complex calculation methods with remarkable precision."
Mohammad Raza
Software Architect
Join our open-source community and help improve PrayerTimesAPI. Whether it's bug fixes, documentation, or new features, your contribution is valuable.