I'm sure being the expert that you are you are correct in saying that an "auto snap" would not be possible. However, my query then is, if I load an activity which in-turn launches a Camera intent, is it not possible that at some point in that Activity a timer could be used to take a picture? I haven't tried this but I do have an app where I launch an Activity with a full camera view where a user clicks a button to take and save a picture to the sd-card. Theoretically then, would it not be possible for me to click the button click event on a timer and then once the picture is saved, exit the activity? What you think?
your request is similar a barcode reader app that just return the barcode and some other information, that works with zxing
because its part of design and i guess it is used from StartIntentWithResult
at my phone the camera app is from motorola and it seems this app not support it.
would be good if all app developer think about automation.
Using VBFrontcam library I do what you want (but without an intent). It can be done with any other camera library.
The application is started by a service which calls the camera activity, it saves the picture and calls another service to send the picture and then the application is shutdown.
B4X:
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
Sub Cam_PictureTaken (Data() As Byte)
Dim out As OutputStream
out = File.OpenOutput(runapp.picdir, runapp.picfile, False)
out.WriteBytes(Data, 0, Data.Length)
out.Close
cam.Release
CallSub("runapp","send")
CallSub(Main,"mainend")
' Log("cam closed")
Activity.Finish
End Sub
Using VBFrontcam library I do what you want (but without an intent). It can be done with any other camera library.
The application is started by a service which calls the camera activity, it saves the picture and calls another service to send the picture and then the application is shutdown.
B4X:
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
Sub Cam_PictureTaken (Data() As Byte)
Dim out As OutputStream
out = File.OpenOutput(runapp.picdir, runapp.picfile, False)
out.WriteBytes(Data, 0, Data.Length)
out.Close
cam.Release
CallSub("runapp","send")
CallSub(Main,"mainend")
' Log("cam closed")
Activity.Finish
End Sub