Using the new CameraUI
API (available in the mobile AIR SDK), we can perform and alternative capture process to the normal Camera
API. The Mobile CameraUI
class will make use of the default Android camera application, alongside our custom app, to capture a photograph.
We will set up a CameraUI
object to invoke the native Android camera to capture a photograph:
1. First, import the following classes into your project:
import flash.display.Sprite; import flash.display.StageAlign; import flash.display.StageScaleMode; import flash.events.Event; import flash.events.MediaEvent; import flash.events.TouchEvent; import flash.media.CameraUI; import flash.media.MediaType; import flash.media.MediaPromise; import flash.ui.Multitouch; import flash.ui.MultitouchInputMode; import flash.text.TextField; import flash.text.TextFormat;
2. Declare aTextField and
TextFormat
object pair to allow visible output upon the device. ACameraUI
object...