If I'm not totally mistaken Camera.getParameters stores the currently set
camera parameters. What if the camera resolution has been set to the lowest
available? I think you need to scan through the result of
getSupportedPictureSizes()<http://developer.android.com/reference/android/hardware/Camera.Parameters.html#getSupportedPictureSizes%28%29>and
find the highest available resolution from there.
On Monday, February 4, 2013 11:42:51 AM UTC-6, saex wrote:
>
> Hi
>
> I'm getting the camera megapixels with this function:
>
> private String getCameraMegapixels(Camera cam){
> Camera.Size size;
> size = cam.getParameters().getPictureSize();
> DecimalFormat localDecimalFormat = new DecimalFormat("#.#");
> return localDecimalFormat.format(size.width * size.height /
> 1000000.0D);
> }
>
> It works fine for front and back camera in all the phones i tested but but
> in Galaxy nexus. In galaxy nexus something is going wrong because i'm
> getting that the camera (front and back) haves 0.1 megapixels....
>
> Is something wrong with galaxy nexus and the way to get megapixels?
>
> PD: Galaxy Nexus Android version is 4.2.1
> Thanks
>
--
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.