See my comment about the emulator. But the reason your app crashes is
because you catch the exception of the camera failing to open and return
null. Then in your CameraPreview class you save this null value to
'mCamera' and then later dereference it in surfaceCreated:
So your original question is why is it crashing...it's crashing because
you are not handling error conditions well.