• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[GUIDE][Intermediate] CHANGE MUSIC BY WAVING: Previous & Next song!

Search This thread

fenchai

Senior Member
May 10, 2011
580
73
REQUIREMENTS?
  • TASKER
  • PHONE WITH PROXIMITY SENSOR
  • NO ROOT REQUIRED
  • COMMON SENSE

WHAT Does this do?

This will basically change your music tracks (previous and next) by waving your hand

HOW does it do it?

You hand activates the Proximity sensor (be sure to locate yours before trying this lol) Then it goes into the details by detecting if your hand is still hanging in there, if your hand is not there, it will change to the next track, if your hand is still holding up, it will Rewind the song, do it again and it will change to the previous song.

WHEN do you want to use this?
  • On Car, You are driving, want to change tracks while driving? well just wave your hand instead of even looking at your phone. (ok you look a bit but you get the idea) No more accidents, looks cool when you do it in front of your newbie friends, yeah go ahead and tell them to do it with their iPhones XD Just remember to paste your phone into a place you can reach or use one of those universal phone holders.
  • On some desktop for whatever reason you dont have a computer or cant play songs on your pc? Activate this with Bluetooth see magic with a wave of your hands
  • You want to see the magic and how futuristic it is when you wave and the machine speaks back to you :D

OK, Lets get Started

  1. Create a Profile, (name it to Prox=1) Select State, Select Proximity Sensor
  2. Task>Variable Set>Name: %Prox to covered
  3. Create Another Profile, (name it to Prox=0)Select State, Select Proximity Sensor But This Time Check on Invert
  4. Task>Variable>Set>Name: %Prox to uncovered
  5. Create Another Profile(name it to Prev and Next), Select State, Select Proximity Sensor
  6. wait (515MS) <---This is an Important Factor on this project, this determines how long your hand should stay in the proximity sensor, the shorter the wait, the faster it will trigger, change as required.
  7. if %Prox ~ uncovered & %SCREEN ~ off
  8. Say: "Next" (Customize the way you like it or just leave it as if)
  9. Media Control Next on App Poweamp (The App "Poweramp" can be changed to the Music App you are using)
  10. Else If %Prox ~ covered & %SCREEN ~ off
  11. Say "Back" (Again, You can customize the voice etc. or.. just dont)
  12. Media Control Previous App Poweramp ( Again, you choose the Music App or else it wont work)
  13. End If

Now you will need to create a Task, Name it to Track Changer Yes.
The Task should contain
Profile Status>name Prox=1 Set On
Profile Status>name Prox=0 Set On
Profile Status>name Prev and Next Set On
Set Tasker Pref>Proximity Sensor Value Yes

What the Above does is to just Activate your Profiles, so that it just works.

If you want to Deactivate those Profiles do another Task, Name the Task to Track Changer No.
The Task should contain
Profile Status>name Prox=1 Set Off
Profile Status>name Prox=0 Set Off
Profile Status>name Prev and Next Set Off
Set Tasker Pref>Proximity Sensor Value when Power Connected

This will deactivate the task and you are back to 0 :)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

