jQuery Mobile & PhoneGap

S
jQuery Mobile & PhoneGap
Matthieu Lux
JavaScript: jQuery, RequireJS, BackboneJS, NodeJS
Java: Spring, Spring Data, Spring MVC, Spring *
Mobility: Android, PhoneGap, jQuery Mobile




twitter @Swiip
www swiip.github.com
github github.com/swiip
Zenika
Un cabinet de conseil et de réalisation et de formation
Technologies Open Source & méthodes agiles
Très forte valorisation technique : UG, partenariats, formations




twitter @ZenikaLyon
www zenika.com
jQuery Mobile & PhoneGap
Create mobile cross-platform applications using the web code you know and
love: HTML, CSS and JavaScript.

Matthieu Lux
Consultant, Zenika
"The" mobile cross-platform application
How to reach it?
jQuery Mobile & PhoneGap
Mobile Application Types




                           8/65
The project
Bootstrap
· Boostraped at the San Francisco
  iPhoneDevCamp in August 2008
· "Make native iphone features available
  to web apps"
· Brock Whitten, Rob Ellis and Andre
  Charland
· October 2008: support of Android and
  BlackBerry
· February 2009: first stable release 0.6
· Support of Windows Mobile, Symbial,
  WebOS, approval for AppStore
· July 2011: relase of version 1.0




                                            9/65
The project
Adobe
· Adobe announced the acquisition of Nitobi Software in October 2011
· PhoneGap code is contributed to the Apache Software Foundation
· PhoneGap and Apache Cordova current versions is 2.1.0

Apache Cordova
· Apache License V2 project
· Currently the same sources than PhoneGap
· You can think of Apache Cordova as the engine that powers PhoneGap

PhoneGap
· PhoneGap is a distribution of Apache Cordova
· Over time, the PhoneGap distribution may contain additional tools




                                                                       10/65
Features
101
· Package Web application in native mobile applications
· Embed static resources (HTML, CSS, JS) in application
· Seriously cross-platform: iOS, Android, Windows Phone, BlackBerry, Bada,
  WebOS, Symbian even Tizen
· JavaScript API to access (all) native features
· Compatible with all Mobile Web Frameworks
· Approved for all major markets including AppStore




                                                                             11/65
Features
Build




           12/65
Features
Compatibilities




                  13/65
Architecture
Generic diagram




                  14/65
Architecture
Android and iOS adaptations




                              15/65
