Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7719681
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T03:28:36+00:00 2026-06-01T03:28:36+00:00

I have tested my application on various mobile phones. My applications main functionality is

  • 0

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,

  1. OPERATING SYSTEM : Android v2.3.5.
  2. CAMERA : HD camera, 8MP.
  3. 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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T03:28:37+00:00Added an answer on June 1, 2026 at 3:28 am

    Finally I found the solution. Below code works well on all devices. 😉

            Holder holder = getHolder();
            holder.addCallback(this);
            holder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
            Camera camera = Camera.open();
            try {
                camera.setPreviewDisplay(holder);
                camera.startPreview();
            } catch (IOException e) {
                Log.e(TAG, e.getMessage());
                e.printStackTrace();
            }
    
            camera.unlock();
            MediaRecorder recorder = new MediaRecorder();
            recorder.setCamera(camera);
            recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
            recorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
            recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
            recorder.setVideoSize(640, 480);
            recorder.setVideoFrameRate(20);
            recorder.setVideoEncodingBitRate(3000000);
            recorder.setAudioEncoder(MediaRecorder.AudioEncoder.DEFAULT);
            recorder.setVideoEncoder(MediaRecorder.VideoEncoder.H264);
    
            try {
    
                String videopath = File.createTempFile("video", ".mp4")
                        .getAbsolutePath();
    
                recorder.setOutputFile(videopath);
    
            } catch (IllegalStateException e) {
                e.printStackTrace();
            } catch (IOException e) {           
                e.printStackTrace();
            }
    
            recorder.setPreviewDisplay(holder.getSurface());
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have included the camera functionality in my application. I have also launched the
I need to read and write some data through named pipes. I have tested
Strange thing is happing with my .NET MVC deployment. I have tested my application
I am about to send my iPhone application to Apple. I have tested the
I have tested a web application I have built using MVC 2 on local
I have an working application which i have tested in my ipod touch. Everything
I want to have an application which parses various RSS feeds and send the
I have a web app that needs both functionality and performance tested, and part
I'm using fragments in my Android application using the compatibility package. I have tested
Suppose I have tested a navigation controller at the root level. - (void)applicationDidFinishLaunching:(UIApplication *)application

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.