If I knew how to make Pictures Appear in the Post (I don't) This would have been easier for you but since life is tough and you need to experience this there you go.
If you need more details look at this Album http://imgur.com/a/eXcch

BTW: To Make this work you need to activate all 3 Profiles, Prox=0, Prox=1 and Prev Next. The Task "Track Changer Yes" will Activate it for you, useful if you activate this task via Bluetooth, Heaphones, etc. You can make a Scene pop when you connect headphones, etc your ideas are your limitation.

If you struggle in some place, look at the tasks and see if any of them has a triangle error in there. Make sure you change the music app on all 2 action tasks! (previous, next)
 
Last edited:

brisseau

Senior Member
May 7, 2009
94
9
St. Louis
That's pretty frikkin' cool!
Tried it and it works like a champ. It's like having the Force... :) This is not the song I'm looking for!
I have an OBDII device in my car connected to bluetooth. How do I use this feature only when I'm connected to the OBDII device?
 
Last edited:

fenchai

Senior Member
May 10, 2011
580
73
That's pretty frikkin' cool!
Tried it and it works like a champ. It's like having the Force... :) This is not the song I'm looking for!
I have an OBDII device in my car connected to bluetooth. How do I use this feature only when I'm connected to the OBDII device?

Well, If it uses Bluetooth, just use tasker to create a profile state on Bluetooth, select the current Bluetooth device. Then for the task of the profile link it to the the task (Track Changer Yes) that activates the 3 profiles, Prox 1, prox 0 and prev and next. As simple as that :D I recommend you set the exit profile to Track Changer No, So your music does not changes in your pocket or outside of Bluetooth.

**Remember that I set it to only work on screen off so it is not activated accidentally**
 

fenchai

Senior Member
May 10, 2011
580
73
im not able to activate all profiles at once
either prox=0 is active or the other two

Before trying this you need to know the basics of using Tasker, the switcher needs to be "ON" on all 3 profiles.

If by Active you mean the green color, it changes from Prox 0 to Prox 1 depending on your proximity sensor. That is supposed to happen.

To try this, just switch all 3 profiles to ON and turn off your screen have music playing, and move your hand to the proximity sensor.
 

obsidianwings

Senior Member
Apr 15, 2012
128
5
I am having a bit of trouble with this one to. I believe I have it set up right, but I am unable to change music with it. When I have tasker open and put my hand over the proximity sensor "Prox=1" and "Prev and Next" light up green, and when I remove it "Prox=0" lights up green, so that seems right but I still cant change music with it. Any ideas? Thanks

Edit: alright it is working for music now, I actually didn't need to change anything, it just started working lol. I just need some help understanding the tasks to turn it on and off. I don't have anything specific that I'm always doing (like Bluetooth etc) when listening to music to tie it to, I just want it so when I use my music player it turns on and when I'm not using it it turns off. Thoughts?
 
Last edited:
  • Like
Reactions: jibrail1212

knin

New member
Jun 26, 2016
1
0
I am using PureNexus on my N6P and the next function works like a charm, but I cannot figure out how to get the previous function to work.
 

g10drasingh

Member
Apr 8, 2013
47
34
27
Goa
Does not work on miui 7 , i did all right, Prox0 is green on normal and Prox1 and Prev and Next becomes green(active) when i place my hand close to proximity sensor but the music does not change when i move my hand close to proximity sensor...
any help
 

fenchai

Senior Member
May 10, 2011
580
73
Does not work on miui 7 , i did all right, Prox0 is green on normal and Prox1 and Prev and Next becomes green(active) when i place my hand close to proximity sensor but the music does not change when i move my hand close to proximity sensor...
any help
try this https://drive.google.com/file/d/0BxvEtdn6VE2EUEdJcGxvVWstRVE/view?usp=drivesdk

I am not very active here so if you need more help, it would take a while to find me. :) just tweak the task a bit and get to know how it works.

Sent from my SM-G935F using XDA-Developers mobile app
 

brisseau

