22. App Nativa
Dispositivo
App Híbrida
executa UI e
(alguma) lógica de
negócio
Código Nativo
Interpretador
JavaScript
Ponte
Web Server
Java/PHP/
Ruby/C#
Arquivos
Imagens/
Documentos
Banco de
Dados
Backend
http://
Lógica de negócio
http://
25. Desenvolvimento de App Híbrida
Passo 1: Criar app com HTML/JS/CSS
Passo 2: Criar projeto usando API Phonegap e
caso seja necessário usar API para acesso nativo
26. Desenvolvimento de App Híbrida
Passo 1: Criar app com HTML/JS/CSS
Passo 2: Criar projeto usando API Phonegap e
caso seja necessário usar API para acesso nativo
Passo 3: Fazer Build e empacotar app
27. Desenvolvimento de App Híbrida
Passo 1: Criar app com HTML/JS/CSS
Passo 2: Criar projeto usando API Phonegap e
caso seja necessário usar API para acesso nativo
Passo 3: Fazer Build e empacotar app
Passo 4: Enviar para App Store,Google Play,
Market Place,etc
31. - (BOOL) startCameraControllerFromViewController: (UIViewController*) controller!
usingDelegate: (id <UIImagePickerControllerDelegate,!
UINavigationControllerDelegate>) delegate {!
!
if (([UIImagePickerController isSourceTypeAvailable:!
UIImagePickerControllerSourceTypeCamera] == NO)!
|| (delegate == nil)!
|| (controller == nil))!
return NO;!
!
!
UIImagePickerController *cameraUI = [[UIImagePickerController alloc] init];!
cameraUI.sourceType = UIImagePickerControllerSourceTypeCamera;!
!
// Displays a control that allows the user to choose picture or!
// movie capture, if both are available:!
cameraUI.mediaTypes =!
[UIImagePickerController availableMediaTypesForSourceType:!
UIImagePickerControllerSourceTypeCamera];!
!
// Hides the controls for moving & scaling pictures, or for!
// trimming movies. To instead show the controls, use YES.!
cameraUI.allowsEditing = NO;!
!
cameraUI.delegate = delegate;!
!
[controller presentModalViewController: cameraUI animated: YES];!
return YES;!
}!
32. // Check to see if the camera is available on the device.!
if (PhotoCaptureDevice.AvailableSensorLocations.Contains(CameraSensorLocation.Back) ||!
PhotoCaptureDevice.AvailableSensorLocations.Contains(CameraSensorLocation.Front))!
{!
// Initialize the camera, when available.!
if (PhotoCaptureDevice.AvailableSensorLocations.Contains(CameraSensorLocation.Back))!
{!
// Use the back camera.!
System.Collections.Generic.IReadOnlyList<Windows.Foundation.Size> SupportedResolutions = !
PhotoCaptureDevice.GetAvailableCaptureResolutions(CameraSensorLocation.Back);!
Windows.Foundation.Size res = SupportedResolutions[0];!
this.captureDevice = await PhotoCaptureDevice.OpenAsync(CameraSensorLocation.Back, res);!
}!
else!
{!
// Otherwise, use the front camera.!
System.Collections.Generic.IReadOnlyList<Windows.Foundation.Size> SupportedResolutions = !
PhotoCaptureDevice.GetAvailableCaptureResolutions(CameraSensorLocation.Front);!
Windows.Foundation.Size res = SupportedResolutions[0];!
this.captureDevice = await PhotoCaptureDevice.OpenAsync(CameraSensorLocation.Front, res);!
}!
...!
...!
...!
!
//Set the VideoBrush source to the camera.!
viewfinderBrush.SetSource(this.captureDevice);!
!
// The event is fired when the shutter button receives a half press.!
CameraButtons.ShutterKeyHalfPressed += OnButtonHalfPress;!
!
// The event is fired when the shutter button receives a full press.!
CameraButtons.ShutterKeyPressed += OnButtonFullPress;!
!
// The event is fired when the shutter button is released.!
CameraButtons.ShutterKeyReleased += OnButtonRelease; }!
else!
{!
// The camera is not available.!
this.Dispatcher.BeginInvoke(delegate()!
{!
// Write message.!
txtDebug.Text = "A Camera is not available on this phone.";!
});!
}!