Open GoogleCodeExporter opened 9 years ago
Hm interesting... Not sure the PTT button can be processed while the device is
sleeping, because I don't know who has the focus in this state...
Original comment by nicolas@guillaumin.me
on 25 Jan 2013 at 4:06
I have no idea how but it can definitely be done. For example I can
pause/resume pandora using my headset button while the screen is off. Same with
several other music players I have tried.
I think the really tricky part is what happens if you have multiple apps
listening to it at the same time. Like if I'm playing pandora AND using
OsmTracker at the same time. I have no idea what happens then :)
But yes, it would be really nice to be able to leave the screen off while I'm
driving and just use the PTT button. Obviously there is the power consumption
of the screen. The cops also can't see screen glow at night and pull you over
for texting while driving :)
Original comment by toby.mur...@gmail.com
on 25 Jan 2013 at 6:04
I never really looked into how it's done, but the stock music player does it
too.
Searching on the net, I came across this:
http://android-developers.blogspot.de/2010/06/allowing-applications-to-play-nice
r.html
Generally, the last app to register is the first to get the event. Apps are
expected to register and unregister in a responsible manner, that is, register
when the user likely expects them to respond to button presses, and unregister
when this is no longer the case.
So the question of how multiple apps should be handled becomes mostly a design
question. I think the order should be:
1. Phone app (it probably inserts itself only when a call comes in and would
thus be the first to receive the event anyway)
2. OSMTracker
3. Media players
The order for the last two can be configurable, e.g. by a PTT setting like:
Use push-to-talk button to control voice recording:
- Always
- Only when app is in foreground (i.e. in tracking view, in map view, but not
when the screen is off or another app is in the foreground)
- Never
Original comment by mich...@vonglasow.com
on 25 Jan 2013 at 11:20
Original issue reported on code.google.com by
mich...@vonglasow.com
on 20 Jan 2013 at 7:24