batoulapps / adhan-kotlin

High precision Islamic prayer time library for Java
MIT License
148 stars 47 forks source link

Multiple Questions #21

Closed tanweermaniyar closed 3 years ago

tanweermaniyar commented 3 years ago

Firstly, I must say there is a lot of thought you have put in making this Free to use Salat times library.

I have a free question if you could consider, 1) Why have you mentioned ISNA method is not recommended but added for completeness? 2) I want to be able to auto select the salat method in the Android code, any guidance you might be able to provide i.e. whether it should be based on the countries, timezones (there are far too many) or Lat/Long demarcations? 3) Would you be able to throw some light into details of adjustments applied in the Moon Sighting Committee method in your library e.g. 3 mins offset after sunset for Maghrib, 5 mins offset after twilight for Fajr etc. 4) Some apps offer you to adjust salat times to up to 120 plus or minus, while plus makes sense to some degree, why would you want to go back as much as 2 hours than designated start time- any views what is the correct way to offer time adjustments in app?

Thanks in advance.

ahmedre commented 3 years ago

i'll leave some of these to @z3bi -

  1. i'd use latitude/longitude from the device plus the default timezone (TimeZone.getDefault()) - some apps give people a way to override this.
  2. the 3 minutes for Maghrib is so the sun is completely set - see discussion here.
  3. not sure about this - i've seen apps leave it flexible (maxing out at an hour) and others at 2 hours, but not really sure if there's a good use case for this (aside from say someone wanting a reminder an hour before prayer so that they can wrap up what they're doing in time or something ¯_(ツ)_/¯).
z3bi commented 3 years ago

I will do my best to answer these questions but please keep in mind that this library is not attempting to make its own opinions related to religious rulings. The Adhan library in general should be a reflection of the times people are already using in masajid.

1) The organization ISNA (or any other organization) do not endorse the angles used by this method and there is no astronomical justification for these angles. However, a lot of masajid in the US and Canada have already adopted this method unfortunately. So until people stop using this method we make it available so that people can calculate the same prayer times that the masjid uses.

2) My approach in my own app (https://guidanceapp.com/) is to reverse geocode the user's location in order to get a country code and then based on the country code apply a default calculation method. Many methods are named after the country that uses them. You can probably also infer by proximity to another country. We don't have a complete list of countries that map to a calculation method, so this is mostly the responsibility of each developer.

3) The author of this method, Khalid Shaukat, put these times in place to fully allow the sun to move out of a position where prayer is forbidden (when the sun is exactly at its zenith and when the sun is still setting). These values are listed here https://moonsighting.com/how-we.html

4) The simplest answer is to allow for flexibility and trust that the user's are using it in a way that makes sense. In general, manual adjustment is something that should be used extremely rarely. If someone is at a point where they need to make adjustments, the scenario is already one that the developer has failed to anticipate. To attempt to further narrow down the use of this feature might be removing its utility all together.

tanweermaniyar commented 3 years ago

Thank you both for providing clarity. Much appreciated. Just out of curiosity z3bi, why note an android app on guidanceapp.com :)

z3bi commented 3 years ago

@tanweermaniyar mostly because I don't use Android 😃 Same reason why there is no version for Windows.