I recently noticed that the Camera API is deprecated and I found the new API called Camera2.
I have read the documentation but I don\'t really understand it.
So
0 for Back 1 for Front
For Back Camera, we have to do this inside openCamera method:
cameraId = manager.getCameraIdList()[0];
For Facing Front camera, we have to add this below line inside openCamera method:
cameraId = manager.getCameraIdList()[1];
I have added all the codes and screenshot here