SlideShare a Scribd company logo
1 of 73
Download to read offline
Desmistificando o
PhoneGap/Cordova
Loiane Groner
http://loiane.com
• 9+ XPTI
• Ciência da Computação 2008/2
• Java, Sencha, Phonegap
• http://loiane.com
• Livros:
Loiane Groner
Motivação
Preciso de uma APP
IDE Emulador Store
Usuário
final
IDE Emulador Store
Usuário
final
IDE Emulador Store
Usuário
final
Phonegap
Framework JavaScript open source para
desenvolvimento de apps mobile híbridas
Híbrido?
Nativo Web
Como funciona
Seu Código
WebView Nativa (Browser)
Seu Código
APIs Nativas
WebView Nativa (Browser)
Seu Código
App Nativa: .apk, .ipa, etc
APIs Nativas
WebView Nativa (Browser)
Seu Código
Interface de uma app
phonegap
É uma instância do
browser nativo
100% largura e altura
Browser nativo (WebView)
sem barra de favoritos
sem barra para mudar url
O que instalar
Phonegap CLI
Corvova CLI
http://nodejs.org/
sudo npm install -g cordova
sudo npm install -g phonegap
Linux ou Mac OS
npm install -g cordova
npm install -g phonegap
Windows
Phonegap
Phonegap Dev App
Phonegap Build
Phonegap Enterprise
Cordova
Comunidade
Código fonte
Plugins
APIs
Ponte com plataforma nativa
Criando um projeto
phonegap create hello com.loiane.hello HelloWorld
cordova create hello com.loiane.hello HelloWorld
Testando e emulando
localmente
Plugins:
acesso recursos do device
cordova plugin add org.apache.cordova.camera
phonegap plugin add org.apache.cordova.camera
function capturePhoto() {
navigator.camera.getPicture(onPhotoDataSuccess, onFail, { quality: 50,
destinationType: destinationType.DATA_URL });
}
function capturePhoto() {
navigator.camera.getPicture(onPhotoDataSuccess, onFail, { quality: 50,
destinationType: destinationType.DATA_URL });
}
function onPhotoDataSuccess(imageData) {
var smallImage = document.getElementById('smallImage');
smallImage.style.display = 'block';
smallImage.src = "data:image/jpeg;base64," + imageData;
}
function capturePhoto() {
navigator.camera.getPicture(onPhotoDataSuccess, onFail, { quality: 50,
destinationType: destinationType.DATA_URL });
}
function onPhotoDataSuccess(imageData) {
var smallImage = document.getElementById('smallImage');
smallImage.style.display = 'block';
smallImage.src = "data:image/jpeg;base64," + imageData;
}
<button onclick="capturePhoto();">Capturar foto</button> <br>
<img style="display:none;" id="smallImage" src="" />
import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
public class MyCameraActivity extends Activity {
private static final int CAMERA_REQUEST = 1888;
private ImageView imageView;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
this.imageView = (ImageView)this.findViewById(R.id.imageView1);
Button photoButton = (Button) this.findViewById(R.id.button1);
photoButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(cameraIntent, CAMERA_REQUEST);
}
});
}
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == CAMERA_REQUEST && resultCode == RESULT_OK) {
Bitmap photo = (Bitmap) data.getExtras().get("data");
imageView.setImageBitmap(photo);
}
}
}
- (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;
}
// 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.";
});
}
Trabalhando com Views
Topcoat
DOM
Architecture
UI
Full Stack
<ion-tabs>
<ion-tab title="Home" icon="ion-home">
<ion-nav-view name="home"></ion-nav-view>
</ion-tab>
<ion-tab title="About" icon="ion-information">
<ion-nav-view name="about"></ion-nav-view>
</ion-tab>
<ion-tab title="Contact" icon="ion-ios7-world">
<ion-nav-view name="contact"></ion-nav-view>
</ion-tab>
</ion-tabs>
Fazendo build
Enviando pra App Store
cordova platform add android
Add Plataforma
phonegap platform add android
Phonegap Build
apps open source: grátis (github)
apps código privado: pago
Processo de enviar para apps store é nativo
Processo de enviar para apps store é nativo
Exemplos de Apps
http://phonegap.com/app/
http://showcase.ionicframework.com/
http://www.jqmgallery.com/
Quero Aprender!
Topcoat
DOM
Architecture
UI
Full Stack
http://loiane.com
fb.com/loianegroner
@loiane
https://github.com/loiane
youtube.com/user/Loianeg
Obrigada!

More Related Content

What's hot

