CameraControl - Android

The place to discuss anything and everything about running your LiveCode on Android

Moderators: heatherlaine, Klaus, FourthWorld, robinmiller, kevinmiller

Post Reply
Googie85
Posts: 98
Joined: Tue Aug 05, 2014 10:07 am

CameraControl - Android

Post by Googie85 » Fri Jul 20, 2018 11:01 am

Hi Guys,

I am trying to take a photo from within android. The following code doesn't seem to work.

Code: Select all

cameraControlCreate "myFirstCamera"
      cameraControlSet "myFirstCamera", "visible", true
      cameraControlSet "myFirstCamera", "rect", "50,50,100,100"
      cameraControlSet "myFirstCamera", "device", "rear"
      cameraControlDo "myFirstCamera", "takePicture"
Any ideas are warmly welcomed!!

Thanks,

Googie.

Googie85
Posts: 98
Joined: Tue Aug 05, 2014 10:07 am

Re: CameraControl - Android

Post by Googie85 » Fri Jul 20, 2018 11:14 am

Code: Select all

      cameraControlCreate "myFirstCamera"
      cameraControlSet "myFirstCamera", "visible", true
      cameraControlSet "myFirstCamera", "rect", "50,50,100,100"
      cameraControlSet "myFirstCamera", "device", "rear"
      cameraControlDo "myFirstCamera", "takePicture"
      set defaultfolder to "/mnt/sdcard/"
      put the result into url ("file:snapshot.jpg")

Klaus
Posts: 10292
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: CameraControl - Android

Post by Klaus » Fri Jul 20, 2018 11:21 am

Hi Googie,

try this:

Code: Select all

...
cameraControlDo "myFirstCamera", "takePicture"
put specialfolderpath("external documents") & "/snapshot.jpg" into tImageFile
put the result into url ("file:" & tImageFile)
...
I think -> specialfolderpath("external documents") IS in fact -> mnt/sdcard/
but this is official syntax and surely worth a try.


Best

Klaus

Googie85
Posts: 98
Joined: Tue Aug 05, 2014 10:07 am

Re: CameraControl - Android

Post by Googie85 » Fri Jul 20, 2018 11:28 am

Thanks for your reply!!!

I cant even view what the camera is focused on. Any ideas with that?

Thanks Klaus!!

Googie.

Klaus
Posts: 10292
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: CameraControl - Android

Post by Klaus » Fri Jul 20, 2018 12:19 pm

Hi Googie,

no, sorry, no idea.
I do not own a cellphone or tablet, so my knowledge is just theoretical... 8)

Why not use:

Code: Select all

...
mobilepickphoto "camera"
...
?


Best

Klaus

Post Reply

Return to “Android Deployment”