From my current search, Android camera intent can not specify pictureSize. Since my app needs to be fast, I do not want to save a large size picture in sd card, then load it to a small size of Bitmap. I think it takes time. Plus, I need a gray scale image, rather than a color Bitmap. I know how to convert them, but again it takes time.
I plan to take a picture at a specified size, and directly process the Y part (gray scale) in the YUV data in the memory.
So does that mean I have to write my own camera app using camera API?
Are there any good examples? Many examples I checked so far often do not consider autofocus. I add features in XML file:
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
I add the auto focus mode to the camera parameter.
parameters.setFocusMode(Camera.Parameters.FOCUS_MODE_AUTO);
But it does not work. So I add autofocus command immediately before camera press button.
preview.camera.autoFocus(myAutoFocusCallback);
preview.camera.takePicture(shutterCallback, rawCallback, jpegCallback);
But the autofocus takes some time, and until the preview becomes clear, the take pictures has been performed. Plus, I also want it to autofocus even if I do not press the camera button. How can I put autofocus nicely in it?
Are there any good examples? Thanks.