B4A Library PndCommonsSunCalc - [B4A/B4J] library for calculation of sun and moon positions and phases.

Lightweight, only requires Java 8 or higher, no other dependencies. Android compatible, requires API level 26 (Android 8.0 "Oreo") or higher.

Accuracy
Astronomical calculations are far more complex than throwing a few numbers into an obscure formula and then getting a fully accurate result. There is always a tradeoff between accuracy and computing time.
This library has its focus on getting acceptable results at low cost, so it can also run on mobile devices, or devices with a low computing power. The results have an accuracy of about a minute, which should be good enough for common applications (like sunrise/sunset timers), but is probably not sufficient for astronomical purposes.
If you are looking for the highest possible accuracy, you are looking for a different library.

Original library: https://github.com/shred/commons-suncalc
Wrapper is based on v3.5 version.



 

Attachments

  • Library-PndCommonsSunCalc.zip
    49.9 KB · Views: 105
  • B4A-PndCommonsSunCalcExample.zip
    10.8 KB · Views: 99
  • B4J-PndCommonsSunCalcExample.zip
    3.6 KB · Views: 98
Last edited:
Cookies are required to use this site. You must accept them to continue using the site. Learn more…