mapsme / omim

🗺️ MAPS.ME — Offline OpenStreetMap maps for iOS and Android
Apache License 2.0
4.58k stars 1.15k forks source link

Android wake lock: keep app awake (and GPS locked) when screen is turned off #930

Open warren-bank opened 8 years ago

warren-bank commented 8 years ago

Hi. Before all else, I just want to say how incredible this software project is!! I only just found it and began testing it a few days ago, which must have been immediately after the 5.2.1 release (android).

The TTS of upcoming turns works really really well. I used it along with the "routing" feature to drive through Las Vegas and I was amazed by how accurate the data was (thanks to the good people at OpenStreetMap) and how smoothly the application worked. In this particular use-case (ie: the way that I would typically use Google Maps), there are two "issues" (which I'll post separately for the sake of tracking)..

2 of 2) the way wakelocks work in Android.. I like to turn off my screen while driving and navigate using only the audible instructions (to save battery life.. plus it generally seems safer.. less of a distraction). This works wonderfully with Google Maps. With MAPS.ME (v5.2.1-Google), after I turn off the screen.. the phone will soon go into deep sleep. Presumably, the app uses a "full" wakelock that is released when the screen is turned off. What's weird is.. I used another app to manually set a "partial" wake lock that keeps the phone from going into deep sleep.. and yet MAPS.ME would still lose its GPS lock and failed to keep track of trip progress. The "simple" solution is to leave the screen on while driving. But I tend to be a fanatic about the optimization of battery life.. so having the ability to turn off the screen and allow the program to continue to voice turn-by-turn instructions would be a hugely appreciated feature.

Sorry to gush, but I'll say it again.. I love this app!! GREAT work, guys :)

warren-bank commented 8 years ago

As a follow-up thought.. if the app can detect when the screen is turned off.. then maybe how it responds to this state could be configurable via a user preference..

mode A: do what it does now.. release all resources and stop all work until the screen is turned back on

mode B: stop updating the visual UI.. no need to redraw the map if nobody is looking at it.. but continue holding onto resources (ie: GPS), monitoring trip progress, and generating TTS notification updates

another thought.. rather than having an explicit preference option to switch between these 2 modes, it could be chosen implicitly based on whether or not the TTS preference is enabled.

If TTS is off, then use mode A.
If TTS is on,  then use mode B.
mapsmetest commented 8 years ago

Dear Warren,

Thank you very much for your appreciation of our app and for your suggestion. We will consider adding it in one of our future releases.

Best regards, Timofey

On 11 Dec 2015, at 07:53, Warren Bank notifications@github.com wrote:

As a follow-up thought.. if the app can detect when the screen is turned off.. then maybe how it responds to this state could be configurable via a user preference..

mode A: do what it does now.. release all resources and stop all work until the screen is turned back on

mode B: stop updating the visual UI.. no need to redraw the map if nobody is looking at it.. but continue holding onto resources (ie: GPS), monitoring trip progress, and generating TTS notification updates

another thought.. rather than having an explicit preference option to switch between these 2 modes, it could be chosen implicitly based on whether or not the TTS preference is enabled.

If TTS is off, then use mode A. If TTS is on, then use mode B. — Reply to this email directly or view it on GitHub https://github.com/mapsme/omim/issues/930#issuecomment-163839494.

wolfv commented 7 years ago

I also encountered this issue while navigating by bike. Saving battery life is really important on long bike trips so this feature would be immensely useful.

Buckstabue commented 7 years ago

I have the same issue riding a bike. Please implement this feature. Also it would be wonderful to have an ability to increase instructor's voice volume

warren-bank commented 7 years ago

Personally, I felt that this issue was a deal breaker.

Until this functionality is added, I'll be using OsmAnd:

It's feature complete and does everything very well.

If/when this issue is fixed, I'll revisit this project and do a more thorough comparison between these 2 (open-source, offline) mapping and navigation software apps.