Code example for File

Methods: exists, mkdir

0
    /** 
     * Helper method for prepping test 
     */ 
    public void setupCameraTest() { 
        // Create the test images directory if it doesn't exist 
        File stressImagesDirectory = new File(String.format("%s/%s",
                Environment.getExternalStorageDirectory(), CAMERA_STRESS_IMAGES_DIRECTORY));
        if (!stressImagesDirectory.exists()) {
            stressImagesDirectory.mkdir();
        } 
 
        mCamera = Camera.open(CAMERA_ID);
    } 
 
    /** 
     * Helper method for getting the available parameters of the default camera 
     */ 
    public Parameters getCameraParameters() {
        mCamera = Camera.open(CAMERA_ID);
        Parameters params = mCamera.getParameters();
        mCamera.release();