I wrote a library that I can use to launch the camera using "MediaStore.ACTION_IMAGE_CAPTURE," but I'd rather be able to just launch the intent from B4A.
Any ideas on how to do this? If not I'll stick to the library I created, and can post for others if there is interest.
Sub ParseUri(s As String) As Object
Dim r As Reflector
Return r.RunStaticMethod("android.net.Uri", "parse", Array As Object(s), Array As String("java.lang.String"))
End Sub
Thanks Erel. I was able to take this to get it to do what I need. I post the final solution here in case others want to use the Android system camera rather than ACL. This will take a picture and save an additional copy of the picture in the directory and file name specified. You can check for the existence of the additional file in activity_resume to do something with the image. It is a full sized image rather than a smaller image.
B4X:
Sub ParseUri(s As String) As Object
Dim r As Reflector
Return r.RunStaticMethod("android.net.Uri", "parse", Array As Object(s), Array As String("java.lang.String"))
End Sub
Sub OpenCam(dir as string, fn as string)
dim camintent as intent
camintent.Initialize("android.media.action.IMAGE_CAPTURE", "")
camintent.PutExtra("output",ParseUri("file://" & File.Combine(dir,fn)))
StartActivity(camintent)
End Sub