Baruco 2014 - Rubymotion Workshop
Baruco 2014 - Rubymotion WorkshopBaruco 2014 - Rubymotion Workshop
Baruco 2014 - Rubymotion Workshop
Brian Sam-Bodden
 

What's hot (20)

Java applets
Java appletsJava applets
Java applets
 
ITFT- Applet in java
ITFT- Applet in javaITFT- Applet in java
ITFT- Applet in java
 
Baruco 2014 - Rubymotion Workshop
Baruco 2014 - Rubymotion WorkshopBaruco 2014 - Rubymotion Workshop
Baruco 2014 - Rubymotion Workshop
 
Java Applet
Java AppletJava Applet
Java Applet
 
Java Applet
Java AppletJava Applet
Java Applet
 
Java applet
Java appletJava applet
Java applet
 
Android, the life of your app
Android, the life of your appAndroid, the life of your app
Android, the life of your app
 
Appium troubleshooting
Appium troubleshootingAppium troubleshooting
Appium troubleshooting
 
Java applets
Java appletsJava applets
Java applets
 
What's new in Android P @ I/O Extended Bangkok 2018
What's new in Android P @ I/O Extended Bangkok 2018What's new in Android P @ I/O Extended Bangkok 2018
What's new in Android P @ I/O Extended Bangkok 2018
 
Java Applets
Java AppletsJava Applets
Java Applets
 
Applet programming
Applet programming Applet programming
Applet programming
 
ParisJS #10 : RequireJS
ParisJS #10 : RequireJSParisJS #10 : RequireJS
ParisJS #10 : RequireJS
 
Appium Meetup #2 - Mobile Web Automation Introduction
Appium Meetup #2 - Mobile Web Automation IntroductionAppium Meetup #2 - Mobile Web Automation Introduction
Appium Meetup #2 - Mobile Web Automation Introduction
 
Applet
 Applet Applet
Applet
 
23 silverlight apps on windows phone 8.1
23   silverlight apps on windows phone 8.123   silverlight apps on windows phone 8.1
23 silverlight apps on windows phone 8.1
 
Applets
AppletsApplets
Applets
 
Java: Java Applets
Java: Java AppletsJava: Java Applets
Java: Java Applets
 
L18 applets
L18 appletsL18 applets
L18 applets
 
21 android2 updated
21 android2 updated21 android2 updated
21 android2 updated
 

Viewers also liked

QConSP 2012: CSS3 com Sass e Compass
QConSP 2012: CSS3 com Sass e CompassQConSP 2012: CSS3 com Sass e Compass
QConSP 2012: CSS3 com Sass e Compass
Loiane Groner
 

Viewers also liked (20)

Devcast Brasil: ExtJS 4 e Sencha Touch 2
Devcast Brasil: ExtJS 4 e Sencha Touch 2Devcast Brasil: ExtJS 4 e Sencha Touch 2
Devcast Brasil: ExtJS 4 e Sencha Touch 2
 
JavaCE Conference 2012: ExtJS 4 + VRaptor
JavaCE Conference 2012: ExtJS 4 + VRaptorJavaCE Conference 2012: ExtJS 4 + VRaptor
JavaCE Conference 2012: ExtJS 4 + VRaptor
 
MNT2014: Mobile Hibrido com Phonegap
MNT2014: Mobile Hibrido com PhonegapMNT2014: Mobile Hibrido com Phonegap
MNT2014: Mobile Hibrido com Phonegap
 
Ext JS 4 em 5 Minutos - QCONSP 2011
Ext JS 4 em 5 Minutos - QCONSP 2011Ext JS 4 em 5 Minutos - QCONSP 2011
Ext JS 4 em 5 Minutos - QCONSP 2011
 
Mulheres da Tecnologia da Informação - Techinter
Mulheres da Tecnologia da Informação - TechinterMulheres da Tecnologia da Informação - Techinter
Mulheres da Tecnologia da Informação - Techinter
 
Linguagil 2012: Desenvolvendo Aplicações RIA com Ext JS 4 e Touch 2
Linguagil 2012: Desenvolvendo Aplicações RIA com  Ext JS 4 e Touch 2Linguagil 2012: Desenvolvendo Aplicações RIA com  Ext JS 4 e Touch 2
Linguagil 2012: Desenvolvendo Aplicações RIA com Ext JS 4 e Touch 2
 
Ajax de primeira com ExtJS + JSON no seu projeto Spring
Ajax de primeira com ExtJS + JSON no seu projeto SpringAjax de primeira com ExtJS + JSON no seu projeto Spring
Ajax de primeira com ExtJS + JSON no seu projeto Spring
 
