Header Banner
gadgethacks.mark.png
Gadget Hacks Shop Apple Guides Android Guides iPhone Guides Mac Guides Pixel Guides Samsung Guides Tweaks & Hacks Privacy & Security Productivity Hacks Movies & TV Smartphone Gaming Music & Audio Travel Tips Videography Tips Chat Apps
Home
Samsung

How to Auto-Start Your Favorite Music Player When Plugging Headphones into a Galaxy S4

Nov 27, 2013 08:09 PM
Nov 27, 2013 08:16 PM
White earphones resting on a smartphone screen.

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!

Download & Install Llama

We'll be using an app called Llama - Location Profiles, available for free on the Google Play Store.

Llama app logo for location profiles.

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.

Create a New Event

Head to the Events tab, and tap on the plus (+) sign at the very bottom to create a new event.

How to Auto-Start Your Favorite Music Player When Plugging Headphones into a Galaxy S4
How to Auto-Start Your Favorite Music Player When Plugging Headphones into a Galaxy S4
How to Auto-Start Your Favorite Music Player When Plugging Headphones into a Galaxy S4
How to Auto-Start Your Favorite Music Player When Plugging Headphones into a Galaxy S4

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.

Add a Condition

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.

Event scheduling interface on a mobile app.
Headset connected/disconnected options in settings menu.
Wi-Fi connection settings with status indicators for connected and disconnected.
Event scheduling interface on a mobile app.
Headset connected/disconnected options in settings menu.
Wi-Fi connection settings with status indicators for connected and disconnected.

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.

Bluetooth device connection settings on mobile app interface.
Bluetooth settings screen displaying a connected device and audio options.
Bluetooth device connection settings on mobile app interface.
Bluetooth settings screen displaying a connected device and audio options.

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!

Add an Action

Now let's work on the "then" part of our if, then statement. Hit the Add Action button, then choose Run Application.

How to Auto-Start Your Favorite Music Player When Plugging Headphones into a Galaxy S4
Settings menu options for personal assistant features on a mobile device.
How to Auto-Start Your Favorite Music Player When Plugging Headphones into a Galaxy S4
How to Auto-Start Your Favorite Music Player When Plugging Headphones into a Galaxy S4
Settings menu options for personal assistant features on a mobile device.
How to Auto-Start Your Favorite Music Player When Plugging Headphones into a Galaxy S4

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:

Settings menu for event conditions, including options for wired headset and application actions.

Test the Event to Make Sure It Works

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!

Fine-Tuning the Conditions (Optional)

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.

Preventing Your Player from Interrupting Calls

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.

Settings menu with options for Bluetooth and event triggers on a mobile device.
How to Auto-Start Your Favorite Music Player When Plugging Headphones into a Galaxy S4
Settings menu with options for Bluetooth and event triggers on a mobile device.
How to Auto-Start Your Favorite Music Player When Plugging Headphones into a Galaxy S4

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.

Preventing Your Player from Interrupting Videos

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.

Active application settings on mobile device
How to Auto-Start Your Favorite Music Player When Plugging Headphones into a Galaxy S4
Active application settings on mobile device
How to Auto-Start Your Favorite Music Player When Plugging Headphones into a Galaxy S4

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.

You already know how to use your phone. With our newsletter, we'll show you how to master it. Each week, we explore features, hidden tools, and advanced settings that give you more control over iOS and Android than most users even know exists.

Sign up for Gadget Hacks Weekly and start unlocking your phone's full potential.

Related Articles

Comments

No Comments Exist

Be the first, drop a comment!