Create Camera Preview In Android

I was trying to create a simple camera application in android. For my application purpose I needed to display the camera preview. So I followed android developers site and also some other blogs to create a camera preview in android. So everything was working except there was one major bug. If I lock my device while the application is still running and then unlock, my application is no longer in the screen which is completely not what I wanted. So after doing some research I found that most of the tutorial I was following didn’t take care of the application life cycle which is very important for this kind of application. Hence I’m writing this tutorial to show how to create a camera preview in android application. I’ll try to show how to manage the full application life cycle for a camera application. Continue reading “Create Camera Preview In Android”