FrontInBahia 2014: 10 dicas de desempenho para apps mobile híbridas
FrontInBahia 2014: 10 dicas de desempenho para apps mobile híbridasFrontInBahia 2014: 10 dicas de desempenho para apps mobile híbridas
FrontInBahia 2014: 10 dicas de desempenho para apps mobile híbridas
 
QCON SP 2014: 10 dicas de desempenho para apps mobile hibridas
QCON SP 2014: 10 dicas de desempenho para apps mobile hibridasQCON SP 2014: 10 dicas de desempenho para apps mobile hibridas
QCON SP 2014: 10 dicas de desempenho para apps mobile hibridas
 
DevInCachu 2012: Desenvolvendo Aplicacoes RIA com ExtJS 4 e Sencha Touch 2
DevInCachu 2012: Desenvolvendo Aplicacoes RIA com ExtJS 4 e Sencha Touch 2DevInCachu 2012: Desenvolvendo Aplicacoes RIA com ExtJS 4 e Sencha Touch 2
DevInCachu 2012: Desenvolvendo Aplicacoes RIA com ExtJS 4 e Sencha Touch 2
 
FrontInFloripa 2013: Sencha Touch 2 e Phonegap
FrontInFloripa 2013: Sencha Touch 2 e PhonegapFrontInFloripa 2013: Sencha Touch 2 e Phonegap
FrontInFloripa 2013: Sencha Touch 2 e Phonegap
 
TDC 2011 - Ext JS 4
TDC 2011 - Ext JS 4TDC 2011 - Ext JS 4
TDC 2011 - Ext JS 4
 
QConSP 2012: CSS3 com Sass e Compass
QConSP 2012: CSS3 com Sass e CompassQConSP 2012: CSS3 com Sass e Compass
QConSP 2012: CSS3 com Sass e Compass
 
FAESA Computação Móvel: Introducao a Phonegap e Cordova
FAESA Computação Móvel: Introducao a Phonegap e CordovaFAESA Computação Móvel: Introducao a Phonegap e Cordova
FAESA Computação Móvel: Introducao a Phonegap e Cordova
 
Sencha Touch e PhoneGap: SouJava - IBM Maio 2013
Sencha Touch e PhoneGap: SouJava - IBM Maio 2013Sencha Touch e PhoneGap: SouJava - IBM Maio 2013
Sencha Touch e PhoneGap: SouJava - IBM Maio 2013
 
JustJava 2013: Aplicações Desktop HTML5, CSS3, Javascript com Servlets 3
JustJava 2013: Aplicações Desktop HTML5, CSS3, Javascript com Servlets 3JustJava 2013: Aplicações Desktop HTML5, CSS3, Javascript com Servlets 3
JustJava 2013: Aplicações Desktop HTML5, CSS3, Javascript com Servlets 3
 
WebBr 2013: Apps Mobile Multiplataforma e OpenSource com Sencha Touch e Phon...
WebBr 2013: Apps Mobile Multiplataforma e OpenSource com  Sencha Touch e Phon...WebBr 2013: Apps Mobile Multiplataforma e OpenSource com  Sencha Touch e Phon...
WebBr 2013: Apps Mobile Multiplataforma e OpenSource com Sencha Touch e Phon...
 
BeagaJS 2013: Sencha Touch + PhoneGap
BeagaJS 2013: Sencha Touch + PhoneGapBeagaJS 2013: Sencha Touch + PhoneGap
BeagaJS 2013: Sencha Touch + PhoneGap
 
Justjava 2012: REST Com Jax-RS e ExtJS 4
Justjava 2012: REST Com Jax-RS e ExtJS 4Justjava 2012: REST Com Jax-RS e ExtJS 4
Justjava 2012: REST Com Jax-RS e ExtJS 4
 
JavaOne Brazil 2015: Java e HTML5
JavaOne Brazil 2015: Java e HTML5JavaOne Brazil 2015: Java e HTML5
JavaOne Brazil 2015: Java e HTML5
 

Similar to MobileConf 2015: Desmistificando o Phonegap (Cordova)

Cross-platform mobile apps with Apache Cordova
Cross-platform mobile apps with Apache CordovaCross-platform mobile apps with Apache Cordova
Cross-platform mobile apps with Apache Cordova
Ivano Malavolta
 
PhoneGap:你应该知道的12件事
PhoneGap:你应该知道的12件事PhoneGap:你应该知道的12件事
PhoneGap:你应该知道的12件事
longfei.dong
 
