Java tutorial
//package com.java2s; import android.hardware.Camera; public class Main { private static boolean equalRate(Camera.Size s, float rate) { float r = (float) (s.width) / (float) (s.height); if (Math.abs(r - rate) <= 0.03) { return true; } else { return false; } } }