I am looking into writing some apps for Android phones that work with audio. These phones do not have a line in jack but do have headphone jacks that work with some headsets that include a microphone. Is it possible to work with audio coming in through the headphone jack if I plugged in something like a portable computer mic?
You need a 3.5mm TRRS to TRS splitter adapter, that either splits to separate female 3.5mm TRS-jacks for the microphone and the audio or just a single 3.5mm TRS microphone jack.
Easiest way for me to find these has been to look for 'iPhone microphone adaters', (I've puchased three for my various phones and each one has worked just fine on non-apple products. I have a HTC Touch HD, Motorola Milestone and a Nokia N900) YMMV.
A quick google search yielded an example product (that seems way overpriced by Finnish standards, but you get the idea) here
Well I haven't done anything in this space but looking at this product SquareUp I'd reckon that the data coming in the jack can be used for anything you can program it to do...
So I'd be with you in thinking its possible, but from reading this article its not currently built into the Android O/S when recording video
Android does not, at this time, support the use of external mics when recording video
However the SquareUp guys seem to have found a way to read data using the jack as an input, though in my looking through the Android developer docs it wasn't leaping out at me. I doubt the SquareUp code is open sourced but if you fire them a mail on their support site they might point you in the right direction.
If you're not trying to record video, everything I know about Android's audio APIs (which isn't much, but it's something) tells me you should be able to just use AudioRecord. Assuming that Android phones tend to behave like other devices that accept microphone input, the internal mic should be disabled if an external one is plugged in so you shouldn't have to worry about where the audio is coming from.
The article MadMurf linked indicates that voice recording is possible with an external mic, so I don't see why you couldn't do something else with that input.