[Android]Camera + SurfaceViewを試す

setParameters failed

parameters.setPreviewSize(width, height);
でRuntimeException: setParameters failed が発生。
ぐぐったところ、getSupportedPreviewSizes()というのがあるらしい。
ここからwidth heightを取得するようにしたら解決。

The solution is to request the closest available preview size to the one you'd like; you can get a list of available preview sizes by calling getSupportedPreviewSizes in the Camera.Parameters object
RuntimeException: setParameters failed