I am working in Android 2.1, and I want to detect when the headset is plugged in/taken out. I\'m pretty new to android.
I think the way to do it is using a Broadcast
You need to enable the broadcast receiver and set the exported attribute to true:
exported
true