Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.List;

import android.hardware.Camera.Size;

public class Main {
    public static Size getMinimumSize(List<Size> sizes) {
        if (sizes == null || sizes.size() == 0)
            return null;
        int minArea = Integer.MAX_VALUE;
        Size minSize = null;
        for (Size e : sizes) {
            int area = e.width * e.height;
            if (area < minArea) {
                minArea = area;
                minSize = e;
            }
        }
        return minSize;
    }
}