Tuesday, January 29, 2013

[android-developers] How to get back camera info in android 1.6 to 2.2?

in Android 2.3 (API 9), google introduced CameraInfo to check if the given camera is the back camera or the front camera in a phone with two cameras: http://developer.android.com/reference/android/hardware/Camera.CameraInfo.html

With this example you can get info from FRONT camera: How to open "front camera" on android platform? and it's the same for BACK camera.

OK, but the problem is that i need to get info from BACK camera in a phone with android 2.2. The phone haves two cameras, front and back, and when i'm trying to get info of the camera, it returns the info of the FRONT CAMERA. I used this code:

    if (Build.VERSION.SDK_INT <= 8){              Camera cam = Camera.open();              s +="<b><u>Main Camera:</u></b><br><br>";              s += "<b>Megapixels: </b>"+getCameraMegapixels(cam) +" megapixels";               s += getCamExtraInfo(cam);              cam.release();      }

I want to get the info from the main camera (the back camera), but that code gives me info from the front camera.... I'm sure there is a way to get the info from the back camera on Android 2.2 and lower devices.

Someone knows it?

Thanks

--
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
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 android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments:

Post a Comment