Architecture
Android integration
pbi casCroaeVe etnsWbiw{
 ulc ls odvWbiw xed eVe                     JV
                                             AA
  ..
   .
  piaevi stp){
   rvt od eu(
    ..
     .
    ti.dJvsrpItraenwEpsdsp(lgnaae,jMsaeuu) "croaaie
     hsadaacitnefc(e xoeJAipuiMngr sesgQee, _odvNtv"
  }
  ..
   .
}


· Official Android JavaDoc:
  pbi vi adaacitnefc (betojc,Srn nm)
   ulc od dJvsrpItrae Ojc bet tig ae                                             JV
                                                                                  AA


  Injects the supplied Java object into this WebView. The object is injected into the
  JavaScript context of the main frame, using the supplied name. This allows the
  Java object's public methods to be accessed from JavaScript.




                                                                                    16/65
Packaging
Android application packaging




                                17/65
Packaging
iOS application packaging




                            18/65
Packaging
iOS application packaging




                            19/65
Packaging
PhoneGap Builder




                   20/65
Packaging
PhoneGap Builder Pricing




                           21/65
PhoneGap API
Principles




<cittp=tx/aacit cast"t-"sc"odv-...s>/cit
 srp ye"etjvsrp" hre=uf8 r=croa210j"<srp>   HM
                                             TL


nvgtr{opnn}{cin(sces,{ro};
 aiao.cmoet.ato}{ucs} err)            JVSRP
                                       AACIT




                                             22/65
PhoneGap API
Overview




               23/65
PhoneGap API
Capture API
nvgtrdvc.atr.atrAdo
 aiao.eiecpuecpueui(                    JVSRP
                                         AACIT
   CpueBcpueucs,CpueroC cpuero, [atrAdopin otos
   atrC atrSces atrErrB atrErr  CpueuiOtos pin]
);


nvgtrdvc.atr.atrIae
 aiao.eiecpuecpuemg(                   JVSRP
                                        AACIT
   CpueBcpueucs,CpueroC cpuero,[atrIaepin otos
   atrC atrSces atrErrB atrErr CpuemgOtos pin]
);


nvgtrdvc.atr.atrVdo
 aiao.eiecpuecpueie(                   JVSRP
                                        AACIT
   CpueBcpueucs,CpueroC cpuero,[atrVdopin otos
   atrC atrSces atrErrB atrErr CpueieOtos pin]
);




                                            24/65
PhoneGap API
Documentation
Each methods are documented with
·   Supported platforms
·   Permissions for each platforms
·   Full example
·   Platforms quircks

Example for capture
· http://docs.phonegap.com/en/2.1.0/cordova_media_capture_capture.md.html#Capture




                                                                          25/65
PhoneGap API
Geolocation, Accelerometer
/ Cretpsto
 / urn oiin                            JVSRP
                                        AACIT
nvgtrgooaingturnPsto(ucs,[ro] [pin];
 aiao.elcto.eCretoiinsces err, otos)

/ Wthn psto
 / acig oiin
vrwthD=nvgtrgooainwthoiinsces err {
 a acI   aiao.elcto.acPsto(ucs, ro,
  mxmmg:30,tmot 50,ealHgAcrc:tu
   aiuAe 00 ieu: 00 nbeihcuay re
};
 )
nvgtrgooaincerac(acI)
 aiao.elcto.laWthwthD;

/ Cretaclrto
 / urn ceeain
nvgtraclrmtrgturnAclrto(ucs,err;
 aiao.ceeoee.eCretceeainsces ro)

/ Wthaclrto
 / ac ceeain
vrwthD=nvgtrcmaswthedn(ucs,err {rqec:10)
 a acI   aiao.ops.acHaigsces ro, feuny 0};
nvgtrcmascerac(acI)
 aiao.ops.laWthwthD;




                                             26/65
PhoneGap API
Contacts
/ Rtr anwcnat
 / eun e otc                           JVSRP
                                        AACIT
vrcnat=nvgtrcnat.rae{ipaNm:"atiu,"ae:"u")
 a otc   aiao.otcscet(dslyae Mthe" nm" Lx};

/ Soenwcnati tedvc
 / tr e otc n h eie
cnatsv(;
 otc.ae)

/ Sac fle
 / erh itr
vrotos=nwCnatidpin(;
 a pin    e otcFnOtos)
otosfle ="atiu;
 pin.itr    Mthe"
otosmlil =tu;
 pin.utpe    re
vrfed =[dslyae,"ae,"raiain";
 a ils   "ipaNm" nm" ognztos]

/ Sac
 / erh
nvgtrcnat.idfed,oSces oErr otos;
 aiao.otcsfn(ils nucs, nro, pin)




                                           27/65
PhoneGap API
Storage based on W3C
· Web SQL Storage
         idwoeDtbs(dsbad, 10, dsbad, 000; J V S R P
  vrd =wno.pnaaae"ahor" "." "ahor" 200)
   a b                                     AACIT
  d.rnato(ucint){
   btascinfnto(x
      t.xctSl'RPTBEI EIT dsbad)
       xeeueq(DO AL F XSS ahor';
      t.xctSl'RAETBEI NTEIT dsbad(duiu,dt))
       xeeueq(CET AL F O XSS ahor i nqe aa';
      t.xctSl'NETIT dsbad(d dt)VLE (,"aa))
       xeeueq(ISR NO ahor i, aa AUS 1 tt"';
      t.xctSl'NETIT dsbad(d dt)VLE (,"oo))
       xeeueq(ISR NO ahor i, aa AUS 2 tt"';
  } errB scesB;
   , roC, ucsC)

· Web Storage
  wno.oaSoaesttm"ahor-" "aa)
   idwlcltrg.eIe(dsbad1, tt";               JVSRP
                                            AACIT
  vrvle=wno.oaSoaegttm"ahor-";
   a au  idwlcltrg.eIe(dsbad1)
  wno.oaSoaermvIe(dsbad1)
   idwlcltrg.eoetm"ahor-";
  wno.oaSoaecer)
   idwlcltrg.la(;




                                                 28/65
PhoneGap API
Simulation with Ripple




                         29/65
Plugins
Existings
· https://github.com/phonegap/phonegap-plugins
· A directory by platform
· Android and iOS a LOT more populated
· Interesting examples:
     - AccountList
    -   AugmentedReality
    -   Bluetouth
    -   DatePicker
    -   FileUploader
    -   ScreenShot
    -   ...




                                                 30/65
Plugins
Build one
· Entry point is JavaScript
  croaee(ucinwnaa){,fnto(ro){,"evc"
   odv.xcfnto(iPrm } ucinerr } srie,     JVSRP
                                         AACIT
   "cin,[frtruet,"eodruet,4,fle)
    ato" "isAgmn" scnAgmn" 2 as];

· Example for Android:
  pbi PuiRsl eeueSrn ato,JOAryag,Srn clbcI){ A A
   ulc lgneut xct(tig cin SNra rs tig alakd J V
    ty{
     r
        i (cineul(be"){
         f ato.qas"ep)
           ti.epag.eLn();
            hsbe(rsgtog0)
        }
        rtr nwPuiRsl(lgneutSau.K "eut)
         eun e lgneutPuiRsl.ttsO, rsl";
    }cth(SNxeto e {
       ac JOEcpin )
        rtr nwPuiRsl(lgneutSau.SNECPIN;
         eun e lgneutPuiRsl.ttsJO_XETO)
    }
  }




                                              31/65
Feedback
     · Dev with Android, iOS compatibility at first try
     · Comprehensive API with lots of parameters
     · No surprises with tests

     ·   Memory and performance difficult to apprehend with emulators
     ·   Many specificities by platforms
     ·   Become difficult if not a standard features
     ·   Browser differences




                                                                        32/65
jQuery Mobile & PhoneGap
JavaScript frameworks for the mobile Web

Touch events JavaScript Libraries




Mobile WebApps JavaScript Frameworks




                                           34/65
The project
jQuery Project
· Non-profit trade association dedicated to supporting
  development of jQuery projects
· jQuery, jQuery UI, jQuery Mobile, QUnit, Sizzle
· http://jquery.org

jQuery Mobile
·   Project lead : Todd Parker (Filament Group)
·   Started in 2010
·   Last stable version : 1.2.0 (10/02/12)
·   http://jquerymobile.com
·   http://github.com/jquery/jquery-mobile




                                                         35/65
Features
HTML5-based user interface




                             36/65
Features
Easily themable design




                         37/65
Features
Seriously cross-platform
A-grade
· Full enhanced experience with Ajax-based animated page transitions.
· Large majority of modern OS and browsers

B-grade
· Enhanced experience except without Ajax navigation features
· Blackberry 5.0*, Opera Mini 7, Nokia Symbian^3

C-grade
· Basic, non-enhanced HTML experience that is still functional
· Blackberry 4.x, Windows Mobile, All older smartphone platforms and
  featurephones




                                                                        38/65
Features
Lightweight code


                   jQuery core            31 KB


                   jQuery Mobile CSS      7 KB


                   jQuery Mobile JS       21 KB


                   jQuery Mobile Images   80 KB




                                                  39/65
Guetting started
Download
                         http://jquerymobile.com/download/



· Good old zip (deprecated)
  http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.zip
· CDN Hosted (recomanded)
  < i k r l " t l s e t h e = h t : / o e j u r . o / o i e 1 2 0 j u r . o i e 1 2L m n c s
   l n e = s y e h e " r f " t p / c d . q e y c m m b l / . . / q e y m b l - .M . i . s "
                                                                                H.
                                                                                 T0
  <citsc"tp/cd.qeycmjur-...i.s>
   srp r=ht:/oejur.o/qey182mnj"
  <citsc"tp/cd.qeycmmbl/../qeymbl-...i.s>
   srp r=ht:/oejur.o/oie120jur.oie120mnj"

· Download builder (alpha)
  http://jquerymobile.com/download-builder/




                                                                                 40/65
Guetting started
Basic page
<DCYEhm>
 !OTP tl                                  HM
                                           TL
<tl
 hm>
<ed
 ha>
 <il>yPg<tte
  tteM ae/il>
 <eanm=vepr"cnet"it=eiewdh iiilsae1>
  mt ae"iwot otn=wdhdvc-it, nta-cl="
 <ikrl"tlset he=ht:/oejur.o/oie111jur.oie111mncs
  ln e=syehe" rf"tp/cd.qeycmmbl/../qeymbl-...i.s"
 <citsc"tp/cd.qeycmjur-...i.s>/cit
  srp r=ht:/oejur.o/qey171mnj"<srp>
 <citsc"tp/cd.qeycmmbl/../qeymbl-...i.s>/cit
  srp r=ht:/oejur.o/oie111jur.oie111mnj"<srp>
<ha>
 /ed
<oy
 bd>
 <i dt-oe"ae>
  dv aarl=pg"
   <i dt-oe"edr><1M Tte/1 <dv
   dv aarl=hae" h>y il<h> /i>
   <i dt-oe"otn" <>el wrd/><dv
   dv aarl=cnet> pHlo ol<p /i>
 <dv
  /i>
<bd>
 /oy
<hm>
 /tl




                                           41/65
Guetting started
Result




                   42/65
Pages


· single page
· local internal linked "pages" within a page
·   dialogs
·   animated transitions
·   prefetching and caching pages
·   ajax, hashes & history




                                                43/65
Pages
local internal linked "pages" within a page
<i dt-oe"ae i=fo>
 dv aarl=pg" d"o"                             HM
                                               TL
 <i dt-oe"edr>h>o<dv
  dv aarl=hae"<1Fo/i>
 <i dt-oe"otn"
  dv aarl=cnet>
   <>' frti tesuc odrs Imsona tepg./>
   pIm is n h ore re o ' hw s h ae<p
   <>iwitra pg cle < he=#a"br/>/>
   pVe nenl ae ald a rf"br>a<a<p
 <dv
  /i>
 <i dt-oe"otr>h>aeFoe<h>/i>
  dv aarl=foe"<4Pg otr/4<dv
<dv
 /i>
<i dt-oe"ae i=br>
 dv aarl=pg" d"a"
 <i dt-oe"edr>h>a<h>/i>
  dv aarl=hae"<1Br/1<dv
 <i dt-oe"otn"
  dv aarl=cnet>
   <>' tescn i tesuc odrs Imhde we tepg las<p
   pIm h eod n h ore re o ' idn hn h ae od./>
   <>ahe=#o"Bc t fo/>/>
   p< rf"fo>ak o o<a<p
 <dv
  /i>
 <i dt-oe"otr>h>aeFoe<h>/i>
  dv aarl=foe"<4Pg otr/4<dv
<dv
 /i>




                                               44/65
Pages
dialogs
< he=fohm"dt-e=dao"Oe dao<a
 a rf"o.tl aarl"ilg>pn ilg/>   HM
                                TL




                                45/65
Pages
JavaScript?
· The pageinit event is triggered on a page when it is initialized
  $ dcmn )dlgt(#buPg" "aent,fnto( {
   ( ouet .eeae"aotae, pgii" ucin)               JS
    aet' pg wt a I o "buPg"wsjs cetdb jur Mbl!)
     lr(A ae ih n D f aotae a ut rae y Qey oie';
  };
   )

· If you'd like to manipulate a page's contents before the pageinit event fires
  $ dcmn )dlgt(#buPg" "aeeoerae,fnto( {
   ( ouet .eeae"aotae, pgbfrcet" ucin)            JS
    aet' pg wt a I o "buPg"i aott b cetdb jur Mbl!)
     lr(A ae ih n D f aotae s bu o e rae y Qey oie';
  };
   )


· Changing pages
  $mbl.hneae "bu/shm" {tasto:"ldu" )
   .oiecagPg( aotu.tl,  rniin siep} ;                                             JS


· To load an external page, enhance its content, and insert it into the DOM
  $mbl.odae "bu/shm")
   .oielaPg( aotu.tl ;                                                            JS




                                                                                  46/65
Pages
Transitions
· Setting a transition on a link or form submit
  < he=idxhm"dt-rniin"o"Il pp
   a rf"ne.tl aatasto=pp>'l o                                       HM
                                                                     TL


· Global configuration of transitions
  $dcmn)bn(mblii" fnto({
   (ouet.id"oient, ucin)                                             JS
    $mbl.ealPgTasto ='o'
     .oiedfutaerniin  pp;
  };
   )

· Browser support and performance
    -   All transitions are built with CSS keyframe animations
    -   include both -webkit & -moz rules
    -   default exclusion of browsers that lack 3D transforms
    -   No guarantee that every browser will be 100% flicker-free




                                                                     47/65
Lists


·   basic linked
·   nested
·   numbered
·   read-only lists
·   divider
·   search filter
· ...




                      48/65
Lists
HTML
<ldt-oe"itiw>
 u aarl=lsve"             HM
                           TL
  <i< he=auahm"Aua/>/i
   l>a rf"cr.tl>cr<a<l>
  <i< he=ad.tl>ui/>/i
   l>a rf"uihm"Ad<a<l>
  <i< he=bwhm"BW/>/i
   l>a rf"m.tl>M<a<l>
<u>
 /l




                           49/65
Lists
HTML + image + split button
<i
 l>                                        HM
                                            TL
 < he=idxhm"<m sc"mgsabmb.p"/<3Boe Bls/3<>rknBls/>/
  a rf"ne.tl>ig r=iae/lu-bjg >h>rkn el<h>pBoe el<p<a
 < he=lsssltprhs.tl dt-e=dao"dt-rniin"ldu"Prhs abm
  a rf"it-pi-ucaehm" aarl"ilg aatasto=siep>ucae lu
<l>
 /i
<i
 l>
 < he=idxhm"<m sc"mgsabmh.p"/<3Wrig/3<>o Ci<p<a
  a rf"ne.tl>ig r=iae/lu-cjg >h>ann<h>pHt hp/>/>
 < he=lsssltprhs.tl dt-e=dao"dt-rniin"ldu"Prhs abm
  a rf"it-pi-ucaehm" aarl"ilg aatasto=siep>ucae lu
<l>..
 /i .




                                            50/65
Lists
JavaScript
· Options: countTheme, dividerTheme, filter, filterCallback, filterPlaceHolder,
  filterTheme, headerTheme, inset, splitIcon, splitTheme, theme
· $ dcmn )bn("oient,fnto({
    ( ouet .id mblii" ucin)                                                       JS
         $mbl.itiwpooyeotos<oto >=<vle>
          .oielsve.rttp.pin. pin    au ;
    };
     )


· Methods: childPages, refresh
· $'slco'.itiw'ers';
   (.eetr)lsve(rfeh)                                                              JS


· Events: create
·   $ "slco")lsve(
     ( .eetr .itiw{                                                               JS
       cet:fnto(vn,u){..}
       rae ucineet i   .
    };
     )




                                                                                  51/65
Components

· toolbars: header, footer, navigation
· buttons: icons, inline, grouped
· layout
· forms
    -   text input, text area, search input
    -   flip switch (checkbox)
    -   slider
    -   radio as list
    -   combo box




                                              52/65
Components
Toolbars
· Header
· <i dt-oe"edr>
   dv aarl=hae"                 HM
                                 TL
   < he=idxhm"dt-cn"eee>acl/>
    a rf"ne.tl aaio=dlt"Cne<a
   <1Ei Cnat/1
    h>dt otc<h>
   < he=idxhm"dt-cn"hc"Sv<a
    a rf"ne.tl aaio=cek>ae/>
  <dv
   /i>


· Navbar
· <i dt-oe"otr>
   dv aarl=foe"                 HM
                                 TL
   <i dt-oe"abr><l
    dv aarl=nva" u>
      <i< he=#>n<a<l>
       l>a rf""Oe/>/i
      <i< he=#>w<a<l>
       l>a rf""To/>/i
      <i< he=#>he<a<l>
       l>a rf""Tre/>/i
    <u><dv
     /l /i>
  <dv
   /i>




                                 53/65
Components
Toolbars example




                   54/65
Components
Forms
<omato=# mto=gt>
 fr cin"" ehd"e"                          HM
                                           TL
 <i dt-oe"ilcnan>
  dv aarl=fedoti"
   <ae fr"etra>etra<lbl
   lbl o=txae"Txae:/ae>
   <etracl=4"rw=8 nm=txae"i=txae"<txae>
   txae os"0 os"" ae"etra d"etra>/etra
 <dv
  /i>
 <i dt-oe"ilcnan>
  dv aarl=fedoti"
   <ae fr"erh>erhIpt<lbl
   lbl o=sac"Sac nu:/ae>
   <nu tp=sac"nm=pswr"i=sac"vle" /
   ipt ye"erh ae"asod d"erh au=" >
 <dv
  /i>
 <i dt-oe"ilcnan>
  dv aarl=fedoti"
   <ae fr"ldr"Fi sic:/ae>
   lbl o=sie2>lp wth<lbl
   <eetnm=sie2 i=sie2 dt-oe"ldr>
   slc ae"ldr" d"ldr" aarl=sie"
    <pinvle"f"Of/pin <pinvle"n>n/pin
     oto au=of>f<oto> oto au=o"O<oto>
   <slc>
   /eet
 <dv
  /i>
<fr>
 /om




                                           55/65
Components
Forms Demo




             56/65
Components
Tools




             57/65
Theme framework

·   enhance all default HTML components
·   takes advantage of CSS3 properties
·   multiple color "swatches"
·   theme roller to build your own




                                          58/65
Theme framework
Swatches
· themes include multiple color "swatches"
· each consisting of a header bar, content body, and button states
· can be freely mixed and matched to create visual texture
· each swatches is identified by a letter
· < he=idxhm"dt-oe"utn dt-hm=a>wtha/>
   a rf"ne.tl aarl=bto" aatee""Sac <a                                HM
                                                                      TL




                                                                      59/65
Theme framework
ThemeRoller




                  60/65
PhoneGap
..
 .                                        HM
                                           TL
<ikrl"tlset he=cstee/eal/qeymbl-..i.s"tp=tx/s"/
 ln e=syehe" rf"s/hmsdfutjur.oie10mncs ye"etcs >
<ikrl"tlset he=cstee/eal/utmcs tp=tx/s"/
 ln e=syehe" rf"s/hmsdfutcso.s" ye"etcs >
<cittp=tx/aacit cast"t-"sc"sjur-...i.s>/cit
 srp ye"etjvsrp" hre=uf8 r=j/qey171mnj"<srp>
<cittp=tx/aacit cast"t-"sc"spoea-...s>/cit
 srp ye"etjvsrp" hre=uf8 r=j/hngp181j"<srp>
<cittp=tx/aacit cast"t-"sc"scso-ntj"<srp>
 srp ye"etjvsrp" hre=uf8 r=j/utmii.s>/cit
<cittp=tx/aacit cast"t-"sc"sjur.oie10mnj"<srp>
 srp ye"etjvsrp" hre=uf8 r=j/qeymbl-..i.s>/cit
<cittp=tx/aacit cast"t-"sc"scso.s>/cit
 srp ye"etjvsrp" hre=uf8 r=j/utmj"<srp>
<cittp=tx/aacit cast"t-"
 srp ye"etjvsrp" hre=uf8>
   $dcmn)rayfnto( {
    (ouet.ed(ucin)
      dcmn.dEetitnr'eieed' oDvcRay fle;
      ouetadvnLsee(dvcray, neieed, as)
   };
    )
   fnto oDvcRay){
    ucin neieed(
      $mbl.ntaieae)
      .oieiiilzPg(;
   }
<srp>
 /cit
..
 .




                                           61/65
PhoneGap
JavaScript
· custom-init.js:
  $dcmn)bn(mblii" fnto({
   (ouet.id"oient, ucin)                                  HM
                                                           TL
     / Atrs lsrqee cosdmi
      / uoie e euts rs-oan
     $mbl.loCosoanae =tu;
      .oiealwrsDmiPgs    re
     / Idqeqel Bosrspot l CosOii Rsuc Saig
      / niu u e rwe upre e rs-rgn eore hrn
     $spotcr =tu;
      .upr.os   re
     / Bou liiilsto e lafcaedspgs
      / lqe 'ntaiain t 'fihg e ae,
     / jsualapld $mbl.ntaieae)
      / uq' 'pe e .oieiiilzPg(;
     $mbl.uontaieae=fle
      .oieatIiilzPg    as;
  };
   )


· PhoneGap integration is fully documented
· http://jquerymobile.com/test/docs/pages/phonegap.html




                                                           62/65
Feedback
· Pros
    - Easy to use
    - Quick results
    - Good UI quality
    - Good performances (if done carefully)
    - PhoneGap integration
· Cons
    - Make use of prefetching (data-prefetch)
    - Difficult to think outside the box
    - Security
    - Page loading timeout with Android & Phonegap




                                                     63/65
Thank You!
jQuery Mobile & PhoneGap
1 sur 65

Recommandé

HTML5 and web technology update par
HTML5 and web technology updateHTML5 and web technology update
HTML5 and web technology updateDoug Domeny
1.7K vues22 diapositives
Web Components for Java Developers par
Web Components for Java DevelopersWeb Components for Java Developers
Web Components for Java DevelopersJoonas Lehtinen
31.7K vues93 diapositives
HTML5 par
HTML5HTML5
HTML5Hatem Mahmoud
25.9K vues86 diapositives
Intro to html 5 par
Intro to html 5Intro to html 5
Intro to html 5Ian Jasper Mangampo
2.3K vues50 diapositives
Accelerated Adoption: HTML5 and CSS3 for ASP.NET Developers par
Accelerated Adoption: HTML5 and CSS3 for ASP.NET DevelopersAccelerated Adoption: HTML5 and CSS3 for ASP.NET Developers
Accelerated Adoption: HTML5 and CSS3 for ASP.NET DevelopersTodd Anglin
5.3K vues89 diapositives
Boston Computing Review - Java Server Pages par
Boston Computing Review - Java Server PagesBoston Computing Review - Java Server Pages
Boston Computing Review - Java Server PagesJohn Brunswick
630 vues38 diapositives

Contenu connexe

Tendances

CTS Conference Web 2.0 Tutorial Part 2 par
CTS Conference Web 2.0 Tutorial Part 2CTS Conference Web 2.0 Tutorial Part 2
CTS Conference Web 2.0 Tutorial Part 2Geoffrey Fox
5.9K vues122 diapositives
Vaadin Components @ Angular U par
Vaadin Components @ Angular UVaadin Components @ Angular U
Vaadin Components @ Angular UJoonas Lehtinen
2.1K vues79 diapositives
GWT Introduction and Overview - SV Code Camp 09 par
GWT Introduction and Overview - SV Code Camp 09GWT Introduction and Overview - SV Code Camp 09
GWT Introduction and Overview - SV Code Camp 09Fred Sauer
1.6K vues54 diapositives
Jsp par
JspJsp
JspDSKUMAR G
1.4K vues63 diapositives
Introduction to HTML5 par
Introduction to HTML5Introduction to HTML5
Introduction to HTML5Gil Fink
13.7K vues41 diapositives
Realize mais com HTML 5 e CSS 3 - 16 EDTED - RJ par
Realize mais com HTML 5 e CSS 3 - 16 EDTED - RJRealize mais com HTML 5 e CSS 3 - 16 EDTED - RJ
Realize mais com HTML 5 e CSS 3 - 16 EDTED - RJLeonardo Balter
1.1K vues83 diapositives

Tendances(20)

CTS Conference Web 2.0 Tutorial Part 2 par Geoffrey Fox
CTS Conference Web 2.0 Tutorial Part 2CTS Conference Web 2.0 Tutorial Part 2
CTS Conference Web 2.0 Tutorial Part 2
Geoffrey Fox5.9K vues
GWT Introduction and Overview - SV Code Camp 09 par Fred Sauer
GWT Introduction and Overview - SV Code Camp 09GWT Introduction and Overview - SV Code Camp 09
GWT Introduction and Overview - SV Code Camp 09
Fred Sauer1.6K vues
Introduction to HTML5 par Gil Fink
Introduction to HTML5Introduction to HTML5
Introduction to HTML5
Gil Fink13.7K vues
Realize mais com HTML 5 e CSS 3 - 16 EDTED - RJ par Leonardo Balter
Realize mais com HTML 5 e CSS 3 - 16 EDTED - RJRealize mais com HTML 5 e CSS 3 - 16 EDTED - RJ
Realize mais com HTML 5 e CSS 3 - 16 EDTED - RJ
Leonardo Balter1.1K vues
Oleh Zasadnyy "Progressive Web Apps: line between web and native apps become ... par IT Event
Oleh Zasadnyy "Progressive Web Apps: line between web and native apps become ...Oleh Zasadnyy "Progressive Web Apps: line between web and native apps become ...
Oleh Zasadnyy "Progressive Web Apps: line between web and native apps become ...
IT Event205 vues
jQuery introduction par Tomi Juhola
jQuery introductionjQuery introduction
jQuery introduction
Tomi Juhola32.3K vues
HTML5 for PHP Developers - IPC par Mayflower GmbH
HTML5 for PHP Developers - IPCHTML5 for PHP Developers - IPC
HTML5 for PHP Developers - IPC
Mayflower GmbH52.9K vues
jQuery from the very beginning par Anis Ahmad
jQuery from the very beginningjQuery from the very beginning
jQuery from the very beginning
Anis Ahmad11.8K vues
Keypoints html5 par dynamis
Keypoints html5Keypoints html5
Keypoints html5
dynamis 29.7K vues
Internet Explorer 8 for Developers by Christian Thilmany par Christian Thilmany
Internet Explorer 8 for Developers by Christian ThilmanyInternet Explorer 8 for Developers by Christian Thilmany
Internet Explorer 8 for Developers by Christian Thilmany
Christian Thilmany4.4K vues
OSGi and Spring Data for simple (Web) Application Development - Christian Bar... par mfrancis
OSGi and Spring Data for simple (Web) Application Development - Christian Bar...OSGi and Spring Data for simple (Web) Application Development - Christian Bar...
OSGi and Spring Data for simple (Web) Application Development - Christian Bar...
mfrancis2K vues
Introduction To ASP.NET MVC par Alan Dean
Introduction To ASP.NET MVCIntroduction To ASP.NET MVC
Introduction To ASP.NET MVC
Alan Dean6K vues
The Django Web Application Framework 2 par fishwarter
The Django Web Application Framework 2The Django Web Application Framework 2
The Django Web Application Framework 2
fishwarter7.7K vues

En vedette

Office 365 Project Online - Comprehensive Guide par
Office 365 Project Online - Comprehensive GuideOffice 365 Project Online - Comprehensive Guide
Office 365 Project Online - Comprehensive GuideDavid J Rosenthal
21.2K vues62 diapositives
Skema Bm Kertas2 Set3 par
Skema Bm Kertas2 Set3Skema Bm Kertas2 Set3
Skema Bm Kertas2 Set3Kay Aniza
529 vues9 diapositives
Bm Kertas1 Set1 par
Bm Kertas1 Set1Bm Kertas1 Set1
Bm Kertas1 Set1Kay Aniza
437 vues3 diapositives
Where Humanity Cries par
Where Humanity CriesWhere Humanity Cries
Where Humanity Criesdiretruth
331 vues58 diapositives
A Search For Compassion par
A Search For CompassionA Search For Compassion
A Search For CompassionMichelle
289 vues22 diapositives
Putauaki Primary Inquiry Learning Tackle Box Stages par
Putauaki Primary Inquiry Learning Tackle Box StagesPutauaki Primary Inquiry Learning Tackle Box Stages
Putauaki Primary Inquiry Learning Tackle Box StagesJeanette Murphy
415 vues8 diapositives

En vedette(20)

Office 365 Project Online - Comprehensive Guide par David J Rosenthal
Office 365 Project Online - Comprehensive GuideOffice 365 Project Online - Comprehensive Guide
Office 365 Project Online - Comprehensive Guide
David J Rosenthal21.2K vues
Skema Bm Kertas2 Set3 par Kay Aniza
Skema Bm Kertas2 Set3Skema Bm Kertas2 Set3
Skema Bm Kertas2 Set3
Kay Aniza529 vues
Bm Kertas1 Set1 par Kay Aniza
Bm Kertas1 Set1Bm Kertas1 Set1
Bm Kertas1 Set1
Kay Aniza437 vues
Where Humanity Cries par diretruth
Where Humanity CriesWhere Humanity Cries
Where Humanity Cries
diretruth331 vues
A Search For Compassion par Michelle
A Search For CompassionA Search For Compassion
A Search For Compassion
Michelle 289 vues
Putauaki Primary Inquiry Learning Tackle Box Stages par Jeanette Murphy
Putauaki Primary Inquiry Learning Tackle Box StagesPutauaki Primary Inquiry Learning Tackle Box Stages
Putauaki Primary Inquiry Learning Tackle Box Stages
Jeanette Murphy415 vues
New Networking Skills - Using Social Media par Anthony Rainey
New Networking Skills - Using Social MediaNew Networking Skills - Using Social Media
New Networking Skills - Using Social Media
Anthony Rainey458 vues
Jarrera eta Ikaskuntza Donostia 2011 1. gaia par KirolPsikologia
Jarrera eta Ikaskuntza Donostia 2011 1. gaiaJarrera eta Ikaskuntza Donostia 2011 1. gaia
Jarrera eta Ikaskuntza Donostia 2011 1. gaia
KirolPsikologia650 vues
Amplifying Social Impact in a Connected Age par Margaret Stangl
Amplifying Social Impact in a Connected AgeAmplifying Social Impact in a Connected Age
Amplifying Social Impact in a Connected Age
Margaret Stangl576 vues

Similaire à jQuery Mobile & PhoneGap

Event-driven IO server-side JavaScript environment based on V8 Engine par
Event-driven IO server-side JavaScript environment based on V8 EngineEvent-driven IO server-side JavaScript environment based on V8 Engine
Event-driven IO server-side JavaScript environment based on V8 EngineRicardo Silva
4.1K vues36 diapositives
Platform agnostic information systems development par
Platform agnostic information systems developmentPlatform agnostic information systems development
Platform agnostic information systems developmentMark Jayson Fuentes
1.7K vues47 diapositives
A More Flash Like Web? par
A More Flash Like Web?A More Flash Like Web?
A More Flash Like Web?Murat Can ALPAY
1.3K vues67 diapositives
JS everywhere 2011 par
JS everywhere 2011JS everywhere 2011
JS everywhere 2011Oleg Podsechin
1.5K vues68 diapositives
Nodejs and WebSockets par
Nodejs and WebSocketsNodejs and WebSockets
Nodejs and WebSocketsGonzalo Ayuso
13.5K vues35 diapositives
soft-shake.ch - Hands on Node.js par
soft-shake.ch - Hands on Node.jssoft-shake.ch - Hands on Node.js
soft-shake.ch - Hands on Node.jssoft-shake.ch
2.3K vues35 diapositives

Similaire à jQuery Mobile & PhoneGap(20)

Event-driven IO server-side JavaScript environment based on V8 Engine par Ricardo Silva
Event-driven IO server-side JavaScript environment based on V8 EngineEvent-driven IO server-side JavaScript environment based on V8 Engine
Event-driven IO server-side JavaScript environment based on V8 Engine
Ricardo Silva4.1K vues
soft-shake.ch - Hands on Node.js par soft-shake.ch
soft-shake.ch - Hands on Node.jssoft-shake.ch - Hands on Node.js
soft-shake.ch - Hands on Node.js
soft-shake.ch2.3K vues
HTML5 - Daha Flash bir web? par Ankara JUG
HTML5 - Daha Flash bir web?HTML5 - Daha Flash bir web?
HTML5 - Daha Flash bir web?
Ankara JUG755 vues
Android Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NC par Jim Tochterman
Android Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NCAndroid Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NC
Android Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NC
Jim Tochterman1.6K vues
[245] presto 내부구조 파헤치기 par NAVER D2
[245] presto 내부구조 파헤치기[245] presto 내부구조 파헤치기
[245] presto 내부구조 파헤치기
NAVER D210.1K vues
Improving app performance with Kotlin Coroutines par Hassan Abid
Improving app performance with Kotlin CoroutinesImproving app performance with Kotlin Coroutines
Improving app performance with Kotlin Coroutines
Hassan Abid1.1K vues
Devoxx France: Développement JAVA avec un IDE dans le Cloud: Yes we can ! par Florent BENOIT
Devoxx France: Développement JAVA avec un IDE dans le Cloud: Yes we can !Devoxx France: Développement JAVA avec un IDE dans le Cloud: Yes we can !
Devoxx France: Développement JAVA avec un IDE dans le Cloud: Yes we can !
Florent BENOIT1.2K vues
Øredev2013 - FirefoxOS - the platform HTML5 deserves par Christian Heilmann
Øredev2013 - FirefoxOS - the platform HTML5 deservesØredev2013 - FirefoxOS - the platform HTML5 deserves
Øredev2013 - FirefoxOS - the platform HTML5 deserves
Christian Heilmann6.4K vues
The 2016 Android Developer Toolbox [MOBILIZATION] par Nilhcem
The 2016 Android Developer Toolbox [MOBILIZATION]The 2016 Android Developer Toolbox [MOBILIZATION]
The 2016 Android Developer Toolbox [MOBILIZATION]
Nilhcem883 vues
Cross-platform Native App ontwikkeling met Appcelerator par Fokke Zandbergen
Cross-platform Native App ontwikkeling met AppceleratorCross-platform Native App ontwikkeling met Appcelerator
Cross-platform Native App ontwikkeling met Appcelerator
Fokke Zandbergen339 vues
JEE on DC/OS - MesosCon Europe par QAware GmbH
JEE on DC/OS - MesosCon EuropeJEE on DC/OS - MesosCon Europe
JEE on DC/OS - MesosCon Europe
QAware GmbH690 vues

Dernier

Mini-Track: Challenges to Network Automation Adoption par
Mini-Track: Challenges to Network Automation AdoptionMini-Track: Challenges to Network Automation Adoption
Mini-Track: Challenges to Network Automation AdoptionNetwork Automation Forum
12 vues27 diapositives
Evolving the Network Automation Journey from Python to Platforms par
Evolving the Network Automation Journey from Python to PlatformsEvolving the Network Automation Journey from Python to Platforms
Evolving the Network Automation Journey from Python to PlatformsNetwork Automation Forum
13 vues21 diapositives
Case Study Copenhagen Energy and Business Central.pdf par
Case Study Copenhagen Energy and Business Central.pdfCase Study Copenhagen Energy and Business Central.pdf
Case Study Copenhagen Energy and Business Central.pdfAitana
16 vues3 diapositives
Five Things You SHOULD Know About Postman par
Five Things You SHOULD Know About PostmanFive Things You SHOULD Know About Postman
Five Things You SHOULD Know About PostmanPostman
33 vues43 diapositives
SAP Automation Using Bar Code and FIORI.pdf par
SAP Automation Using Bar Code and FIORI.pdfSAP Automation Using Bar Code and FIORI.pdf
SAP Automation Using Bar Code and FIORI.pdfVirendra Rai, PMP
23 vues38 diapositives
Voice Logger - Telephony Integration Solution at Aegis par
Voice Logger - Telephony Integration Solution at AegisVoice Logger - Telephony Integration Solution at Aegis
Voice Logger - Telephony Integration Solution at AegisNirmal Sharma
39 vues1 diapositive

Dernier(20)

Case Study Copenhagen Energy and Business Central.pdf par Aitana
Case Study Copenhagen Energy and Business Central.pdfCase Study Copenhagen Energy and Business Central.pdf
Case Study Copenhagen Energy and Business Central.pdf
Aitana16 vues
Five Things You SHOULD Know About Postman par Postman
Five Things You SHOULD Know About PostmanFive Things You SHOULD Know About Postman
Five Things You SHOULD Know About Postman
Postman33 vues
Voice Logger - Telephony Integration Solution at Aegis par Nirmal Sharma
Voice Logger - Telephony Integration Solution at AegisVoice Logger - Telephony Integration Solution at Aegis
Voice Logger - Telephony Integration Solution at Aegis
Nirmal Sharma39 vues
PharoJS - Zürich Smalltalk Group Meetup November 2023 par Noury Bouraqadi
PharoJS - Zürich Smalltalk Group Meetup November 2023PharoJS - Zürich Smalltalk Group Meetup November 2023
PharoJS - Zürich Smalltalk Group Meetup November 2023
Noury Bouraqadi127 vues
HTTP headers that make your website go faster - devs.gent November 2023 par Thijs Feryn
HTTP headers that make your website go faster - devs.gent November 2023HTTP headers that make your website go faster - devs.gent November 2023
HTTP headers that make your website go faster - devs.gent November 2023
Thijs Feryn22 vues
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLive par Network Automation Forum
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLiveAutomating a World-Class Technology Conference; Behind the Scenes of CiscoLive
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLive
Serverless computing with Google Cloud (2023-24) par wesley chun
Serverless computing with Google Cloud (2023-24)Serverless computing with Google Cloud (2023-24)
Serverless computing with Google Cloud (2023-24)
wesley chun11 vues
Unit 1_Lecture 2_Physical Design of IoT.pdf par StephenTec
Unit 1_Lecture 2_Physical Design of IoT.pdfUnit 1_Lecture 2_Physical Design of IoT.pdf
Unit 1_Lecture 2_Physical Design of IoT.pdf
StephenTec12 vues
The details of description: Techniques, tips, and tangents on alternative tex... par BookNet Canada
The details of description: Techniques, tips, and tangents on alternative tex...The details of description: Techniques, tips, and tangents on alternative tex...
The details of description: Techniques, tips, and tangents on alternative tex...
BookNet Canada127 vues
Igniting Next Level Productivity with AI-Infused Data Integration Workflows par Safe Software
Igniting Next Level Productivity with AI-Infused Data Integration Workflows Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Safe Software263 vues
Special_edition_innovator_2023.pdf par WillDavies22
Special_edition_innovator_2023.pdfSpecial_edition_innovator_2023.pdf
Special_edition_innovator_2023.pdf
WillDavies2217 vues

jQuery Mobile & PhoneGap

  • 2. Matthieu Lux JavaScript: jQuery, RequireJS, BackboneJS, NodeJS Java: Spring, Spring Data, Spring MVC, Spring * Mobility: Android, PhoneGap, jQuery Mobile twitter @Swiip www swiip.github.com github github.com/swiip
  • 3. Zenika Un cabinet de conseil et de réalisation et de formation Technologies Open Source & méthodes agiles Très forte valorisation technique : UG, partenariats, formations twitter @ZenikaLyon www zenika.com
  • 4. jQuery Mobile & PhoneGap Create mobile cross-platform applications using the web code you know and love: HTML, CSS and JavaScript. Matthieu Lux Consultant, Zenika
  • 9. The project Bootstrap · Boostraped at the San Francisco iPhoneDevCamp in August 2008 · "Make native iphone features available to web apps" · Brock Whitten, Rob Ellis and Andre Charland · October 2008: support of Android and BlackBerry · February 2009: first stable release 0.6 · Support of Windows Mobile, Symbial, WebOS, approval for AppStore · July 2011: relase of version 1.0 9/65
  • 10. The project Adobe · Adobe announced the acquisition of Nitobi Software in October 2011 · PhoneGap code is contributed to the Apache Software Foundation · PhoneGap and Apache Cordova current versions is 2.1.0 Apache Cordova · Apache License V2 project · Currently the same sources than PhoneGap · You can think of Apache Cordova as the engine that powers PhoneGap PhoneGap · PhoneGap is a distribution of Apache Cordova · Over time, the PhoneGap distribution may contain additional tools 10/65
  • 11. Features 101 · Package Web application in native mobile applications · Embed static resources (HTML, CSS, JS) in application · Seriously cross-platform: iOS, Android, Windows Phone, BlackBerry, Bada, WebOS, Symbian even Tizen · JavaScript API to access (all) native features · Compatible with all Mobile Web Frameworks · Approved for all major markets including AppStore 11/65
  • 12. Features Build 12/65
  • 15. Architecture Android and iOS adaptations 15/65
  • 16. Architecture Android integration pbi casCroaeVe etnsWbiw{ ulc ls odvWbiw xed eVe JV AA .. . piaevi stp){ rvt od eu( .. . ti.dJvsrpItraenwEpsdsp(lgnaae,jMsaeuu) "croaaie hsadaacitnefc(e xoeJAipuiMngr sesgQee, _odvNtv" } .. . } · Official Android JavaDoc: pbi vi adaacitnefc (betojc,Srn nm) ulc od dJvsrpItrae Ojc bet tig ae JV AA Injects the supplied Java object into this WebView. The object is injected into the JavaScript context of the main frame, using the supplied name. This allows the Java object's public methods to be accessed from JavaScript. 16/65
  • 22. PhoneGap API Principles <cittp=tx/aacit cast"t-"sc"odv-...s>/cit srp ye"etjvsrp" hre=uf8 r=croa210j"<srp> HM TL nvgtr{opnn}{cin(sces,{ro}; aiao.cmoet.ato}{ucs} err) JVSRP AACIT 22/65
  • 24. PhoneGap API Capture API nvgtrdvc.atr.atrAdo aiao.eiecpuecpueui( JVSRP AACIT CpueBcpueucs,CpueroC cpuero, [atrAdopin otos atrC atrSces atrErrB atrErr CpueuiOtos pin] ); nvgtrdvc.atr.atrIae aiao.eiecpuecpuemg( JVSRP AACIT CpueBcpueucs,CpueroC cpuero,[atrIaepin otos atrC atrSces atrErrB atrErr CpuemgOtos pin] ); nvgtrdvc.atr.atrVdo aiao.eiecpuecpueie( JVSRP AACIT CpueBcpueucs,CpueroC cpuero,[atrVdopin otos atrC atrSces atrErrB atrErr CpueieOtos pin] ); 24/65
  • 25. PhoneGap API Documentation Each methods are documented with · Supported platforms · Permissions for each platforms · Full example · Platforms quircks Example for capture · http://docs.phonegap.com/en/2.1.0/cordova_media_capture_capture.md.html#Capture 25/65
  • 26. PhoneGap API Geolocation, Accelerometer / Cretpsto / urn oiin JVSRP AACIT nvgtrgooaingturnPsto(ucs,[ro] [pin]; aiao.elcto.eCretoiinsces err, otos) / Wthn psto / acig oiin vrwthD=nvgtrgooainwthoiinsces err { a acI aiao.elcto.acPsto(ucs, ro, mxmmg:30,tmot 50,ealHgAcrc:tu aiuAe 00 ieu: 00 nbeihcuay re }; ) nvgtrgooaincerac(acI) aiao.elcto.laWthwthD; / Cretaclrto / urn ceeain nvgtraclrmtrgturnAclrto(ucs,err; aiao.ceeoee.eCretceeainsces ro) / Wthaclrto / ac ceeain vrwthD=nvgtrcmaswthedn(ucs,err {rqec:10) a acI aiao.ops.acHaigsces ro, feuny 0}; nvgtrcmascerac(acI) aiao.ops.laWthwthD; 26/65
  • 27. PhoneGap API Contacts / Rtr anwcnat / eun e otc JVSRP AACIT vrcnat=nvgtrcnat.rae{ipaNm:"atiu,"ae:"u") a otc aiao.otcscet(dslyae Mthe" nm" Lx}; / Soenwcnati tedvc / tr e otc n h eie cnatsv(; otc.ae) / Sac fle / erh itr vrotos=nwCnatidpin(; a pin e otcFnOtos) otosfle ="atiu; pin.itr Mthe" otosmlil =tu; pin.utpe re vrfed =[dslyae,"ae,"raiain"; a ils "ipaNm" nm" ognztos] / Sac / erh nvgtrcnat.idfed,oSces oErr otos; aiao.otcsfn(ils nucs, nro, pin) 27/65
  • 28. PhoneGap API Storage based on W3C · Web SQL Storage idwoeDtbs(dsbad, 10, dsbad, 000; J V S R P vrd =wno.pnaaae"ahor" "." "ahor" 200) a b AACIT d.rnato(ucint){ btascinfnto(x t.xctSl'RPTBEI EIT dsbad) xeeueq(DO AL F XSS ahor'; t.xctSl'RAETBEI NTEIT dsbad(duiu,dt)) xeeueq(CET AL F O XSS ahor i nqe aa'; t.xctSl'NETIT dsbad(d dt)VLE (,"aa)) xeeueq(ISR NO ahor i, aa AUS 1 tt"'; t.xctSl'NETIT dsbad(d dt)VLE (,"oo)) xeeueq(ISR NO ahor i, aa AUS 2 tt"'; } errB scesB; , roC, ucsC) · Web Storage wno.oaSoaesttm"ahor-" "aa) idwlcltrg.eIe(dsbad1, tt"; JVSRP AACIT vrvle=wno.oaSoaegttm"ahor-"; a au idwlcltrg.eIe(dsbad1) wno.oaSoaermvIe(dsbad1) idwlcltrg.eoetm"ahor-"; wno.oaSoaecer) idwlcltrg.la(; 28/65
  • 30. Plugins Existings · https://github.com/phonegap/phonegap-plugins · A directory by platform · Android and iOS a LOT more populated · Interesting examples: - AccountList - AugmentedReality - Bluetouth - DatePicker - FileUploader - ScreenShot - ... 30/65
  • 31. Plugins Build one · Entry point is JavaScript croaee(ucinwnaa){,fnto(ro){,"evc" odv.xcfnto(iPrm } ucinerr } srie, JVSRP AACIT "cin,[frtruet,"eodruet,4,fle) ato" "isAgmn" scnAgmn" 2 as]; · Example for Android: pbi PuiRsl eeueSrn ato,JOAryag,Srn clbcI){ A A ulc lgneut xct(tig cin SNra rs tig alakd J V ty{ r i (cineul(be"){ f ato.qas"ep) ti.epag.eLn(); hsbe(rsgtog0) } rtr nwPuiRsl(lgneutSau.K "eut) eun e lgneutPuiRsl.ttsO, rsl"; }cth(SNxeto e { ac JOEcpin ) rtr nwPuiRsl(lgneutSau.SNECPIN; eun e lgneutPuiRsl.ttsJO_XETO) } } 31/65
  • 32. Feedback · Dev with Android, iOS compatibility at first try · Comprehensive API with lots of parameters · No surprises with tests · Memory and performance difficult to apprehend with emulators · Many specificities by platforms · Become difficult if not a standard features · Browser differences 32/65
  • 34. JavaScript frameworks for the mobile Web Touch events JavaScript Libraries Mobile WebApps JavaScript Frameworks 34/65
  • 35. The project jQuery Project · Non-profit trade association dedicated to supporting development of jQuery projects · jQuery, jQuery UI, jQuery Mobile, QUnit, Sizzle · http://jquery.org jQuery Mobile · Project lead : Todd Parker (Filament Group) · Started in 2010 · Last stable version : 1.2.0 (10/02/12) · http://jquerymobile.com · http://github.com/jquery/jquery-mobile 35/65
  • 38. Features Seriously cross-platform A-grade · Full enhanced experience with Ajax-based animated page transitions. · Large majority of modern OS and browsers B-grade · Enhanced experience except without Ajax navigation features · Blackberry 5.0*, Opera Mini 7, Nokia Symbian^3 C-grade · Basic, non-enhanced HTML experience that is still functional · Blackberry 4.x, Windows Mobile, All older smartphone platforms and featurephones 38/65
  • 39. Features Lightweight code jQuery core 31 KB jQuery Mobile CSS 7 KB jQuery Mobile JS 21 KB jQuery Mobile Images 80 KB 39/65
  • 40. Guetting started Download http://jquerymobile.com/download/ · Good old zip (deprecated) http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.zip · CDN Hosted (recomanded) < i k r l " t l s e t h e = h t : / o e j u r . o / o i e 1 2 0 j u r . o i e 1 2L m n c s l n e = s y e h e " r f " t p / c d . q e y c m m b l / . . / q e y m b l - .M . i . s " H. T0 <citsc"tp/cd.qeycmjur-...i.s> srp r=ht:/oejur.o/qey182mnj" <citsc"tp/cd.qeycmmbl/../qeymbl-...i.s> srp r=ht:/oejur.o/oie120jur.oie120mnj" · Download builder (alpha) http://jquerymobile.com/download-builder/ 40/65
  • 41. Guetting started Basic page <DCYEhm> !OTP tl HM TL <tl hm> <ed ha> <il>yPg<tte tteM ae/il> <eanm=vepr"cnet"it=eiewdh iiilsae1> mt ae"iwot otn=wdhdvc-it, nta-cl=" <ikrl"tlset he=ht:/oejur.o/oie111jur.oie111mncs ln e=syehe" rf"tp/cd.qeycmmbl/../qeymbl-...i.s" <citsc"tp/cd.qeycmjur-...i.s>/cit srp r=ht:/oejur.o/qey171mnj"<srp> <citsc"tp/cd.qeycmmbl/../qeymbl-...i.s>/cit srp r=ht:/oejur.o/oie111jur.oie111mnj"<srp> <ha> /ed <oy bd> <i dt-oe"ae> dv aarl=pg" <i dt-oe"edr><1M Tte/1 <dv dv aarl=hae" h>y il<h> /i> <i dt-oe"otn" <>el wrd/><dv dv aarl=cnet> pHlo ol<p /i> <dv /i> <bd> /oy <hm> /tl 41/65
  • 43. Pages · single page · local internal linked "pages" within a page · dialogs · animated transitions · prefetching and caching pages · ajax, hashes & history 43/65
  • 44. Pages local internal linked "pages" within a page <i dt-oe"ae i=fo> dv aarl=pg" d"o" HM TL <i dt-oe"edr>h>o<dv dv aarl=hae"<1Fo/i> <i dt-oe"otn" dv aarl=cnet> <>' frti tesuc odrs Imsona tepg./> pIm is n h ore re o ' hw s h ae<p <>iwitra pg cle < he=#a"br/>/> pVe nenl ae ald a rf"br>a<a<p <dv /i> <i dt-oe"otr>h>aeFoe<h>/i> dv aarl=foe"<4Pg otr/4<dv <dv /i> <i dt-oe"ae i=br> dv aarl=pg" d"a" <i dt-oe"edr>h>a<h>/i> dv aarl=hae"<1Br/1<dv <i dt-oe"otn" dv aarl=cnet> <>' tescn i tesuc odrs Imhde we tepg las<p pIm h eod n h ore re o ' idn hn h ae od./> <>ahe=#o"Bc t fo/>/> p< rf"fo>ak o o<a<p <dv /i> <i dt-oe"otr>h>aeFoe<h>/i> dv aarl=foe"<4Pg otr/4<dv <dv /i> 44/65
  • 45. Pages dialogs < he=fohm"dt-e=dao"Oe dao<a a rf"o.tl aarl"ilg>pn ilg/> HM TL 45/65
  • 46. Pages JavaScript? · The pageinit event is triggered on a page when it is initialized $ dcmn )dlgt(#buPg" "aent,fnto( { ( ouet .eeae"aotae, pgii" ucin) JS aet' pg wt a I o "buPg"wsjs cetdb jur Mbl!) lr(A ae ih n D f aotae a ut rae y Qey oie'; }; ) · If you'd like to manipulate a page's contents before the pageinit event fires $ dcmn )dlgt(#buPg" "aeeoerae,fnto( { ( ouet .eeae"aotae, pgbfrcet" ucin) JS aet' pg wt a I o "buPg"i aott b cetdb jur Mbl!) lr(A ae ih n D f aotae s bu o e rae y Qey oie'; }; ) · Changing pages $mbl.hneae "bu/shm" {tasto:"ldu" ) .oiecagPg( aotu.tl, rniin siep} ; JS · To load an external page, enhance its content, and insert it into the DOM $mbl.odae "bu/shm") .oielaPg( aotu.tl ; JS 46/65
  • 47. Pages Transitions · Setting a transition on a link or form submit < he=idxhm"dt-rniin"o"Il pp a rf"ne.tl aatasto=pp>'l o HM TL · Global configuration of transitions $dcmn)bn(mblii" fnto({ (ouet.id"oient, ucin) JS $mbl.ealPgTasto ='o' .oiedfutaerniin pp; }; ) · Browser support and performance - All transitions are built with CSS keyframe animations - include both -webkit & -moz rules - default exclusion of browsers that lack 3D transforms - No guarantee that every browser will be 100% flicker-free 47/65
  • 48. Lists · basic linked · nested · numbered · read-only lists · divider · search filter · ... 48/65
  • 49. Lists HTML <ldt-oe"itiw> u aarl=lsve" HM TL <i< he=auahm"Aua/>/i l>a rf"cr.tl>cr<a<l> <i< he=ad.tl>ui/>/i l>a rf"uihm"Ad<a<l> <i< he=bwhm"BW/>/i l>a rf"m.tl>M<a<l> <u> /l 49/65
  • 50. Lists HTML + image + split button <i l> HM TL < he=idxhm"<m sc"mgsabmb.p"/<3Boe Bls/3<>rknBls/>/ a rf"ne.tl>ig r=iae/lu-bjg >h>rkn el<h>pBoe el<p<a < he=lsssltprhs.tl dt-e=dao"dt-rniin"ldu"Prhs abm a rf"it-pi-ucaehm" aarl"ilg aatasto=siep>ucae lu <l> /i <i l> < he=idxhm"<m sc"mgsabmh.p"/<3Wrig/3<>o Ci<p<a a rf"ne.tl>ig r=iae/lu-cjg >h>ann<h>pHt hp/>/> < he=lsssltprhs.tl dt-e=dao"dt-rniin"ldu"Prhs abm a rf"it-pi-ucaehm" aarl"ilg aatasto=siep>ucae lu <l>.. /i . 50/65
  • 51. Lists JavaScript · Options: countTheme, dividerTheme, filter, filterCallback, filterPlaceHolder, filterTheme, headerTheme, inset, splitIcon, splitTheme, theme · $ dcmn )bn("oient,fnto({ ( ouet .id mblii" ucin) JS $mbl.itiwpooyeotos<oto >=<vle> .oielsve.rttp.pin. pin au ; }; ) · Methods: childPages, refresh · $'slco'.itiw'ers'; (.eetr)lsve(rfeh) JS · Events: create · $ "slco")lsve( ( .eetr .itiw{ JS cet:fnto(vn,u){..} rae ucineet i . }; ) 51/65
  • 52. Components · toolbars: header, footer, navigation · buttons: icons, inline, grouped · layout · forms - text input, text area, search input - flip switch (checkbox) - slider - radio as list - combo box 52/65
  • 53. Components Toolbars · Header · <i dt-oe"edr> dv aarl=hae" HM TL < he=idxhm"dt-cn"eee>acl/> a rf"ne.tl aaio=dlt"Cne<a <1Ei Cnat/1 h>dt otc<h> < he=idxhm"dt-cn"hc"Sv<a a rf"ne.tl aaio=cek>ae/> <dv /i> · Navbar · <i dt-oe"otr> dv aarl=foe" HM TL <i dt-oe"abr><l dv aarl=nva" u> <i< he=#>n<a<l> l>a rf""Oe/>/i <i< he=#>w<a<l> l>a rf""To/>/i <i< he=#>he<a<l> l>a rf""Tre/>/i <u><dv /l /i> <dv /i> 53/65
  • 55. Components Forms <omato=# mto=gt> fr cin"" ehd"e" HM TL <i dt-oe"ilcnan> dv aarl=fedoti" <ae fr"etra>etra<lbl lbl o=txae"Txae:/ae> <etracl=4"rw=8 nm=txae"i=txae"<txae> txae os"0 os"" ae"etra d"etra>/etra <dv /i> <i dt-oe"ilcnan> dv aarl=fedoti" <ae fr"erh>erhIpt<lbl lbl o=sac"Sac nu:/ae> <nu tp=sac"nm=pswr"i=sac"vle" / ipt ye"erh ae"asod d"erh au=" > <dv /i> <i dt-oe"ilcnan> dv aarl=fedoti" <ae fr"ldr"Fi sic:/ae> lbl o=sie2>lp wth<lbl <eetnm=sie2 i=sie2 dt-oe"ldr> slc ae"ldr" d"ldr" aarl=sie" <pinvle"f"Of/pin <pinvle"n>n/pin oto au=of>f<oto> oto au=o"O<oto> <slc> /eet <dv /i> <fr> /om 55/65
  • 58. Theme framework · enhance all default HTML components · takes advantage of CSS3 properties · multiple color "swatches" · theme roller to build your own 58/65
  • 59. Theme framework Swatches · themes include multiple color "swatches" · each consisting of a header bar, content body, and button states · can be freely mixed and matched to create visual texture · each swatches is identified by a letter · < he=idxhm"dt-oe"utn dt-hm=a>wtha/> a rf"ne.tl aarl=bto" aatee""Sac <a HM TL 59/65
  • 61. PhoneGap .. . HM TL <ikrl"tlset he=cstee/eal/qeymbl-..i.s"tp=tx/s"/ ln e=syehe" rf"s/hmsdfutjur.oie10mncs ye"etcs > <ikrl"tlset he=cstee/eal/utmcs tp=tx/s"/ ln e=syehe" rf"s/hmsdfutcso.s" ye"etcs > <cittp=tx/aacit cast"t-"sc"sjur-...i.s>/cit srp ye"etjvsrp" hre=uf8 r=j/qey171mnj"<srp> <cittp=tx/aacit cast"t-"sc"spoea-...s>/cit srp ye"etjvsrp" hre=uf8 r=j/hngp181j"<srp> <cittp=tx/aacit cast"t-"sc"scso-ntj"<srp> srp ye"etjvsrp" hre=uf8 r=j/utmii.s>/cit <cittp=tx/aacit cast"t-"sc"sjur.oie10mnj"<srp> srp ye"etjvsrp" hre=uf8 r=j/qeymbl-..i.s>/cit <cittp=tx/aacit cast"t-"sc"scso.s>/cit srp ye"etjvsrp" hre=uf8 r=j/utmj"<srp> <cittp=tx/aacit cast"t-" srp ye"etjvsrp" hre=uf8> $dcmn)rayfnto( { (ouet.ed(ucin) dcmn.dEetitnr'eieed' oDvcRay fle; ouetadvnLsee(dvcray, neieed, as) }; ) fnto oDvcRay){ ucin neieed( $mbl.ntaieae) .oieiiilzPg(; } <srp> /cit .. . 61/65
  • 62. PhoneGap JavaScript · custom-init.js: $dcmn)bn(mblii" fnto({ (ouet.id"oient, ucin) HM TL / Atrs lsrqee cosdmi / uoie e euts rs-oan $mbl.loCosoanae =tu; .oiealwrsDmiPgs re / Idqeqel Bosrspot l CosOii Rsuc Saig / niu u e rwe upre e rs-rgn eore hrn $spotcr =tu; .upr.os re / Bou liiilsto e lafcaedspgs / lqe 'ntaiain t 'fihg e ae, / jsualapld $mbl.ntaieae) / uq' 'pe e .oieiiilzPg(; $mbl.uontaieae=fle .oieatIiilzPg as; }; ) · PhoneGap integration is fully documented · http://jquerymobile.com/test/docs/pages/phonegap.html 62/65
  • 63. Feedback · Pros - Easy to use - Quick results - Good UI quality - Good performances (if done carefully) - PhoneGap integration · Cons - Make use of prefetching (data-prefetch) - Difficult to think outside the box - Security - Page loading timeout with Android & Phonegap 63/65