In this recipe, you will learn how to take a picture using the mobile device's camera.
Use the following code to prompt the user to select an image from their device's image library:
on mouseUp mobilePickPhoto "camera" if the result is empty then // do something end if end mouseUp
For both iOS and Android devices, we can use the mobilePickPhoto
command to prompt the user to snap a photo using the device's camera. We accomplish this by passing camera
as the parameter.
For iOS devices only (not Android), we can use rear camera
or front camera
as the parameter to specify which camera is to be used. Also, as you might assume, we cannot test a mobile device's camera in the simulator.