Can Osmand wake up screen?

1,378 views
Skip to first unread message

Pee Wee

unread,
Jul 15, 2013, 1:40:33 PM7/15/13
to osm...@googlegroups.com
Recently I tried Osmand for cycling using a loaded track. I've also activated a TTS voice for guidance. When I tunr off the screen I keep getting spoken directions. This is a very nice feature but I found out it is not 100% reliable/clear. So I was thinking of a feature that wakes up my sceen (for lets say 10 seconds) on the map-mode as soon as I get spoken directions.This will save battery life (compared to screen on all the time) but helps when you have to decide which road to take. Is something like this already possible? If so, what settings do I use?

cheers PeeWee

mircozorzo

unread,
Jul 15, 2013, 3:39:22 PM7/15/13
to osm...@googlegroups.com
Good idea also for car mode.

maxcol...@gmail.com

unread,
Sep 11, 2014, 6:37:14 AM9/11/14
to osm...@googlegroups.com
turn on the display only when needed, immediately after turning it off automatically, it is a good idea, useful to cyclists, to save battery. I saw this feature only on Nokia Maps for Symbian, and strangely on any of the modern GPS navigators. There is a section OsmAnd to request this implementation or to see if it has already been requested?
Thank you, Max.
 
 

Il giorno lunedì 15 luglio 2013 19:40:33 UTC+2, Pee Wee ha scritto:

Max

unread,
Sep 12, 2014, 5:34:58 AM9/12/14
to osm...@googlegroups.com
AFAIK Android does not allow an application to turn on the screen (unless it is a system app with special permissions and certificate).
If I'm wrong, please tell me and point me to the documentation or similar.

It is possible to turn the screen off, but not to turn it on again.

Regards,
Max

Pee Wee

unread,
Sep 12, 2014, 8:06:44 AM9/12/14
to osm...@googlegroups.com
Thanks Max. I hope you are wrong and that there is someone  that can proof this  ;)

Cheers
PeeWee32

Max Erickson

unread,
Sep 12, 2014, 10:29:25 AM9/12/14
to osm...@googlegroups.com


On Friday, September 12, 2014 5:34:58 AM UTC-4, Max wrote:
AFAIK Android does not allow an application to turn on the screen (unless it is a system app with special permissions and certificate).
If I'm wrong, please tell me and point me to the documentation or similar.

It is possible to turn the screen off, but not to turn it on again.

Regards,
Max


I don't really know what I'm talking about here, but this seems to offer that functionality:

http://developer.android.com/reference/android/view/WindowManager.LayoutParams.html#FLAG_SHOW_WHEN_LOCKED

(when combined with FLAG_TURN_SCREEN_ON that is also there)


Max

Max

unread,
Sep 13, 2014, 4:44:19 AM9/13/14
to osm...@googlegroups.com
Yes, you are right, it is possible to turn the screen on.
But my question was wrong, sorry.

The question is:
How to turn off the screen, without releasing PARTIAL_WAKE_LOCK, which is required for background navigation service?
It seems only to be possible to dim the screen, but it will still be on and most devices will be quite bright, even if it is dimmed to lowest possible level.

Regards,
Max

Osmandtrier

unread,
Sep 13, 2014, 5:28:24 AM9/13/14
to osm...@googlegroups.com
Am Fahrrad gibt es die Methode , dass Phone so zu montieren, sodass man es blind ausschalten kann. Das ist meiner Meinung nach der sicherste und zuverlässigste Weg.

Ansonsten geht das über Gestensteuerung. Wischbewegung und der Bildschirm ist aus. Das versagt aber bei Regen.

Es gibt auch noch die Methode über Helligkeitssensor (ist Nachts unpraktikabel) und Annäherungssensor (habe ich noch nie bei Regen probiert.)

Max

unread,
Sep 13, 2014, 7:30:06 AM9/13/14
to osm...@googlegroups.com
This would be "external" solutions to turn off the screen?
So OsmAnd can't turn off the screen by itself?

Regards,
Max

Rodolfo

unread,
Sep 13, 2014, 10:02:35 AM9/13/14
to osm...@googlegroups.com
Maybe the screen cannot be switched off, but the screen timeout can be changed.
I use a Tasker task to achieve this for another app. It sets the timeout to 7 seconds (=minimum), then, when the screen is off,  it sets the timeout back to normal.
If Tasker can do this, then Osmand can do it too or not?.
Rodolfo

Massimiliano Colombi