Senior Member
May 7, 2009
94
9
St. Louis
fanchai,
I know you're not on that often but....I had this working perfectly on my LG-G4.
However, I upgraded to a new phone and didn't have the profiles/tasks saved so I started over from square-one. I can't for the life of me get it working. I've re-traced my steps, followed along with the photo's you posted but can't get it working.
Can I upload my profile to you so that you can tell me what I'm missing?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 17
    REQUIREMENTS?
    • TASKER
    • PHONE WITH PROXIMITY SENSOR
    • NO ROOT REQUIRED
    • COMMON SENSE

    WHAT Does this do?

    This will basically change your music tracks (previous and next) by waving your hand

    HOW does it do it?

    You hand activates the Proximity sensor (be sure to locate yours before trying this lol) Then it goes into the details by detecting if your hand is still hanging in there, if your hand is not there, it will change to the next track, if your hand is still holding up, it will Rewind the song, do it again and it will change to the previous song.

    WHEN do you want to use this?
    • On Car, You are driving, want to change tracks while driving? well just wave your hand instead of even looking at your phone. (ok you look a bit but you get the idea) No more accidents, looks cool when you do it in front of your newbie friends, yeah go ahead and tell them to do it with their iPhones XD Just remember to paste your phone into a place you can reach or use one of those universal phone holders.
    • On some desktop for whatever reason you dont have a computer or cant play songs on your pc? Activate this with Bluetooth see magic with a wave of your hands
    • You want to see the magic and how futuristic it is when you wave and the machine speaks back to you :D

    OK, Lets get Started

    1. Create a Profile, (name it to Prox=1) Select State, Select Proximity Sensor
    2. Task>Variable Set>Name: %Prox to covered
    3. Create Another Profile, (name it to Prox=0)Select State, Select Proximity Sensor But This Time Check on Invert
    4. Task>Variable>Set>Name: %Prox to uncovered
    5. Create Another Profile(name it to Prev and Next), Select State, Select Proximity Sensor
    6. wait (515MS) <---This is an Important Factor on this project, this determines how long your hand should stay in the proximity sensor, the shorter the wait, the faster it will trigger, change as required.
    7. if %Prox ~ uncovered & %SCREEN ~ off
    8. Say: "Next" (Customize the way you like it or just leave it as if)
    9. Media Control Next on App Poweamp (The App "Poweramp" can be changed to the Music App you are using)
    10. Else If %Prox ~ covered & %SCREEN ~ off
    11. Say "Back" (Again, You can customize the voice etc. or.. just dont)
    12. Media Control Previous App Poweramp ( Again, you choose the Music App or else it wont work)
    13. End If

    Now you will need to create a Task, Name it to Track Changer Yes.
    The Task should contain
    Profile Status>name Prox=1 Set On
    Profile Status>name Prox=0 Set On
    Profile Status>name Prev and Next Set On
    Set Tasker Pref>Proximity Sensor Value Yes

    What the Above does is to just Activate your Profiles, so that it just works.

    If you want to Deactivate those Profiles do another Task, Name the Task to Track Changer No.
    The Task should contain
    Profile Status>name Prox=1 Set Off
    Profile Status>name Prox=0 Set Off
    Profile Status>name Prev and Next Set Off
    Set Tasker Pref>Proximity Sensor Value when Power Connected

    This will deactivate the task and you are back to 0 :)
    ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    If I knew how to make Pictures Appear in the Post (I don't) This would have been easier for you but since life is tough and you need to experience this there you go.
    If you need more details look at this Album http://imgur.com/a/eXcch

    BTW: To Make this work you need to activate all 3 Profiles, Prox=0, Prox=1 and Prev Next. The Task "Track Changer Yes" will Activate it for you, useful if you activate this task via Bluetooth, Heaphones, etc. You can make a Scene pop when you connect headphones, etc your ideas are your limitation.

    If you struggle in some place, look at the tasks and see if any of them has a triangle error in there. Make sure you change the music app on all 2 action tasks! (previous, next)
    3
    It won't work till you change "Object" to "AudioManager" in first function.

    GetSystemService{AudioManager}(String)

    In addition storing result in %PLAYING rather than %playing as former is global and later is native variable for particular task.
    Attached project can be imported directly in Tasker (for beginner)

    Mine is a bit different from yours and the profile becomes active only when music app is on and remains active while the music is playing in background.
    Attaching the project file, so that people don't have to do the hard work.

    P.S This is a project file.
    To import this file (Manual for Beginners)
    1) Go to tasker preferences and disable beginners mode.
    2) Then press and hold on home button on the profile screen in tasker and select import.
    3) Now locate the file and click on the file.
    4) Finally edit your music application in the profile.
    2
    - Add a Java function. Class or Object: CONTEXT, Function: getSystemService{Object} (String), Param (String): audio, Return {Object}: manage
    - Add a second Java function. Class or Object: manage, Function: isMusicActive {boolean} (), Return {boolean}: %playing
    - Add a return action. Value: %playing
    TIP: If you can only see "Class or Object" and "Function" in Java Function, the others fields should appear when inputting "Class or Object" and "Function". If the other fields don't appear automatically after inputting Class or Object and Function, exit the action and re-enter it :p

    It won't work till you change "Object" to "AudioManager" in first function.

    GetSystemService{AudioManager}(String)

    In addition storing result in %PLAYING rather than %playing as former is global and later is native variable for particular task.
    Attached project can be imported directly in Tasker (for beginner)
    1
    Still not working
    I am using cm12.1 does it work in this rom

    It should work on all roms, please check the requirements.

    check if Prox 1 and 0 turns to green and grey, if it does, it should work, if it doesnt, you have something wrong on your side.
    1
    I am having a bit of trouble with this one to. I believe I have it set up right, but I am unable to change music with it. When I have tasker open and put my hand over the proximity sensor "Prox=1" and "Prev and Next" light up green, and when I remove it "Prox=0" lights up green, so that seems right but I still cant change music with it. Any ideas? Thanks

    Edit: alright it is working for music now, I actually didn't need to change anything, it just started working lol. I just need some help understanding the tasks to turn it on and off. I don't have anything specific that I'm always doing (like Bluetooth etc) when listening to music to tie it to, I just want it so when I use my music player it turns on and when I'm not using it it turns off. Thoughts?