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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:15:34+00:00 2026-06-13T08:15:34+00:00

For my application I am using android native camera and previewing the image using

  • 0

For my application I am using android native camera and previewing the image using surface view. in my case everything is working except the camera orientation. When I open the camera by setting screenOrientation=”landscape on manifest file I am getting the preview without any problem in landscape mode. But I need to take image in portrait mode, for this I changed my manifest like android:screenOrientation=”portrait” and change my code like mCamera.setDisplayOrientation(90), params.set(“orientation”, “landscape”),params.set(“rotation”, 90), but still I am getting 90 degree rotated image.
And my code is

  public void setupCamera(int width, int height) {
    Log.i(TAG, "setupCamera");
    synchronized (this) {
        if (mCamera != null) {
            Camera.Parameters params = mCamera.getParameters();
            List<Camera.Size> sizes = params.getSupportedPreviewSizes();
            List<Camera.Size> imgsize=params.getSupportedPictureSizes();
            mFrameWidth = width;
            mFrameHeight = height;

           // mCamera.setDisplayOrientation(90);
            params.set("orientation", "landscape");
             params.set("rotation", 90);
            // selecting optimal camera preview size
            {
                int  minDiff = Integer.MAX_VALUE;
                for (Camera.Size size : sizes) {
                    if (Math.abs(size.height - height) < minDiff) {
                        mFrameWidth = size.width;
                        mFrameHeight = size.height;
                        minDiff = Math.abs(size.height - height);
                    }
                }
            }

            params.setPreviewSize(getFrameWidth(), getFrameHeight());




            List<String> FocusModes = params.getSupportedFocusModes();
            if (FocusModes.contains(Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO))
            {
                params.setFocusMode(Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO);
            }            

            mCamera.setParameters(params);



            mCamera.startPreview();
        }
    }
}

I am using Micromax A 52 model…
Any one please help…..

  • 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-13T08:15:35+00:00Added an answer on June 13, 2026 at 8:15 am

    If your application runs on v2.2 or above you can rotate camera orientation to portrait using camera.setDisplayOrientation(90).

    For others:

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.FROYO)
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
    
    //After opening camera - call via reflection
    Method rotateMethod = android.hardware.Camera.class.getMethod("setDisplayOrientation", int.class);
    rotateMethod.invoke(mCamera, 90);
    

    for more details please refer this link and this
    Hope this will be helpful

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

Sidebar

Related Questions

Hi I'm using this to open up the native android camera application Intent camera
I am writing application on ActionScript for Android using Adobe AIR with native extentions.
I'm trying to debug an Android application with native code using ADT 20.0.3 on
I am new in android and working on the camera application. In this app
I'm creating an native Android application by using PhoneGap and jQuery Mobile. When I
I am developing an application using Android SDK. In this application I am facing
I created a sample application using Android TextView with shared preferences . In my
I have developed a simple application using SDK(Android: 3.2[API-13]) for, to display Google banners.
I have developed a android application using phonegap. I have registered certain recievers which
I've got an android application using a shared object in the JNI (that I

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.