unread,
Sep 13, 2014, 4:31:27 PM9/13/14
to osm...@googlegroups.com
Hi Max.
The most important thing to save battery on bicycle is that the screen is not lit at all times, and that there is no need to manually intervene to lock and unlock it continuously.
Even without unlocking the screen and turn it on, it would be possible to only display the map in navigation, leaving the screen locked? 
The flag SHOW_WHEN_LOCKED could leave locked the screen, but do see the map for a few seconds (settable), and turn it off again until the announcement of the next voice? 
It does not matter if the screen is unlocked, it is not necessary to press buttons for this purpose.

I am very satisfied OsmAnd, is the best GPS navigator I've tested, and tomorrow will buy the + version to support it, but I think it still lacks this essential feature for me. 
P.S. Locus does ... :-)

Thanks, Max C.

--
You received this message because you are subscribed to a topic in the Google Groups "Osmand" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/osmand/7TB9_5862Xw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to osmand+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Max

unread,
Sep 16, 2014, 8:37:31 AM9/16/14
to osm...@googlegroups.com
Hi all,

I did a first implementation.
Announcements turn the screen on for x seconds.
If there is another announcement within this time span, the x seconds start again.
After the time is over, the screen turns off, until next announcement.

Now I will clean up the implementation and add some options.

But sadly there is an issue, if the screen is turned on, sometimes the announcement is played twice, but I don't know why.
Also if the screen is turned on, OsmAnd sometimes says "route has been recalculated", but this also happened before, if I turned the screen on with the power button, thus I think this bug has been there before.

But it is a really nice feature, I will do some outdoor tests today.

Regards,
Max

Massimiliano Colombi

unread,
Sep 16, 2014, 10:54:33 AM9/16/14
to osm...@googlegroups.com
Good!
Thanks a lot.
Max for President :-)
I do not know if I made a mistake, yesteday I opened issue 2410 on Osmand project.
 
Regards,
Max C.

 

--

Pee Wee

unread,
Sep 16, 2014, 1:03:08 PM9/16/14
to osm...@googlegroups.com



I did a first implementation.
Announcements turn the screen on for x seconds.
If there is another announcement within this time span, the x seconds start again.
After the time is over, the screen turns off, until next announcement.

Well done Max.  Will it be availabe in the next nightly-build?

Now I will clean up the implementation and add some options.

But sadly there is an issue, if the screen is turned on, sometimes the announcement is played twice, but I don't know why.
Also if the screen is turned on, OsmAnd sometimes says "route has been recalculated", but this also happened before, if I turned the screen on with the power button, thus I think this bug has been there before.
I can confirm this. It happenend before aslo.

Cheers
PeeWee32

mircozorzo

unread,
Sep 16, 2014, 9:12:27 PM9/16/14
to osm...@googlegroups.com
Great! Thanks.

mircozorzo

unread,
Sep 16, 2014, 9:13:41 PM9/16/14
to osm...@googlegroups.com
So do I.

maxcol...@gmail.com

unread,
Oct 1, 2014, 4:50:28 AM10/1/14
to osm...@googlegroups.com
Hi Max.
I opened issue number 2410 requesting this feature.
Victor, however, says that is not possible and changed the status to WONTFIX. 
But it seems that you've succeeded. 
You may add your input and try to convince Victor to implement this feature, requested by many users? 
thanks, 
Max C.

Mirco Zorzo

unread,
Nov 4, 2014, 9:45:25 AM11/4/14
to osm...@googlegroups.com
Look into nightly build there is that feature.

Pee Wee

unread,
Nov 4, 2014, 12:08:26 PM11/4/14
to osm...@googlegroups.com
This is very good news. I will try this this weekend. Thanks for making this possible.

Cheers
PeeWee32


Op dinsdag 4 november 2014 15:45:25 UTC+1 schreef Mirco Zorzo:

Pee Wee

unread,
Nov 8, 2014, 10:22:46 AM11/8/14
to osm...@googlegroups.com

If tried the nighly builds with this feature. Osmand does wake up my screen and also goes back to sleep. That is very good news.
The only problem I have is that the screen is not updated. Every time the screen wakes up it shows the map of the starting position. I guess we're almost there ;-)

Using Osmand nightlies on Acer Liquid Duo. Android 4.2.2

Cheers
PeeWee32

Max

unread,
Nov 8, 2014, 10:16:44 PM11/8/14
to osm...@googlegroups.com

The only problem I have is that the screen is not updated. Every time the screen wakes up it shows the map of the starting position.

