HeadphoneIn is a launcher which is triggered when the headphone is plugged in.
How does it work
You choose up to 9 application which can be launched when the activity is triggered
The application is open source: https://github.com/WasseemB/Headphone-Launcher
Should work with Android Version with API above 16 [JellyBean 4.1+]