Android: fundamental frequency
Very often not.  Your posted code is for finding an FFT magnitude, not an autocorrelation result, and thus likely to fail at estimating the fundamental pitch of sound/voice/music with typically high overtone or harmonic content.