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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:22:42+00:00 2026-05-27T03:22:42+00:00

im developing an app that allows users to take a picture and then it

  • 0

im developing an app that allows users to take a picture and then it does some work on it in the background, however i have run into a problem i have hard coded the picture size into it and it is causing errors on a different phone to the one i am using and im assuming its down to the phone not supporting the camera size i have hard coded.

i have read on here about it but the answers are to vague all people keep saying is to use the getSupportedSizes method but i just dont know what to do with it after that.

any help would be greatly appreciated.

  • 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-05-27T03:22:43+00:00Added an answer on May 27, 2026 at 3:22 am

    It’s important to use this method because the cameras on the different devices support very different resolutions, so, you’ll have to specify what resolution you want out of the ones that are available on the given device.

    Pseudo….

        Camera.Parameters cp = mCamera.getParameters();
    
        List<Size> sl = cp.getSupportedPictureSizes();
    
    //now that you have the list of supported sizes, pick one and set it back to the parameters...
       int w,h;
       for(Size s : sl){
          //if s.width meets whatever criteria you want set it to your w
          //and s.height meets whatever criteria you want for your h
          w = s.width;
          h = s.height;
          break;
    
    
       }
    
       cp.setPictureSize(w, h);
    
      mCamera.setParameters(cp);
    

    Usually the thing that matters most is the photo’s aspect ratio. So, you’ll want to compare the w/h to 16:9 or 4:3 and then find the highest (or second highest) quality at the supported ratio. Obviously, I don’t know what your needs are so you’ll have to determine what sizes actually meet your given criteria. If you simply want the highest quality and you don’t care about the aspect ratio you’ll usually find that as the last item in the list of sizes.

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

Sidebar

Related Questions

I am developing a web app in ASP.net that allows users to log in
I'm developing a Rails app that does some plotting behind the scenes to generate
I'm developing an app that is vaguely similar to twitter, in that it allows
I'm developing web app that user can save his/her work to server. The data
this is my first ever question. I am developing a iPad app that allows
We are developing a web app that will have a pretty complex user and
I'm current developing web-app that allows a user to associate their account with their
I'm developing my first Mac App have some issues with shell commands... I'm trying
I am developing an ASP.Net web app that needs to run in a Kiosk/Touch
I'm considering developing an app that asks users to invite friends to participate at

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.