Like many smartphones nowadays, your Samsung Galaxy S4 comes bundled with a headset for you to listen to music, watch videos without disturbing others, and even make phone calls. I personally only use it for music, whether it's Play Music, Pandora, or streaming from YouTube.
If you're like me and the only reason you'd plug your headset into your GS4 is to listen to music, wouldn't it be nice to have your music player automatically pop up once you do so? Well, you can accomplish that by following along with this softModder guide!
We'll be using an app called Llama - Location Profiles, available for free on the Google Play Store.
In a previous softModder guide, I covered the basics of setting up Llama, how it works, and gave some examples of what kind of automation can be accomplished. If you haven't already read through that guide, check it out so you can get a sense of how to use Llama.
Head to the Events tab, and tap on the plus (+) sign at the very bottom to create a new event.
It's always a good idea to name your events so you know what they do, so tap on Event name and group and give it a name.
Llama is based around "if, then" logic; if a certain condition is met, then a particular action will occur. Let's apply that to what we're trying to do with this softModder tutorial. The "if, then" statement we'll be trying to execute is:
If a headset is plugged in, then a music app will launch.
Let's start with the "if" part. Tap on the Add Condition button, select Headset Connected/Disconnected, and then Wired Headset Connected.
That sets us up for wired headset usage, but if you want to try this out with Bluetooth headphones instead, you can choose Bluetooth Device Connected, then select your Bluetooth headset from there.
Your Bluetooth headset will need to have been previously paired with your GS4, otherwise Llama won't detect it. Don't forget to have Bluetooth toggled on!
Now let's work on the "then" part of our if, then statement. Hit the Add Action button, then choose Run Application.
Select your choice of music app from the list; I'll be selecting Google's Play Music, but third-party music apps like Apollo will work just fine.
Your event page should look something like this:
Grab your GS4's headset and plug it into the jack at the top of your phone. Your music app should automatically start up, ready for you to listen to some tunes!
Occasionally, you might want to use your headset for things other than listening to music, like making a phone call, or watching Netflix or YouTube videos. In those cases, you probably wouldn't want the music player popping up and interrupting when you plug your headset in.
You can prevent this from happening by adding more conditions. Since we don't want the event to fire if we plug in our headset in the middle of a phone call, tap on Add Condition from the event's page, and select Call state.
Make sure the box for Not in a call is the only one checked, then tap OK. Now you won't have to worry about your music app popping up in the middle of a call.
How about if you're watching some Netflix or YouTube videos and want to use your headset instead of the phone's speaker? We don't want our music app interrupting video playback, so let's add another condition.
Hit the Add Condition button and select Active application. Select the app from the list (I'll choose Netflix for this example), and under Status, make sure it's toggled to App stopped or in background.
Hit the OK button to finalize everything, and now the event will only fire if Netflix isn't running. You can do the exact same thing for YouTube or any other app you might be using your headset with.
Want to see more Llama tutorials? Let us know in the comments! If you've come up with some of your own automated Llama tasks, we'd love to see those, too.