We are using this code to opet camera and save output of it:
B4X:
Dim i As Intent
i.Initialize("android.media.action.IMAGE_CAPTURE", "")
File.Delete(Starter.Provider.SharedFolder, tempImageFile)
Dim u As Object = Starter.Provider.GetFileUri(tempImageFile)
i.PutExtra("output", u) 'the image will be saved to this path
As default, it opens back camera. We would like to as default have front camera.
Check this answer: https://stackoverflow.com/a/57871638/971547
It shouldn't be too difficult to port it to B4A, however the author writes that it doesn't work on API 28 (Android 9)+ so it isn't too useful.