PhoneGap / Apache Cordova

Cássio Nandi Citadin
#TechDay #PhoneGap #2013
Desenvolvimento Mobile

#TechDay #PhoneGap #2013
Por que usar PhoneGap?


Pacotes nativos -> Distribuível nas lojas/stores





.apk, .ipa, .cod, .ota, .ipk entre outros

Write once, run everywhere (Java, alguém?)
Tecnologias web padronizadas (W3C approved

#TechDay #PhoneGap #2013

)
PhoneGap pode ser seu melhor amigo se:


Precisa alcançar várias plataformas (velocidade e economia)



Você sabe HTML/JavaScript/CSS

Já tem uma web app e precisa
adicionar funcionalidades nativas




Apps que exibem dados, integração com redes sociais, jogos simples


PhoneGap Legends no GitHub, blog do desenvolvedor ou video

#TechDay #PhoneGap #2013
PhoneGap

?

#TechDay #PhoneGap #2013

Apache
Cordova
Contribuidores





Adobe
Microsoft – Windows Phone (estimula uso do html5)
RIM – BlackBerry (WebWorks) / Ripple Emulator
IBM

#TechDay #PhoneGap #2013
Quem mais usa PhoneGap?






Facebook Mobile SDK
IBM Worklight Platform
Oracle ADF Mobile
SAP
Icenium

Apps?
http://phonegap.com/app/

#TechDay #PhoneGap #2013
Suporte a 7 plataformas (Firefox OS e Ubuntu a caminho)

#TechDay #PhoneGap #2013
How does PhoneGap work?
PhoneGap App

PhoneGap
JavaScript
Engine

Dispositivo

PhoneGap
Native
Engine

Acesso nativo

Código
HTML/JavaScript/CSS/Images/
Frameworks/Libraries

Web View
Renders the app UI

#TechDay #PhoneGap #2013
Plug-ins do PhoneGap





Desde a versão 3
Criar seu próprio plugin
Delega processamento pesado para o código nativo
Criar serviços de background

#TechDay #PhoneGap #2013
Demo

#TechDay #PhoneGap #2013
O que pode ser usado para construir uma app?

#TechDay #PhoneGap #2013
Construir app como se estivesse trabalhando em projeto Web

#TechDay #PhoneGap #2013
Empacotando uma app
Dois métodos:
 Usando a ferramenta da plataforma em específico


Usando PhoneGap Build – um serviço cloud

#TechDay #PhoneGap #2013
Usando PhoneGap Build






http://build.phonegap.com
Suporta: iOS, Android, BlackBerry, WebOS, Windows Phone 7 e
Symbian
Gratis para Open Source | Pago para empresas
Link GitHub

#TechDay #PhoneGap #2013
Using the PhoneGap Build
Sugestão para teste: https://github.com/phonegap/phonegap-start.git

#TechDay #PhoneGap #2013
PhoneGap Emulate


http://emulate.phonegap.com

#TechDay #PhoneGap #2013
Apps novas
https://itunes.apple.com/us/app/acheibr/id721184010?ls=1&mt=8
https://play.google.com/store/apps/details?id=com.acheibr.apps
https://play.google.com/store/apps/details?id=com.pandoapps.fiia

#TechDay #PhoneGap #2013
Dúvidas e sugestões?

Contato
Linkedin/cassionandi
cassionandicitadin@gmail.com
FB/cassionandi

#TechDay #PhoneGap #2013

Desenvolvimento de aplicativos Mobile com HTML5 e Javascript com Phonegap (Techday 2013)

Notas do Editor

  • #2 Sorry guys. Thereismoreme in themenu :DWhois a mobile developer?Who knowswhatPhoneGapis?Who hascreated a PhoneGapapplication?
  • #4 PhoneGap answers another issue many companies / customers / developers have: the ability of distributing web apps through application stores.
  • #5 PhoneGap could be the default option for many application types especially if you want to target multiple platforms, you know web technologies, and you have an existing REST API that you could reuse with your PhoneGap app.
  • #6 Atthispoint I shouldstopandquicklyexplainwhatistherelationbetweenPhoneGapand Apache Cordova.PhoneGap was developedby a smallcompanycalledNitobi. When Adobe boughtthiscompany last year, wereleasedthesourcecodeas an open sourceprojectunder Apache Foundation. Andthenameofthisproject was changedfromPhoneGaptoCordova. Ofcourse Adobe continuestobeoneofthemaincontributorstogetherwithothercompanieslike IBM, RIM, or Microsoft.Today PhoneGapisthenameofAdobe‘sCordovadistribution.
  • #7 What platforms does PhoneGap support?It is the only open source framework that supports 7 platforms AFAIK. From iOS and Android to Windows Phone and BlackBerryHere is a list of built-in out of the box device APIs supported by PhoneGap. It supports accelerometer, all sort of notifications, storage, contacts and file APIs and so forth. Where you see an X the reason is that the device doesn’t have the capability most of times and not a PhoneGap issue. For example there is no accelerometer on on older iPhones.
  • #8 So how does PhoneGap work? Most mobile platforms offer something called WebView – which is a chromless browser. A full screen browser without location bar, history buttons, without any UI.And using native code this WebView can be extended by exposing device APIs or capabilities to the JavaScript code that runs in this WebView.In this diagram you can see that there is the PhoneGap Native Engine that exposes the native capabilities through a PhoneGap JavaScript API to the application JavaScript. And the application UI is created with HTML/JavaScript/CSS and runs inside the WebViewWebView – chromless browser full screenNative Layer– PhoneGap native engine – PhoneGapJavaScrip APIApplication Files – HTML / JavaScript / CSS
  • #9 You can write plugins in order to expose additional native features to JavaScript. A plugin has two parts: a native part that exposes the native feature and JavaScript part that provides the API that will be used by the developers who want to consume your plugin.
  • #10 Next let me show you some PhoneGap applications to see for yourself what is possible to build using this platform.WikipediaUntappdPhoneGap API2011 Census ?
  • #11 PhoneGap doesn’t provide any UI out of the box. This means that you are free to use whatever you want.You can use whatever JavaScript frameworks or libraries you like. Eg. jQuery, jQuery Mobile, Sencha, Backbone, Liquid, Mustache, Bootrstrap, and so onPay attention to performance (mobile vs. desktop)Pay attention to mobile browser features or lack of them (I am talking about SVG)
  • #12 Most of the time you’ll be building your PhoneGap app the same way you build web apps.- Using your favorite editors (Eclipse, vim, Dreamweaver, Visual Studio)- Test and debug the app using your desktop browser- Test and debug the app using mobile simulators/emulators and the physical devices
  • #13 PhoneGap Build is
  • #14 The PhoneGap Emulator allows you to test your PhoneGap application from your desktop browser. PhoneGap's JavaScript APIs are avaialble using Ripple, so you can subscribe to deviceready and even stub responses for your custom plugins.