I can't get my HTC M8 rear facing camera to autofocus. There is nothing wrong with the hardware in that the stock camera will focus perfectly (and there is no dirt on the lens).
Initially I thought I might have been something wrong in my code but then I tried Commonsware's camera app/library and I get the same result - an image which is blurry from the start which makes no effort to focus.
I've tried the same code on a Nexus 4 and Galaxy 3 and they work perfectly. I've also done a params.getSupportedFocusModes().contains(Camera.Parameters.FOCUS_MODE_CONTINUOUS_PICTURE); test on the M8 and it returns true.
I tried mCamera.autoFocus(...) also and it didn't work either so I am kinda out of ideas.
The front facing camera works fine for autofocus with Commonsware's camera also. Instagram's app also works fine so they are doing something special to get it to work.
EDIT Just tried the same code on a friends HTC One Dual Sim and the focus works fine. I also did a factory reset with the M8 and its still doesn't work.
Hi I have the same problem on auto focus with HTC M8. My code work fine on HTC m7 and other devices.
I have change the code as following
And the xml as the following :
Hope this help you