获取Camera 支持视频的尺寸
<uses-permission android:name="android.permission.CAMERA" > </uses-permission> <uses-permission android:name="android.permission.RECORD_AUDIO" > </uses-permission> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" > </uses-permission>
Camera camera = Camera.open(); Parameters parameters = camera.getParameters(); List<Size> supportedPreviewSizes = parameters .getSupportedPreviewSizes(); for (int i = 0; i < supportedPreviewSizes.size(); i++) { System.out.println("supportedPreviewSizes:"+supportedPreviewSizes.get(i).width+":"+supportedPreviewSizes.get(i).height); } List<Size> supportedPictureSizes = parameters .getSupportedPictureSizes(); for (int i = 0; i < supportedPictureSizes.size(); i++) { System.out.println("supportedPictureSizes:"+supportedPictureSizes.get(i).width+":"+supportedPictureSizes.get(i).height); }