Can Android differentiate between headphones and headset?
You can see the details of this at the Android developer documentation, but an app can definitely tell if a wired device plugged into the audio jack has a microphone or not. I will tell you that this information is not always accurate or consistent across devices though, as I have experienced with my own app Hearing Saver. Sometimes different phones send different codes for this particular bit of information, so if you are experiencing difficulties with certain apps not recognizing your headset, I'd get into contact with the developer of that app.