WebRTC & Firefox OS - presentation at Google
WebRTC & Firefox OS - presentation at GoogleWebRTC & Firefox OS - presentation at Google
WebRTC & Firefox OS - presentation at Google
Robert Nyman
 
Bringing the open web and APIs to mobile devices with Firefox OS - Whisky W...
 	Bringing the open web and APIs to mobile devices with Firefox OS - Whisky W... 	Bringing the open web and APIs to mobile devices with Firefox OS - Whisky W...
Bringing the open web and APIs to mobile devices with Firefox OS - Whisky W...
Robert Nyman
 
WebAPIs & Apps - Mozilla London
WebAPIs & Apps - Mozilla LondonWebAPIs & Apps - Mozilla London
WebAPIs & Apps - Mozilla London
Robert Nyman
 
Web APIs & Apps - Mozilla
Web APIs & Apps - MozillaWeb APIs & Apps - Mozilla
Web APIs & Apps - Mozilla
Robert Nyman
 

Similar to MobileConf 2015: Desmistificando o Phonegap (Cordova) (20)

Desmistificando o Phonegap (Cordova)
Desmistificando o Phonegap (Cordova)Desmistificando o Phonegap (Cordova)
Desmistificando o Phonegap (Cordova)
 
Cross-platform mobile apps with Apache Cordova
Cross-platform mobile apps with Apache CordovaCross-platform mobile apps with Apache Cordova
Cross-platform mobile apps with Apache Cordova
 
Browser_Stack_Intro
Browser_Stack_IntroBrowser_Stack_Intro
Browser_Stack_Intro
 
Intro to PhoneGap
Intro to PhoneGapIntro to PhoneGap
Intro to PhoneGap
 
How to implement camera recording for USB webcam or IP camera in C#.NET
How to implement camera recording for USB webcam or IP camera in C#.NETHow to implement camera recording for USB webcam or IP camera in C#.NET
How to implement camera recording for USB webcam or IP camera in C#.NET
 
PhoneGap:你应该知道的12件事
PhoneGap:你应该知道的12件事PhoneGap:你应该知道的12件事
PhoneGap:你应该知道的12件事
 
06.Programming Media on Windows Phone
06.Programming Media on Windows Phone06.Programming Media on Windows Phone
06.Programming Media on Windows Phone
 
WebRTC & Firefox OS - presentation at Google
WebRTC & Firefox OS - presentation at GoogleWebRTC & Firefox OS - presentation at Google
WebRTC & Firefox OS - presentation at Google
 
Building a Native Camera Access Library - Part I - Transcript.pdf
Building a Native Camera Access Library - Part I - Transcript.pdfBuilding a Native Camera Access Library - Part I - Transcript.pdf
Building a Native Camera Access Library - Part I - Transcript.pdf
 
[JMaghreb 2014] Developing JavaScript Mobile Apps Using Apache Cordova
[JMaghreb 2014] Developing JavaScript Mobile Apps Using Apache Cordova[JMaghreb 2014] Developing JavaScript Mobile Apps Using Apache Cordova
[JMaghreb 2014] Developing JavaScript Mobile Apps Using Apache Cordova
 
Building Cross-Platform Mobile Applications with HTML5
Building Cross-Platform Mobile Applications with HTML5Building Cross-Platform Mobile Applications with HTML5
Building Cross-Platform Mobile Applications with HTML5
 
End to-end testing from rookie to pro
End to-end testing  from rookie to proEnd to-end testing  from rookie to pro
End to-end testing from rookie to pro
 
QXCameraKit
QXCameraKitQXCameraKit
QXCameraKit
 
[Devoxx Morocco 2015] Apache Cordova In Action
[Devoxx Morocco 2015] Apache Cordova In Action[Devoxx Morocco 2015] Apache Cordova In Action
[Devoxx Morocco 2015] Apache Cordova In Action
 
Android UI Testing with Appium
Android UI Testing with AppiumAndroid UI Testing with Appium
Android UI Testing with Appium
 
The Google App Engine Oil Framework
The Google App Engine Oil FrameworkThe Google App Engine Oil Framework
The Google App Engine Oil Framework
 
Bringing the open web and APIs to mobile devices with Firefox OS - Whisky W...
 	Bringing the open web and APIs to mobile devices with Firefox OS - Whisky W... 	Bringing the open web and APIs to mobile devices with Firefox OS - Whisky W...
Bringing the open web and APIs to mobile devices with Firefox OS - Whisky W...
 
WebAPIs & Apps - Mozilla London
WebAPIs & Apps - Mozilla LondonWebAPIs & Apps - Mozilla London
WebAPIs & Apps - Mozilla London
 
