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 8034479
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T02:01:40+00:00 2026-06-05T02:01:40+00:00

I have a problem with Camera and Android Version. I try to get preview

  • 0

I have a problem with Camera and Android Version.
I try to get preview size supported by Android Camera flow as below :

@Override
public void surfaceCreated(SurfaceHolder holder) {
    // TODO Auto-generated method stub
    mCamera = Camera.open();
    mSupportedPreviewSizes = mCamera.getParameters()
            .getSupportedPreviewSizes();
    try {
        mCamera.setPreviewDisplay(holder);
    } catch (IOException exception) {
        mCamera.release();
        mCamera = null;
    }
}

I try to test my code on 2 Android Version with Emulator ( Android 2.2 SDK && Android 2.1 SDK )
Configuration for both of version Android in Emulator as below:

Skin : HVGA
Abstracted LCD density : 160

My problem :
When I run my Apps on Emulator – 2.2 SDK : OK — GOOD
but when I run on Emulator – 2.1 SDK : have a problem ” mCamera.getParameters().getSupportedPreviewSizes() return is NULL “

If you known that, please help me !
Thank you very very very ……….much….

  • 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-05T02:01:42+00:00Added an answer on June 5, 2026 at 2:01 am

    This is listed as a defect by Google, which I assume means there are plans to fix it:
    http://code.google.com/p/android/issues/detail?id=6271

    I’ve experienced this on some hardware devices running android all the way up to 4.0. So far, the only thing I’ve been able to do is handle the case where getSupportedPreviewSizes() returns null. It doesn’t always happen for me, so I’ll normally destroy and re-instantiate my preview surface and camera if I detect this has happened.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a strange problem on my htc hero. When launching camera, i get
i have problem using camera in my Android application i have a form for
I have developed simple camera application for Android mobile using flex 4. The problem
I have problem with base classes in WPF. I try to make a base
I have an Activity that opens the Camera and starts a preview on a
In My Android camera application, I have set my Application manifest to the Portrait.
I have to develop an android app for which I have to use camera
I have a question this time around regarding the Android custom camera, NOT the
I have a little problem with my camera intent. As I know, when camera
I have H264 encoded Video file came from Android mobile camera and I want

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.