How to Use Volume Keys to Skip Tracks on Your Android Phones
This is a common thing that people search for – how to use the volume keys to skip tracks on Android devices? Some phone manufacturers have this built into the system, but many do not. So today I am going to show you a few different methods of enabling this feature on your Android device, no matter what kind of device you have.
The methods I’m showing you will also work with a headset that has volume control buttons, like mine pictured above. Don’t worry, we are not replacing the functionality of your volume keys – we will be making it so that normal presses still control the volume, but long presses will skip / backwards the tracks on your playlist. The first method is for rooted Android users, the second method is for non-rooted users, though the second method is a bit more technical.
Method 1: GravityBox
This method requires a rooted phone with Xposed Installer. The methods of achieving this depend on the device, so you should search Appuals for a root guide for your device, and also see the article “How to Install Xposed Framework on Android Phones”.
But once you have the Xposed Framework app installed, you just need to go into Download > search for ‘GravityBox’, and download the module for your Android version. For example, there is GravityBox JB for Jellybean, MM for Marshmallow, KK for KitKat.
Enable it under “Modules” by pressing the checkbox, and then press on the module itself to launch the GUI.
Navigate to “Media tweaks” and you’ll immediately see a checkbox for “Volume keys skip track”. Go ahead and enable that, then reboot your device.
Note that this functionality only works when your screen is turned off. So while you’re playing music, make sure your screen is off, then long-press Volume Up to skip track, and Volume Down to go back.
Method 2: Tasker
This method is better for people who cannot achieve root on their device. However, it requires the Tasker app from Google Play, which isn’t free – it’s an incredibly powerful app though, which a load of useful plugins available from various communities.
Once you install Tasker, go ahead and launch it, then disable “Beginner mode” under Preferences.
Now you need to create a new Profile and name it something like “Volume Keys Skip Tracks”. Next we will create two separate contexts, an Event and a State.
This gets a bit complicated, so try to follow as closely as you can. The Event needs to be a Variable Set, and the State should be set to Display > Display State > Off. Similar to the GravityBox method, this makes it so that you only skip tracks with volume key when the display is turned off. The reason is because, if you try to long-press the volume key with the screen turned on, the GUI volume slider pops up.
Now I’m going to include screenshots so you can make sure the Tasker variables look exactly like the screenshots, but here are all the scripts you need:
- Variables –> Variable Set. Set %diffpressed to %TIMEMS – %TimePressed. Compare the timestamp when a volume button was last pressed and when the current volume button was pressed. This will serve as the threshold to determine if you meant to change tracks or just change volume.
- Task –> If. Set it to If %diffpressed < 750 AND %Vol neq %VOLM. If you double-pressed a volume key within 750ms AND the current saved volume does not equal the current media volume (you will see why this is important later on), then we will determine how to change the track.
- Plugin –> KC Tasker Processes. Make it select Spotify or another media app (YouTube, if you use YouTube Red) that you know has difficulties being controlled via traditional media button playback events. Set the variable to %spotify. (As far as I know, apps like Spotify are the exception rather than the rule, so if later on when running this task you notice it isn’t changing tracks on your favorite media player, then come back to this step and add additional apps to check for).
- Task –> If. Set it to If %spotify ~ true.
- Media –> Media Control. Cmd: Next. Simulate Media Button: Yes. App: Spotify. Check If and set it to if %VOLM > %Vol. Will skip to next track if you pressed volume up twice.
- Media –> Media Control. Cmd: Previous. Simulate Media Button: Yes. App: Spotify. Check If and set it to if %VOLM < %Vol. Will skip to previous track if you pressed volume down twice.
- Audio –> Media Volume. Level: %Vol. This restores the volume level to what it previously was. Don’t check anything here so the change happens silently.
- Task –> Else. These next few actions apply to any general media app (eg. Google Play Music)
- Media –> Media Control. Cmd: Next. Simulate Media Button: No. Check If and set it to if %VOLM > %VOL. Will skip to next track if you pressed volume up twice.
- Media –> Media Control. Cmd: Previous. Simulate Media Button: No. Check If and set it to if %VOLM < %VOL. Will skip to previous track if you pressed volume down twice.
- Audio –> Media Volume. Level: %Vol. This restores the volume level to what it previously was. Don’t check anything here so the change happens silently.
- Task –> End If.
- Task –> Else. This will save the current time, and save the previous media volume in a variable.
- Variables –> Variable Set. Set %TimePressed to %TIMEMS.
- Variables –> Variable Set. Set %Vol to %VOLM – 1. Check if and set it to if %Vol < %VOLM.
- Variables –> Variable Set. Set %Vol to %VOLM + 1. Check if and set it to if %Vol > %VOLM.
- Task –> End If.