Camera is one of the sensitive component in smart phones. Recently i have faced an issue in Camera application on my iPhone 4. The screen goes black when i open the native or third party camera app. Sometimes it works when i shake the device. I realized something wrong with the camera hardware component and decided to replace the part using FixIt tutorial.
I bought the camera part from DealExtreme which they shipped in 3 weeks to India which costs about $.3.18. It took just 10 minutes to replace the camera part and the camera started working again. I cannot say this camera part is real genuine Apple part. But it works.
Why most of the iPhone Camera fails after rough usage is because it has a minute metal clip at the camera edges which prone to damage when the device is dropped multiple times. In my device one side of the clip is broken which caused the failure of the camera as it was acting as the main shunt of the camera circuit.
Note : Opening the iPhone or replacing spare parts is highly dangerous. This is for educational purpose only. Please check with the skilled technician.