Code example for SurfaceView

Methods: getHolder

0
			stop(); 
		} 
        camera = Camera.open();
         
        SurfaceView cameraView = view;
        holder = cameraView.getHolder();
        holder.addCallback(this);
        holder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
	} 
	 
    public void listen() { 
        try { 
            LocalServerSocket server = new LocalServerSocket(SOCKET_ADDRESS);
 
            LocalSocket receiver = server.accept();
            if (receiver != null) {
                InputStream input = receiver.getInputStream();
                 
                byte[] buffer = new byte[4096];
                // simply for java.util.ArrayList 
                while(true) {