Yes, this is caused by a wrong "return", which will be removed, if my pull request will be merged:
https://github.com/osmandapp/Osmand/pull/948
This should also fix the recalculation issue on resume (screen on).
The route was always recalculated, if the screen turns on, because the check if the destination or the waypoints changed always returned "true".

Regards,
Max

Mirco Zorzo

unread,
Nov 9, 2014, 2:42:39 AM11/9/14
to osm...@googlegroups.com
Great!

goo...@torsten-metzner.de

unread,
Nov 9, 2014, 7:08:48 PM11/9/14
to osm...@googlegroups.com


Am Samstag, 8. November 2014 16:22:46 UTC+1 schrieb Pee Wee:

If tried the nighly builds with this feature. Osmand does wake up my screen and also goes back to sleep. That is very good news.
The only problem I have is that the screen is not updated. Every time the screen wakes up it shows the map of the starting position. I guess we're almost there ;-)


That's interested. Today I used the 1.9.2g Version of Osmand+ (from the Play Store) while riding with my bicycle.   I had the following behaviour:
  • The screen wakes up
    • If it wakes up it shows the right position. I had activated 'display position always in center' on the 'Configure screen' page. And 'Auto-center map view' in the Navigation settings was set to 15sec.
  • The screen goes not back to sleep. So I deactivated the function ('Turn on the screen' in the Navigation settings)  during my ride.
I was using a Defy+ with CM11 (the nightly build from 23.09.14.).

Mirco Zorzo

unread,
Nov 10, 2014, 3:24:29 AM11/10/14
to osm...@googlegroups.com
Max's pull request was merged yesterday, please try the nightly build to test the fully functionality of this feature.

Mirco Zorzo

unread,
Nov 10, 2014, 4:00:16 PM11/10/14
to osm...@googlegroups.com
It works great!!! :-) Thanks Max and to all the developers! Nice software.

Max

unread,
Nov 10, 2014, 5:53:39 PM11/10/14
to osm...@googlegroups.com

  • The screen goes not back to sleep. So I deactivated the function ('Turn on the screen' in the Navigation settings)  during my ride.
Do you have the lock screen (Android) enabled?
I guess not, because the old "Turn on the screen" implementation does not work, if the lock screen (Android) is not enabled.

Latest OsmAnd nightly builds use a completely different way to turn off the screen (OsmAnd 1.9.2.g was released with an older "screen off" implementation).
If you want to test latest nightly build, please report back, if it is working or not.
http://download.osmand.net/latest-night-build/OsmAnd-default.apk

Regards,
Max

tormet

unread,
Nov 12, 2014, 12:16:32 PM11/12/14
to osm...@googlegroups.com


  • The screen goes not back to sleep. So I deactivated the function ('Turn on the screen' in the Navigation settings)  during my ride.
Do you have the lock screen (Android) enabled?

 Thanks Max you are right, 'Lock screen' was disabled.

I guess not, because the old "Turn on the screen" implementation does not work, if the lock screen (Android) is not enabled.

Sorry for the late respond I just found the time to test it.
If I set 'Lock scree'  to 'Immediately'  (after the screen goes to sleep), then it "works" as Pee Wee mentioned (without updating the position). Works in " because for me this is not an option, I think it does not work and the combination with 'Turn on the screen' and 'screen lock' off is much more practicable.

Latest OsmAnd nightly builds use a completely different way to turn off the screen (OsmAnd 1.9.2.g was released with an older "screen off" implementation).
If you want to test latest nightly build, please report back, if it is working or not.
http://download.osmand.net/latest-night-build/OsmAnd-default.apk

I will install it today and test it tomorrow. Mirco mentioned that it works, so I expect the same for me. I will give feedback after the test.

Thanks and also thank you for Osmand, great App!

tormet

unread,
Nov 13, 2014, 7:30:17 PM11/13/14
to osm...@googlegroups.com

.

Latest OsmAnd nightly builds use a completely different way to turn off the screen (OsmAnd 1.9.2.g was released with an older "screen off" implementation).
If you want to test latest nightly build, please report back, if it is working or not.
http://download.osmand.net/latest-night-build/OsmAnd-default.apk

I will install it today and test it tomorrow. Mirco mentioned that it works, so I expect the same for me. I will give feedback after the test.


I just had a walk and it works pretty well. The last rides with the bicycle were fun, the next ones will be more fun!

Ciao,
Torsten

Pee Wee

