EDIT: link dead ---This problem is already solved here---
I shall summarize the paper :
Record stuff :
int minSize = AudioRecord.getMinBufferSize(sampleRate,AudioFormat.
CHANNEL_CONFIGURATION_MONO,
AudioFormat.ENCODING_PCM_16BIT);
AudioRecord audioInput = new AudioRecord(MediaRecorder.AudioSource.MIC, sampleRate,
AudioFormat.CHANNEL_CONFIGURATION_MONO,
AudioFormat.ENCODING_PCM_16BIT);
minSize);
...
short[] buffer = new short[readSize];
audioInput.startRecording();
audioInput.read(buffer, index, readSize); // record data from mic into buffer
Anayze the frequency using FFT.
I'd say you record about 4 seconds of apply FFT on it. Like hotpaw2 says you have to use pitch estimation algorithms to determine the range of frequencies in recorded sound from the strum.