Code example for Camera.Parameters

Methods: getSupportedPreviewSizes

0
        camera = null;
    } 
 
    public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) {
        Camera.Parameters parameters = camera.getParameters();
        List<Camera.Size> previewSizes = parameters.getSupportedPreviewSizes();
         
        // You need to choose the most appropriate previewSize for your app 
      //  Camera.Size previewSize =  
         
      //  parameters.setPreviewSize(previewSize.width, previewSize.height); 
        camera.setParameters(parameters);
        camera.startPreview();
    } 
    @Override 
    public void draw(Canvas canvas) 
    { 
        super.draw(canvas);
        Paint p= new Paint(Color.RED);
        Log.d(TAG,"draw");
        canvas.drawText("PREVIEW", canvas.getWidth()/2, canvas.getHeight()/2, p );