The code works mostly fine. The only problem is that the onPictureTaken function never called. I need to use this function to store the image to SD Card.
onPictureTaken was never called. I figured out it that because the Camera.takePicture() method was invoked many times, it caused onPictureTaken to not be called. If ShutterCallback has a code return, then onPictureTaken is also not called.