Warning, this alternative *may* be more reliable than mine: https://github.com/johnboiles/BaofengUV5R-TRRS
And of course, using a Bluetooth TNC, etc, is going to be much more reliable than this hack.
I harvested a cheap Baofeng handheld speaker/microphone for its cable (although you can buy them here — the Kenwood type) and bought a 3.5mm TRRS plug from Digi-key. It’s a bit tight to solder the resistors inside the plug housing, but it is possible (just remember to put the plug housing on the cable BEFORE soldering, otherwise you’ll be unable to put it on later… a mistake I made about three times.)
I’m sure there is some science behind the correct resistor ohm values (and as in the Github link, an additional capacitor might help; I’m not sure, this is just a hack.) I used 480ohm resistors. The idea is to mute the audio slightly because amplified earphone output being wired straight into amplified microphone input is a surefire way to transmit nothing but distortion.
In my experience on a Galaxy Nexus running APRSdroid with this cable into a Pofung UV-82, the best reception is with the radio volume at barely audible (1/3rd of a rotation) and with the phone volume at 1/4. Further experimentation would yield better data, but keeping an eye on received packets and repeats of your transmissions can help you even if you don’t have a separate radio to listen on. You can also use a recording app on your phone to see what the phone is hearing.
Helpful settings in APRSdroid: 3-4 second preamble (so VOX has a chance to turn on); output via AFSK (not Internet/bluetooth etc); AFSK output via headset (not ringer/speaker). Also, before opening APRSdroid, set your phone to Vibrate so hopefully no notification sounds are transmitted.
Helpful settings on radio: VOX at ~2, Squelch at ~1. Ensure that both channels are set to the APRS channel before enabling VOX or connecting cable, and connect cable while radio is off, to avoid unwanted transmission. Consider listening to transmissions/receptions on a separate radio and looking at the radio’s receive/transmit lights to ensure that the phone is being polite and not transmitting over other stations.