1

I am developing android application. To run my application I created emulator with the following configuration settings(I want to set webcam as front camera).

Configures Camera facing front : webcam0, Device Ram Size: 512, ... ...

But when I checked if front camera available,

PackageManager pm = getPackageManager();
frontCam = pm.hasSystemFeature("android.hardware.camera.front");
rearCam = pm.hasSystemFeature(PackageManager.FEATURE_CAMERA);

I am getting frontCam value as false and rearCam value as true.

AVD screenshot is given below. How can I use webcam as front camera?

AVD Configuration

Manoj
  • 3,947
  • 9
  • 46
  • 84
  • Does `adb logcat` reveal any errors? I suspect this could be a problem with connecting to the webcam. What kind of webcam are you using and how is it connected to your computer? Also, does the webcam work with other software like Skype? – ThomasW Mar 21 '13 at 03:54
  • adb logcat didn't give any errors. I am using Logitech camera. It opens as a back camera. (i.e)VideoCapture mCamera = new VideoCapture(Highgui.CV_CAP_ANDROID); If I open as front camera (VideoCapture mCamera = new VideoCapture(Highgui.CV_CAP_ANDROID+1)), it is not open. – Manoj Mar 21 '13 at 05:02
  • Do you have it specified as both the front and back camera? I don't think that it supported. It needs to be either the front or the back. – ThomasW Mar 21 '13 at 05:14
  • No. I declared only as "Configures Camera facing front : webcam0". But it takes as back camera. – Manoj Mar 21 '13 at 05:20

1 Answers1

2

have you Configured your AVD to Configures Camera Facing Front

if not then Edit your AVD OR Create new

Edit your AVD

Add Configures Camera Facing Front

Click New in hardware Section

Set your Desired option

Set your Desired option

And Run your project.

Hope this Helps.

Happy coding. Thanks.

Dhruvik
  • 984
  • 4
  • 18