LibreShift / red-moon

Android screen filter app for night time phone use.
GNU General Public License v3.0
642 stars 80 forks source link

RedMond: GPS Location #328

Closed falkpaulfabian2004 closed 1 year ago

falkpaulfabian2004 commented 1 year ago

For what needs red moon GPS location?

smichel17 commented 1 year ago

Sunrise and sunset times are calculated based on your location. This does not need to be precise (gps); approximate (network) location works fine. We added support for gps location due to a feature request from someone whose device had gps but did not support network location: #107

In the implementation, we first check if network location is available, and use that if it is; we only use gps location if network is not available. Here's the code: https://github.com/LibreShift/red-moon/blob/master/app/src/main/java/com/jmstudios/redmoon/service/LocationUpdateService.kt#L121