Front Camera

vb1992

Well-Known Member
Licensed User
Longtime User
Has anyone gotten the Front Camera working with ACL
or any other libraries?

I was testing on a 2.3 device


Here was a few random things I was trying below....
In no order, I clumped them together for this post...



B4X:
      '  Camera.Parameters p = mCamera.getParameters();
      '  p.set("camera-id",2);
      '  mCamera.setParameters(p);

camera1.ParmStr = "camera_id"
camera1.CameraFront
camera1.CameraFront2
camera1.openFrontFacingCameraGingerbread 
  
  'camera1.rCPKey("camera_id")
  
 camera1.wiCPKey("camera_id",2)
 camera1.wiCPKey("camera-id",2)
 

vb1992

Well-Known Member
Licensed User
Longtime User
looks like I had this permission commented out

B4X:
<uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS"/>

I'll try again later today to see if that does it...


I also notice this:
Will need to test more....
B4X:
<uses-permission android:name="android.permission.CAMERA" />

<uses-feature android:name="android.hardware.camera" android:required="false" />

<uses-feature android:name="android.hardware.camera.front" android:required="false" />
 
Upvote 0

vb1992

Well-Known Member
Licensed User
Longtime User
Erel, can I set the front camera with Reflection Library?
I think it's important to get the front camera working

I am using the ACL Library


B4X:
Dim r As Reflector

    r.Target = camera1

    r.RunMethod("getParameters")

      r.RunMethod3("setParameters", "camera_id", "java.lang.String", "2", "java.lang.int")
 
Last edited:
Upvote 0

vb1992

Well-Known Member
Licensed User
Longtime User
I see code on stack overflow


Camera.Parameters parameters = camera.getParameters();
parameters.set("camera_id", 2);
camera.setParameters(parameters);


note: Camera_id could be Camera-id
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…