Spam Blocked

In some case you might want to detect if phone’s headphone jack is in use or bluetooth headset is attached with Phone. Sharing code here to help others. Use files linked at the end of the post and use this code for detection :