Android Multiple SurfaceViews

You can have multiple SurfaceViewsin one layout. The “Multi-surface test” activity in Grafika has three. The first post cited in @nonsleepr’s answer was followed up 9 months later with this post by the same author, which mentioned the existence of SurfaceView#setZOrderMediaOverlay(). The key thing to understand is that SurfaceView is not a regular view. When … Read more

How to capture image from custom CameraView in Android?

try to use Surface View for creating dynamic camera view and set in your required portion. following code try variables set Class level (Global) Button btn_capture; Camera camera1; SurfaceView surfaceView; SurfaceHolder surfaceHolder; public static boolean previewing = false; Following code in onCreate() method getWindow().setFormat(PixelFormat.UNKNOWN); surfaceView = new SurfaceView(this); surfaceHolder = surfaceView.getHolder(); surfaceHolder.addCallback(this); surfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS); btn_capture = … Read more

Taking screenshot programmatically doesnt capture the contents of surfaceVIew

I finally solved this . Below i give some code for anyone who wants to know how to take screenshots of a layout ,pictures from the camera without intent, screenshots(sort of) of the content of a surfaceView and save the screen shot in a folder : public class Cam_View extends Activity implements SurfaceHolder.Callback { protected … Read more

Camera Tutorial for Android (using surfaceview)

Ok. So here is the solution: I am not adding any try catch. This is simply for the capturing the image and storing it into the sdcard. public class VideoServer extends Activity implements SurfaceHolder.Callback { TextView testView; Camera camera; SurfaceView surfaceView; SurfaceHolder surfaceHolder; PictureCallback rawCallback; ShutterCallback shutterCallback; PictureCallback jpegCallback; private final String tag = “VideoServer”; … Read more