{"id":24623246,"url":"https://github.com/sultanayubi360/prayertime_library","last_synced_at":"2026-05-20T07:32:05.669Z","repository":{"id":273523756,"uuid":"919982854","full_name":"SultanAyubi360/PrayerTime_Library","owner":"SultanAyubi360","description":"High precision Islamic prayer time library for Java and kotlin.Prayer Times provides a set of handy functions to calculate prayer times for any location around the world, based on a variety of calculation methods currently used in Muslim communities.","archived":false,"fork":false,"pushed_at":"2025-01-22T12:31:04.000Z","size":385,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-19T03:16:35.724Z","etag":null,"topics":["android-library","islamic-prayer-times","java","kotlin","library","muslim","muslim-app","muslim-prayer-times","namaz","prayer-times","prayer-times-app","prayers","prayertimes"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SultanAyubi360.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-21T11:06:40.000Z","updated_at":"2025-02-04T04:36:06.000Z","dependencies_parsed_at":"2025-01-21T12:43:45.451Z","dependency_job_id":null,"html_url":"https://github.com/SultanAyubi360/PrayerTime_Library","commit_stats":null,"previous_names":["sultanayubi360/prayertime_library"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SultanAyubi360%2FPrayerTime_Library","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SultanAyubi360%2FPrayerTime_Library/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SultanAyubi360%2FPrayerTime_Library/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SultanAyubi360%2FPrayerTime_Library/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SultanAyubi360","download_url":"https://codeload.github.com/SultanAyubi360/PrayerTime_Library/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244345095,"owners_count":20438241,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android-library","islamic-prayer-times","java","kotlin","library","muslim","muslim-app","muslim-prayer-times","namaz","prayer-times","prayer-times-app","prayers","prayertimes"],"created_at":"2025-01-25T03:57:22.211Z","updated_at":"2026-05-20T07:32:05.656Z","avatar_url":"https://github.com/SultanAyubi360.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PrayerTime Library\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://i.ibb.co/y0rk0Qp/950d55da-7eee-4d9d-a4a3-b588d1c0fd25.png\"\u003e\n\u003c/p\u003e\n\u003c/br\u003e\n\n**Fixed and Calculated Prayer Times**:\nMost cities around the world find their prayer times by using some calculations which is based on location (longitude and latitude) but some other cities have fixed time table for their prayer times. This library contains most fixed and calculated prayer times. Now you can contribute it to improve it and also you can use it in Muslim communities or Muslim apps.Muslims have 5 prayers per day, at each time all muslims are notified by Azan, to pray. first Muslims used to calcualte prayer time with sun raise and sun shadows, but to simplyied it and make it moreaccurent speacilly in cloudy cities, Mosques currently use a complex calcualtion based on latitude, longitude, height, timezone, sun raise time.Prayer Times provides a set of handy functions to calculate prayer times for any location around the world, based on a variety of calculation methods currently used in Muslim communities.\n\n\u003cdiv align=\"center\"\u003e\n\n[![](https://jitpack.io/v/SultanAyubi360/PrayerTime_Library.svg)](https://jitpack.io/#SultanAyubi360/PrayerTime_Library/1.1)\n![Status](https://img.shields.io/badge/Status-Active-brightgreen) ![Kotlin](https://img.shields.io/badge/Kotlin-100%25-brightgreen) ![](https://img.shields.io/badge/Platform-Android-brightgreen.svg)\n\n\u003c/div\u003e\n\n\n## What is PrayerTime library?  \n  \nLibrary aiming to calculate prayer time with one line code , if you implement prayer time application , there is no need to do this headache again .  \n  \nIslam Time prayers is every complex to calculate, cause there is many variables in this calculations like:  \n  \n- **latitude**  \n- **longitude**  \n- **timezone**  \n- **height**  \n- **The Way of Calculation**   \n\n\nPrayerTime library enables you to determin latitude, longitude, timezone, height, The Way of Calculation as Inputes. \n\n\n## ✨ Sample Videos\n\n\u003ckbd\u003e\n\n\u003cvideo src=\"https://github.com/user-attachments/assets/fc44135b-fc86-4d71-85e2-ec3d4dc98d91\" width=\"30\" height=\"30\" /\u003e \n\n\u003c/kbd\u003e\n\n\u003ckbd\u003e\n\n\u003cvideo src=\"https://github.com/user-attachments/assets/36bb687a-59b8-41dc-a09a-bdcef2ed036c\" width=\"30\" height=\"30\" /\u003e\n\n\u003c/kbd\u003e\n\n## How to use ? \n\n### Step 1\n\nAdd this in your root build.gradle at the end of repositories\n- in your `allprojects` section , you have to add  `maven { url 'https://jitpack.io' }`\n  \n#### In older Gradle Style (Build.gradle (project level))\n```\nallprojects {\n  repositories {\n    ...\n    maven { url 'https://jitpack.io' }\n  }\n}\n```\n\n#### In New Project Structure (Settings.gradle)\n```\ndependencyResolutionManagement {\n    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)\n    repositories {\n        ......\n        maven { url 'https://jitpack.io' }\n        .....\n    }\n}\n```\n\n### Step 2\n\nAdd the dependency in your build.gradle.\n\n# For groovy DSL\n\n```\ndependencies {\n    implementation 'com.github.SultanAyubi360:PrayerTime_Library:1.1'\n}\n```\n\n# For Kotlin DSL\n\n```\ndependencies {\n    implementation (\"com.github.SultanAyubi360:PrayerTime_Library:1.1\")\n}\n```\n---\n\n## Step 3\n\n## How to implement and use methods:\n\nYou will need to create a new instance of `PrayerTime`. Once the PrayerTimes object has been initialized pass Calculation Parameters in `getPrayerTimes()` method which take 4 arguments current date,latitude longitude and timezone.Once the instance are configured, you can call `getPrayerTimes()`.\n\n## Full implementation\n\n* Java\n```java\n \n        // create a new instance of `PrayerTime`\n        PrayTime prayers = new PrayTime();\n\n        // Getting the system timezone from the device\n        double timezone = prayers.getBaseTimeZone(); \n\n        // Setting the time format to 12-hour format\n        prayers.setTimeFormat(prayers.Time12);\n\n        // Setting the calculation method to Karachi\n        prayers.setCalcMethod(prayers.Karachi);\n\n        // Setting the juristic method for Asr to Hanafi\n        prayers.setAsrJuristic(prayers.Hanafi);\n\n         // Adjusting for high latitudes\n        prayers.setAdjustHighLats(prayers.AngleBased);\n\n        // Get the current date\n        Calendar cal = Calendar.getInstance();\n\n       // Give latitude and longitude now i give hardcoded which will be change with current location of user after getting location permission.\n        double latitude = 33.5953143;\n        double longitude = 73.0412202;\n\n        // Get prayer times\n        ArrayList\u003cString\u003e prayerTimes = prayers.getPrayerTimes(cal, latitude, longitude, timezone);\n\n       // Get prayer names\n        ArrayList\u003cString\u003e prayerNames = prayers.getTimeNames();\n```\n\n* Kotlin\n```Kotlin\n\n    //create a new instance of `PrayerTime`\n    val prayers = PrayTime()\n\n    // Getting the system timezone from the device\n    val timezone: Double = prayers.getBaseTimeZone()\n\n    // Setting the time format to 12-hour format\n    prayers.setTimeFormat(prayers.Time12)\n\n    // Setting the calculation method to Karachi\n    prayers.setCalcMethod(prayers.Karachi)\n\n    // Setting the juristic method for Asr to Hanafi\n    prayers.setAsrJuristic(prayers.Hanafi)\n\n    // Adjusting for high latitudes\n    prayers.setAdjustHighLats(prayers.AngleBased)\n\n    // Get the current date\n    val cal: Calendar = Calendar.getInstance()\n\n    // Give latitude and longitude now i give hardcoded which will be change with current location of user after getting location permission.\n    val latitude = 33.5953143\n    val longitude = 73.0412202\n\n    // Get prayer times\n    val prayerTimes: ArrayList\u003cString\u003e = prayers.getPrayerTimes(cal, latitude, longitude, timezone)\n\n    // Get prayer names\n    val prayerNames: ArrayList\u003cString\u003e = prayers.getTimeNames()\n```\n---\n\n## Step 4\n\n## Prayer Times\n\nOnce the `PrayerTimes` object has been initialized it will contain values for all five prayer times and the time for sunrise. To display these Prayer times and Prayer names you can use both ArrayLists we have  'prayerTimes' and 'prayerNames'. Now i am using these to set data in adapter and show in recyclerview see below.You guys can create recyclerview and adapter according to your requirements, Here just I give you idea how to pass list to adapter and show records in recyclerview.\n\n* Java\n```java\n\nprayerModelList = new ArrayList\u003c\u003e();\n        for (int i = 0; i \u003c prayerTimes.size(); i++) {\n            String imageUrl;\n            switch (prayerNames.get(i).toLowerCase()) {\n                case \"fajr\":\n                    imageUrl = FAJR_URL;//image urls to set in imageview in recyclerview item pass \"https://i.ibb.co/qdm2t9M/Fajr-Prayer-English.png\" like this also.\n                    break;\n                case \"sunrise\":\n                    imageUrl = SUNRISE_URL;\n                    break;\n                case \"zuhar\":\n                    imageUrl = DHUHR_URL;\n                    break;\n                case \"asar\":\n                    imageUrl = ASR_URL;\n                    break;\n                case \"sunset\":\n                    imageUrl = SUNSET_URL;\n                    break;\n                case \"maghrib\":\n                    imageUrl = MAGHRIB_URL;\n                    break;\n                case \"isha\":\n                    imageUrl = ISHA_URL;\n                    break;\n                default:\n                    imageUrl = \"\";\n                    break;\n            }\n            prayerModelList.add(new PrayerModel(imageUrl, prayerNames.get(i), prayerTimes.get(i)));\n        }\n\n        // Set up the RecyclerView\n        prayerAdapter = new PrayerAdapter(prayerModelList, this);\n        live_rv.setLayoutManager(new LinearLayoutManager(this));\n        live_rv.setAdapter(prayerAdapter);\n```\n\n* Kotlin\n```Kotlin\n\nval prayerModelList = ArrayList\u003cPrayerModel\u003e()\n\nfor (i in prayerTimes.indices) {\n    val imageUrl: String = when (prayerNames[i].toLowerCase()) {\n        \"fajr\" -\u003e FAJR_URL //image urls to set in imageview in recyclerview item pass \"https://i.ibb.co/qdm2t9M/Fajr-Prayer-English.png\" like this also.\n        \"sunrise\" -\u003e SUNRISE_URL\n        \"zuhar\" -\u003e DHUHR_URL\n        \"asar\" -\u003e ASR_URL\n        \"sunset\" -\u003e SUNSET_URL\n        \"maghrib\" -\u003e MAGHRIB_URL\n        \"isha\" -\u003e ISHA_URL\n        else -\u003e \"\"\n    }\n\n    prayerModelList.add(PrayerModel(imageUrl, prayerNames[i], prayerTimes[i]))\n}\n\n// Set up the RecyclerView\nval prayerAdapter = PrayerAdapter(prayerModelList, this)\nlive_rv.layoutManager = LinearLayoutManager(this)\nlive_rv.adapter = prayerAdapter\n\n```\n---\n\n## ✨ Screenshots\n\n\u003ckbd\u003e\n\t\n\u003cimg src=\"https://i.ibb.co/BnkJSxZ/Media-1.jpg\" width=40% height=30%/\u003e\n\u003cimg src=\"https://i.ibb.co/n8SckX7/Media.jpg\" width=40% height=30%/\u003e\n\n\u003c/kbd\u003e\n\n#### Calculation parameters\n\nThe rest of the needed information is contained within the `CalculationParameters`.It is recommended to use one of the pre-populated instances in the `CalculationMethod` class. You can then further customize the calculation parameters if needed.\n\n\n| Parameter | Description |\n| --------- | ----------- |\n| `TimeFormat`| Time Format 12-hour format or other|\n| `method`    | CalculationMethod name |\n| `AsrJuristic`| Juristic method for Asr |\n| `fajrAngle` | Angle of the sun used to calculate Fajr |\n| `ishaAngle` | Angle of the sun used to calculate Isha |\n| `ishaInterval` | Minutes after Maghrib (if set, the time for Isha will be Maghrib plus ishaInterval) |\n| `madhab` | Value from the Madhab object, used to calculate Asr |\n| `highLatitudeRule` | Value from the HighLatitudeRule object, used to set a minimum time for Fajr and a max time for Isha |\n| `adjustments` | JavaScript object with custom prayer time adjustments in minutes for each prayer time |\n\n**TimeFormat**\n\n| Value | Description |\n| ----- | ----------- |\n| `Time24` | 24-hour format |\n| `Time12` | 12-hour format |\n| `Time12NS` |12-hour format with no suffix |\n| `Floating` |floating point number |\n\n\n**CalculationMethod**\n\n| Value | Description |\n| ----- | ----------- |\n| `MUSLIM_WORLD_LEAGUE` | Muslim World League. Fajr angle: 18, Isha angle: 17 |\n| `EGYPTIAN` | Egyptian General Authority of Survey. Fajr angle: 19.5, Isha angle: 17.5 |\n| `KARACHI` | University of Islamic Sciences, Karachi. Fajr angle: 18, Isha angle: 18 |\n| `UMM_AL_QURA` | Umm al-Qura University, Makkah. Fajr angle: 18, Isha interval: 90. *Note: you should add a +30 minute custom adjustment for Isha during Ramadan.* |\n| `NORTH_AMERICA` | Referred to as the ISNA method. This method is included for completeness but is not recommended. Fajr angle: 15, Isha angle: 15 |\n| `TEHRAN` | Institute of Geophysics, University of Tehran. Fajr angle: 17.7, Isha angle: 14 |\n| `JAFARIA` | Ithna Ashari Fajr angle: 16, Isha angle: 14 |\n| `Custom` | Custom Setting |\n\n**Madhab**\n\n| Value | Description |\n| ----- | ----------- |\n| `SHAFI` | Earlier Asr time |\n| `HANAFI` | Later Asr time |\n\n**HighLatitudeRule**\n\n| Value | Description |\n| ----- | ----------- |\n| `MIDDLE_OF_THE_NIGHT` | Fajr will never be earlier than the middle of the night and Isha will never be later than the middle of the night |\n| `SEVENTH_OF_THE_NIGHT` | Fajr will never be earlier than the beginning of the last seventh of the night and Isha will never be later than the end of the first seventh of the night |\n| `ANGLEBASED` | Similar to `SEVENTH_OF_THE_NIGHT`, but instead of 1/7, the fraction of the night used is fajrAngle/60 and ishaAngle/60 |\n| `NONE` | No adjustment |\n\n### Configurations\n* `setTimeFormat` To change the time format to:\n\t* `Time24`  24-hour format\n\t* `Time12`  12-hour format\n\t* `Time12NS`  12-hour format with no suffix\n\t* `Floating`  floating point number\n* Java\n```java\nprayers.setTimeFormat(prayers.Time12);\n```\n* Kotlin\n```Kotlin\nprayers.setTimeFormat(prayers.Time12)\n```\n\n* `setCalcMethod` To change the Calculation Methods.\n\t* `Karachi`  University of Islamic Sciences, Karachi\n\t* `ISNA`  Islamic Society of North America (ISNA)\n\t* `MWL`  Muslim World League (MWL)\n\t* `Makkah`  Umm al-Qura, Makkah\n\t* `Egypt`  Egyptian General Authority of Survey\n\t* `Jafari`  Ithna Ashari\n\t* `Tehran`  Institute of Geophysics, University of Tehran\n\t* `Custom`  Custom Setting\n* Java\n```java\n prayers.setCalcMethod(prayers.Karachi);\n```\n* Kotlin\n```Kotlin\nprayers.setCalcMethod(prayers.Karachi)\n```\n\n* `setAsrJuristic` To change Juristic Method for Asr\n\t* `Shafii`  Shafii (standard)\n\t* `Hanafi`  Hanafi\n* Java\n```java\n prayers.setAsrJuristic(prayers.Hanafi);\n```\n* Kotlin\n```Kotlin\nprayers.setAsrJuristic(prayers.Hanafi)\n```\n\n* `setAdjustHighLats` Adjusting Methods for Higher Latitudes\n\t* `None`  No adjustment\n\t* `MidNight`  middle of night\n\t* `OneSeventh`  1/7th of night\n\t* `AngleBased`  angle/60th of night\n* Java\n```java\n prayers.setAdjustHighLats(prayers.AngleBased);\n```\n* Kotlin\n```Kotlin\nprayers.setAdjustHighLats(prayers.AngleBased)\n```\n\n## Reporting an issue\n\nIf you are going to report an issue, I will greatly appreciate you including some code which I can run to see the issue. By doing so you maximize the chance that I will fix the problem. \nBy the way, before reporting a problem, try replacing DiscreteScrollView with a RecyclerView. If the problem is still present, it's likely somewhere in your code.\n\n\n## Find this library useful? :heart:\n\nHowever, if you get some profit from this or just want to encourage me to continue creating stuff, there are few ways you can do it. :coffee: :hamburger: :fries: :apple:\n\nSupport it by joining stargazers to this. ⭐\n\nAlso, [follow me on GitHub](https://github.com/SultanAyubi360) for my next creations! 🤩\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsultanayubi360%2Fprayertime_library","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsultanayubi360%2Fprayertime_library","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsultanayubi360%2Fprayertime_library/lists"}