I have tested my application on various mobile phones. My applications main functionality is taking pictures and recording video through the phones camera. I didn't face an issue on most of the mobile phones, but I did face this issue on Motorola DROID RAZR. My application works fine when i take a picture. But I'm facing an issue when I record a video. When I record a video, I get a blank screen. There is no preview showing on the mobile screen. I don't why its happening, but on most of the mobile phones its working fine. And taking picture working fine on this phone (the droid razr).
Motorola DROID RAZR configuration,
- OPERATING SYSTEM : Android v2.3.5.
- CAMERA : HD camera, 8MP.
- PROCESSOR : TI OMAP4430
Here is my code,
Camera camera = Camera.open();
Parameters params = camera.getParameters();
camera.setDisplayOrientation(90);
camera.setParameters(params);
camera.setDisplayOrientation(90);
MediaRecorder recorder = new MediaRecorder();
recorder.setCamera(camera);
recorder.setAudioSource(MediaRecorder.AudioSource.CAMCORDER);
recorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
recorder.setProfile(CamcorderProfile.get(CamcorderProfile.QUALITY_HIGH));
recorder.setVideoSize(640, 480);
recorder.setMaxDuration(25000);
recorder.setOrientationHint(90);
Update:
I have tested this application on Motorola Droid Razr emulator. I got the following exception,
MediaRecorder(430): prepare failed: -17
System.err(430): java.io.IOException: prepare failed.
System.err(430): at android.media.MediaRecorder._prepare(Native Method)
System.err(430): at android.media.MediaRecorder.prepare(MediaRecorder.java:590)
But I didn't get this exception on my other emulator. How to resolve this issue?