Comprehensive List of Open Source QA Tools
Comprehensive List of Open Source QA ToolsComprehensive List of Open Source QA Tools
Comprehensive List of Open Source QA Tools
 
Web APIs & Apps - Mozilla
Web APIs & Apps - MozillaWeb APIs & Apps - Mozilla
Web APIs & Apps - Mozilla
 

Recently uploaded

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Recently uploaded (20)

presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 

MobileConf 2015: Desmistificando o Phonegap (Cordova)

  • 2. • 9+ XPTI • Ciência da Computação 2008/2 • Java, Sencha, Phonegap • http://loiane.com • Livros: Loiane Groner
  • 5.
  • 6. IDE Emulador Store Usuário final IDE Emulador Store Usuário final IDE Emulador Store Usuário final
  • 7.
  • 9. Framework JavaScript open source para desenvolvimento de apps mobile híbridas
  • 11.
  • 13.
  • 14.
  • 15.
  • 19. APIs Nativas WebView Nativa (Browser) Seu Código
  • 20. App Nativa: .apk, .ipa, etc APIs Nativas WebView Nativa (Browser) Seu Código
  • 21.
  • 22. Interface de uma app phonegap É uma instância do browser nativo 100% largura e altura Browser nativo (WebView) sem barra de favoritos sem barra para mudar url
  • 26. sudo npm install -g cordova sudo npm install -g phonegap Linux ou Mac OS
  • 27. npm install -g cordova npm install -g phonegap Windows
  • 28. Phonegap Phonegap Dev App Phonegap Build Phonegap Enterprise Cordova Comunidade Código fonte Plugins APIs Ponte com plataforma nativa
  • 30. phonegap create hello com.loiane.hello HelloWorld cordova create hello com.loiane.hello HelloWorld
  • 32.
  • 34.
  • 35. cordova plugin add org.apache.cordova.camera phonegap plugin add org.apache.cordova.camera
  • 36. function capturePhoto() { navigator.camera.getPicture(onPhotoDataSuccess, onFail, { quality: 50, destinationType: destinationType.DATA_URL }); }
  • 37. function capturePhoto() { navigator.camera.getPicture(onPhotoDataSuccess, onFail, { quality: 50, destinationType: destinationType.DATA_URL }); } function onPhotoDataSuccess(imageData) { var smallImage = document.getElementById('smallImage'); smallImage.style.display = 'block'; smallImage.src = "data:image/jpeg;base64," + imageData; }
  • 38. function capturePhoto() { navigator.camera.getPicture(onPhotoDataSuccess, onFail, { quality: 50, destinationType: destinationType.DATA_URL }); } function onPhotoDataSuccess(imageData) { var smallImage = document.getElementById('smallImage'); smallImage.style.display = 'block'; smallImage.src = "data:image/jpeg;base64," + imageData; } <button onclick="capturePhoto();">Capturar foto</button> <br> <img style="display:none;" id="smallImage" src="" />
  • 39.
  • 40. import android.app.Activity; import android.content.Intent; import android.graphics.Bitmap; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.ImageView; public class MyCameraActivity extends Activity { private static final int CAMERA_REQUEST = 1888; private ImageView imageView; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); this.imageView = (ImageView)this.findViewById(R.id.imageView1); Button photoButton = (Button) this.findViewById(R.id.button1); photoButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); startActivityForResult(cameraIntent, CAMERA_REQUEST); } }); } protected void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == CAMERA_REQUEST && resultCode == RESULT_OK) { Bitmap photo = (Bitmap) data.getExtras().get("data"); imageView.setImageBitmap(photo); } } }
  • 41. - (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; }
  • 42. // 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."; }); }
  • 44.
  • 46.
  • 47.
  • 48. <ion-tabs> <ion-tab title="Home" icon="ion-home"> <ion-nav-view name="home"></ion-nav-view> </ion-tab> <ion-tab title="About" icon="ion-information"> <ion-nav-view name="about"></ion-nav-view> </ion-tab> <ion-tab title="Contact" icon="ion-ios7-world"> <ion-nav-view name="contact"></ion-nav-view> </ion-tab> </ion-tabs>
  • 51.
  • 52. cordova platform add android Add Plataforma phonegap platform add android
  • 53.
  • 54.
  • 55. Phonegap Build apps open source: grátis (github) apps código privado: pago
  • 56.
  • 57.
  • 58.
  • 59.
  • 60.
  • 61. Processo de enviar para apps store é nativo
  • 62. Processo de enviar para apps store é nativo
  • 67.
  • 68.
  • 70.