I am using dummy surface in my code.It\'s working fine in Canvas HD running 4.2.1 but when the same app is deployed on my nexus 5/S 3 it gives RunTimeException on camera.tak
This is not possible, you need an activity to display the camera in.
Consider a transparent activity that just holds the camera view.