I want to catch the key press in my service (for example Volume up key) and print a message in console. It should work when app is open or closed.
I used dispatcherKeyEvent() but that works only for activity.
If anyone can help me, thank you in advance, I don't have much time :/