unread,
Nov 14, 2014, 10:26:13 AM11/14/14
to osm...@googlegroups.com
I tried it today and it works almost exactly like I hoped for. Yes almost.  There is one tiny issue I would like to see fixed (if possible)

When the screen wakes up the map seems to be pointed "north up" for a fraction of a second en then the screen goes to "in direction of movement" (which is my setting)

Can this be fixed?

Even if it can not... this is still a great achievement. Thanks for making this possible.

Cheers
PeeWee32

Pee Wee

unread,
Nov 16, 2014, 1:55:36 AM11/16/14
to osm...@googlegroups.com

One more question. I got some feedback from another user. He does not like the voice announcements but would also like to see the screen switched on whenever there is an instruction. As a workaround he could turn down the volume but hat also means no volume when there is a phone call.

It seems it should be possible to have the wake up feature work  regardless of selecting a voice or "do not use" in the "voice guidance" selection.
Is this possible?


Mirco Zorzo

unread,
Nov 17, 2014, 3:18:53 AM11/17/14
to osm...@googlegroups.com
Simply turn off sound in OsmAnd, tap on " Option > The sound is on " to toggle it off.

Pee Wee

unread,
Nov 17, 2014, 12:02:16 PM11/17/14
to osm...@googlegroups.com
Thanks Mirco.

But where exactly can I find this option? Or do I have to configure this somehow?  I am using nightly builds.


Op maandag 17 november 2014 09:18:53 UTC+1 schreef Mirco Zorzo:

Mirco Zorzo

unread,
Nov 17, 2014, 2:39:29 PM11/17/14
to osm...@googlegroups.com
Hi, with a route yet planned select >option>and then "The sound is on" 


so the write will toggle to "The sound is off"



Nightly so do I, every day.

Bye, Mirco

Max

unread,
Nov 18, 2014, 5:03:22 AM11/18/14
to osm...@googlegroups.com

Max

unread,
Nov 18, 2014, 5:05:58 AM11/18/14
to osm...@googlegroups.com
But "Wake on voice" will not work with "sound off", the screen will stay off.

Regards,
Max

Pee Wee

unread,
Nov 18, 2014, 2:50:44 PM11/18/14
to osm...@googlegroups.com


Op dinsdag 18 november 2014 11:05:58 UTC+1 schreef Max:
But "Wake on voice" will not work with "sound off", the screen will stay off.

In my nightly build the option is called "turn on screen" and underneath it says "Turn on the phone screen when approaching a turn"  There is no link with a "voice" which I think is OK. This makes it possible to switch on the screen regardless whether you have voice assistance on or not. This seems OK to me so will that be the way it will be implemented?

Max

unread,
Nov 28, 2014, 4:56:28 AM11/28/14
to osm...@googlegroups.com

But "Wake on voice" will not work with "sound off", the screen will stay off.

In my nightly build the option is called "turn on screen" and underneath it says "Turn on the phone screen when approaching a turn"

Internal, it is called "wake on voice", so the text shown to the user is a little bit misleading:
<string name="wake_on_voice">Turn on the screen</string>
<string name="wake_on_voice_descr">Turn on the phone screen when approaching a turn</string>
 
There is no link with a "voice" which I think is OK. This makes it possible to switch on the screen regardless whether you have voice assistance on or not.

Currently it is actually implemented as "wake on voice".
 
This seems OK to me so will that be the way it will be implemented?

I don't know, if someone will change is, maybe I will do it.

Regards,
Max

Marian Flassik

unread,
Nov 27, 2015, 6:27:32 AM11/27/15
to Osmand
Thanks a lot,

It seems, that this feature works well on my Sony Xperia Z3 Compact.
I have just one suggestion: Can you check display proximity sensor before turniong screen on ? If my phone is in my pocket, it should not turn the screen on
(now it turns screen on when I hold my finger on proximity sensor - may be just some problem of my phone ?)

Than for nice feature anyway.

Dňa utorok, 16. septembra 2014 14:37:31 UTC+2 Max napísal(-a):

Max

unread,
Dec 18, 2015, 5:30:45 AM12/18/15
to Osmand

I have just one suggestion: Can you check display proximity sensor before turniong screen on ? If my phone is in my pocket, it should not turn the screen on
(now it turns screen on when I hold my finger on proximity sensor - may be just some problem of my phone ?)

Proximity sensor is currently not used, but I think this is a good idea.

Regards,
Max
Reply all
Reply to author
Forward
0 new messages