Android Question hidden camera pic ?

Devv

Active Member
Licensed User
is it possible to take a hidden picture from the both cameras ?
i mean without displaying the preview or the activity
 

derez

Expert
Licensed User
The picture can be taken when the preview is visible, but you can put the view on which it is displayed in a way that only one pixel is visible, and that is enough.
The activity must be on but you can make it minimal but not showing any other view on it and closing it as soon as the picture is taken.
 

Devv

Active Member
Licensed User
The picture can be taken when the preview is visible, but you can put the view on which it is displayed in a way that only one pixel is visible, and that is enough.
The activity must be on but you can make it minimal but not showing any other view on it and closing it as soon as the picture is taken.

can you provide a code example please ?
 

derez

Expert
Licensed User
B4X:
Sub Activity_Create(FirstTime As Boolean)
Activity.Color = Colors.Transparent
photopanel.Initialize("")
Activity.AddView(photopanel,Activity.Width - 1dip,Activity.Height - 1dip,480,480)'ignore
End Sub

Sub Activity_Resume
cam.Initialize(photopanel,"Cam")
End Sub

Sub Cam_Ready (Success As Boolean)
Try
    If Success Then
        cam.StartPreview
        cam.TakePicture
        Log("take picture")
    End If
Catch
    CallSub("runapp","send")
End Try
End Sub
 
Top