Android Zmanim Using the KosherJava Zmanim API

Android Logo
Android ZmanimThere are various software projects using the KosherJava Zmanim API. One of the active ones is Jay Gindin’s open source Android Zmanim app for the Android platform. Activity in the project is constant. The upcoming version allows the selection of a specific calculation for zmanim you want such as the zman Talis/Tefilin pictured here. There are plans to add direction to Yerushalayim functionality using the Zmanim API. (For more information on calculating bearing using the API, see Calculating the Bearing/Direction to Har Habayis Using the Zmanim API article.) A large part of Jay’s motivations for developing the code was lezecher nishmas his nephew Shemuel Reuven ben Yehudit Rachel who, lost his battle with cancer on October 21, 2009. The one very minor issue Jay had with the API (and documentation) was the Ashkenazi spelling of the zmanim names, something that as an Ashekenazi I do not plan to change :), but as you can see his Android Zmanim front end used Sephardi labeling. Asked how he found the project, he answered with the typical answer to this question

I Googled around, and found your project.

One of my goals with the API was to make it easy for developers to use and port. This was confirmed by Jay

I found it to be very easy to pull into my app, even on Android…no changes necessary, not even a recompile

ZmanimPlasma (Linux) Released

Linux on Wood Background
ZmanimPlasmaMoshe Wagner recently released ZmanimPlasma for the Linux platform. This KDE Plasma desktop widget displays the Hebrew date and zmanim on a Linux desktop. The zmanim calculations use Moshe’s C++ port Zmanim CLI wrapper that enables a C++ program to call the Java Zmanim API. There are no current plans to make this widget available on any other platform. It can be downloaded from the Luach project download page. Moshe has in the past used the Zmanim API for use in Linux and some cross platform projects. These include the above mentioned Zmanim CLI, and Zmanim GUI that uses the ZmanimCLI.

Updated on 4/13/2010 ג׳ אייר תשע״ג to reflect information from Moshe explaining that this was not a port.

Bearing to Yerushalayim and Zmanim Map 2.0

Vintage Map with CompassThe availability of the Bearing to Yerushalayim and Zmanim Map was originally announced on December 30, 2007. At the time there were a number of bugs related to the Google Map API. These bugs were reported to Google and eventually fixed. Since that time, the only change was a minor JavaScript fix for IE. The Bearing to Yerushalayim worked, but the zmanim tabs had a major issue because the timezone calculated was done based on the user’s current browser timezone. This made it tricky to check zmanim in a different location or timezone than the user’s current timezone.Zmanim tab using timezonesI recently updated the map to look-up the actual timezone of the latitude and longitude selected by the user. This was implemented by doing a look-up at the geonames.org timezone web-service. The timezone is passed to the Zmanim API and used to generate the XML output of a list of daily zmanim that is displayed in the map. Since the Olson timezone database changes a few times a year, there will almost certainly be cases where the proper timezone can’t be determined. Some of these are changes of timezone names, such as the change from Asia/Calcutta to Asia/Kolkata (my host will not run the TZ Updater tool). In these cases, a simple mapping between the old and new was added to the map. In cases where the timezone can’t be determined the timezone will default to GMT. Ocean locations within 10 km of land will use the closest landmass, but anywhere beyond 10 km will default to GMT. One issue with using the geonames.org webservice, is that when it is down, the map will timeout. I experimented with various ways of dealing with this, but unless my host updates the Java version from 1.4, they are too complex to use at this time.

See the Technical Information about the Bearing to Yerushalayim Map post for technical details about the original implementation.

FAQ: How Much Earlier is Sunrise on Mount Everest Due to Elevation?

Sunrise over Everest

Question:

How Much Earlier is Sunrise on Mount Everest Due to Elevation?

Answer:

The greatest sunrise and sunset elevation effect on Earth is on Mount Everest (at 27.988° N, 86.925° E as seen on the Direction to Yerushalayim Map). With an elevation of 8,848 Meters (29, 029 feet), sunrise would be up to 15 minutes and 31 seconds earlier on Mount Everest than at sea level. The range of the effect is from 15 minutes and 31 seconds on June 22nd, to a “low” of 13 minutes 41 seconds earlier on March 18th. Being in a large mountain range with obstructed horizons, it is likely never actually seen that early. In addition to questions about mountains, every few months I get asked about how much earlier sunrise/set can be seen in skyscrapers. There are various halacha questions as to whether this actually affects zmanim that I will mention later. Here are some raw numbers. Burj KhalifaBurj Khalifa (at 25.197° N, 55.274° E as seen on the Direction to Yerushalayim Map) is the tallest building in the world. With a height of 828 m (2,717 ft), visible sunrise to someone standing on top of the crown (something unrealistic) on June 22nd would be at 5:24:56 AM versus 5:29:31 AM on sea level, a difference of 4 minutes and 35 seconds. Sunset would be 7:16:35 PM versus 7:12:00 PM at sea level, a difference of 4 minutes and 35 seconds. A more realistic scenario would be the visibility sunrise on the highest floor (the 160th), an elevation of 672 m (2,204 ft) at 5:25:23 AM, a difference of 4 minutes and 8 seconds earlier than sea level. Sunset on the 160th floor would be 7:16:08 PM, or 4 minutes and 8 seconds later than at sea level.
As far as the halacha being affected by the elevation of buildings, the Baal Hatanya seems to indicate that tall buildings would make sunset later. See Yisroel vehazmanim ישראל והזמנים Vol II, page 910. In the Shraga Lachaim שרגא לחיים footnotes Rabbi Harfenes states that

ויש להוסיף שהוא דבר תמוה לומר דעד שלא נבנו הבנינים הגבוהים היה זמן שבת התלוי בשקעה”ח (שקיעה ראשונה להגאנים ושקיעה שניה לר”ת) מוקדם, ולאחר שנבנו יש לאחר הזמנים, ועד עכשיו שהיו בניו יארק הבנינים התאומויות (טווין-טאוע”ר בלע”ז) שכל א’ מהם היה בת ק”י קומות היה זמן השקיעה מאוחר, ועתה לאחר שהפילו והרסו אותם רשעים וזדים ארורים ימ”ש חזר הדבר לקדמותו להקדים זמן השקיעה.

Zmanim API 1.2 Released

The Zmanim API 1.2 was released today. The only change in this release is the removal of elevation as a factor in the calculation of all zmanim besides sunrise and sunset. Updated JavaDocs now reflect these changes. Please see the Elevation Now Only Impacts Sunrise and Sunset Calculations in the Zmanim API post for additional information.

I would like to thank the various people who contacted me on the subject.

The main download is the Zmanim 1.2 release zip file that includes source files and JavaDoc documentation. Also available for download (included in the above zip file) is the main zmanim-1.2.jar. The zmanimAstronomical-1.1.jar that only includes the AstronomicalCalendar was not impacted by this change, but the version has been updated to zmanimAstronomical-1.2.jar for consistency. Additional detail on the downloads can be seen on the Zmanim Download page