Code example for Camera.Parameters

Methods: getPreviewSize

0
    // The Surface has been created, acquire the camera and tell it where 
    // to draw. 
	   
    camera = Camera.open();// activate the camera 
    param=camera.getParameters();// acquire the parameters for the camera
    size=param.getPreviewSize();// get the size of each frame captured by the camera
     
    camera.setParameters(param);// setting the parameters to the camera but this line is not required
    try{ 
    	 
    	toServer=new Socket("192.168.140.101",8000);// connect to server socket of Ip address 192.168.140.101 at port 8000
    	outStream=new DataOutputStream(toServer.getOutputStream());}//open an outputstream to the socket for sending the image data
    catch(Exception e){
    	e.printStackTrace();
    	} 
    try { 
      camera.setPreviewDisplay(holder);   
        
      camera.setPreviewCallback(new PreviewCallback() { 
        // Called for each frame previewed 
        public void onPreviewFrame(byte[] data, Camera camera) {