45
Using Cordova & ionic by Adam Klein

Mobile Apps Using AngularJS - Adam Klein @ AngularJS IL

Embed Size (px)

DESCRIPTION

Lecture

Citation preview

Page 1: Mobile Apps Using AngularJS - Adam Klein @ AngularJS IL

UsingCordova&ionic

byAdamKlein

Page 2: Mobile Apps Using AngularJS - Adam Klein @ AngularJS IL

Askquestionsallthetime

Page 3: Mobile Apps Using AngularJS - Adam Klein @ AngularJS IL

PerformancewasbadFrameworkswerehardtouseandbuggyNocommonlyusedJavascriptframeworkforSinglePageApps

Inotherwords:notechnologicalreadiness

Page 4: Mobile Apps Using AngularJS - Adam Klein @ AngularJS IL

MobilebrowsersarebetterFrameworksarebetterWe'vegotAngularJS&ionic

Page 5: Mobile Apps Using AngularJS - Adam Klein @ AngularJS IL
Page 6: Mobile Apps Using AngularJS - Adam Klein @ AngularJS IL

AdamKleinCo-Founderof

Thirstyfortechnology@500TechIL

Page 7: Mobile Apps Using AngularJS - Adam Klein @ AngularJS IL

Differenttechnologies

Page 8: Mobile Apps Using AngularJS - Adam Klein @ AngularJS IL

HTML5AppsHTML5embeddedinawebview

Page 9: Mobile Apps Using AngularJS - Adam Klein @ AngularJS IL
Page 10: Mobile Apps Using AngularJS - Adam Klein @ AngularJS IL

NormalizedAPIfornativefeatures

ApacheCordovaisaplatformforbuildingnativemobileapplicationsusingHTML,CSSandJavaScript

DOWNLOADCordovaversion3.5.0

AboutApacheCordova™

Page 11: Mobile Apps Using AngularJS - Adam Klein @ AngularJS IL

AboutApacheCordova™

ApacheCordovaisasetofdeviceAPIsthatallowamobileappdevelopertoaccessnativedevicefunctionsuch

asthecameraoraccelerometerfromJavaScript.CombinedwithaUIframeworksuchasjQueryMobileorDojo

MobileorSenchaTouch,thisallowsasmartphoneapptobedevelopedwithjustHTML,CSS,andJavaScript.

WhenusingtheCordovaAPIs,anappcanbebuiltwithoutanynativecode(Java,Objective-C,etc)fromtheapp

developer.Instead,webtechnologiesareused,andtheyarehostedintheappitselflocally(generallynotona

remotehttpserver).

AndbecausetheseJavaScriptAPIsareconsistentacrossmultipledeviceplatformsandbuiltonwebstandards,

theappshouldbeportabletootherdeviceplatformswithminimaltonochanges.

AppsusingCordovaarestillpackagedasappsusingtheplatformSDKs,andcanbemadeavailablefor

installationfromeachdevice'sappstore.

CordovaprovidesasetofuniformJavaScriptlibrariesthatcanbeinvoked,withdevice-specificnativebacking

codeforthoseJavaScriptlibraries.Cordovaisavailableforthefollowingplatforms:iOS,Android,Blackberry,

WindowsPhone,PalmWebOS,Bada,andSymbian.

IfyouwanttouseCordovainyourmobileapplication,takealookatourdocumentation.ItincludesGetting

Startedguides,theJavaScriptAPIsreferenceandexamples,instructionsonUpgradingfrompreviousversions

ofCordova,howtowriteyourownCordovaplugin,andmore.Theselectorinthetop-rightcornerofthe

documentationwillletyoupickdifferentCordovaversionsandlanguagetranslations.Andthereisaregistryof

third-partypluginsthatcanbeusedinyourmobileapplication.

Page 12: Mobile Apps Using AngularJS - Adam Klein @ AngularJS IL

third-partypluginsthatcanbeusedinyourmobileapplication.

ApacheCordovagraduatedinOctober2012asatoplevelprojectwithintheApacheSoftwareFoundation(ASF).

ThroughtheASF,futureCordovadevelopmentwillensureopenstewardshipoftheproject.Itwillalwaysremain

freeandopensourceundertheApacheLicense,Version2.0.

SomeadditionalinformationmaybefoundonourApacheprojectpage.

News Subscribe

13Aug2014»ToolsRelease:August13,2014Anupdatedversionofcordovaandcordova-libareavailablestartingtoday.

[email protected]

[email protected]

Toupdateyourtools:

npminstall-gcordovaThesecontainonlyoneminorfunctionchange,whichisrelatedtotherecentreleaseofCordovaAndroid3.5.1.

Beforetoday’supdate,whenaddingtheAndroidplatformtoaproject,bydefaultitwoulduseversion3.5.0of

CordovaAndroid.Inordertogetthelatest3.5.1ofCordovaAndroid,youwouldneedtomanuallyspecifythe

Page 13: Mobile Apps Using AngularJS - Adam Klein @ AngularJS IL

3.5.1versionnumberontheplatformaddcommand.Today’supdatechangesthedefaultversionofCordova

AndroidusedwhenaddingtheAndroidplatformtoaproject,sothatyounolongerneedtomanuallyspecifythe

3.5.1versionnumbertogetthe3.5.1version.You’llnowget3.5.1bydefault.

ReadMore

11Aug2014»PluginsRelease:August11,2014Thefollowingpluginswereupdatedtoday:

cordova-plugin-battery-status:0.2.10

cordova-plugin-camera:0.3.1

cordova-plugin-console:0.2.10

cordova-plugin-contacts:0.2.12

cordova-plugin-device:0.2.11

cordova-plugin-device-motion:0.2.9

cordova-plugin-device-orientation:0.3.8

cordova-plugin-dialogs:0.2.9

cordova-plugin-file:1.3.0

cordova-plugin-file-transfer:0.4.5

cordova-plugin-geolocation:0.3.9

cordova-plugin-globalization:0.3.0

cordova-plugin-inappbrowser:0.5.1

cordova-plugin-media:0.2.12

cordova-plugin-media-capture:0.3.2

cordova-plugin-network-information:0.2.11

cordova-plugin-splashscreen:0.3.2

cordova-plugin-statusbar:0.1.7

cordova-plugin-vibration:0.3.10

Page 14: Mobile Apps Using AngularJS - Adam Klein @ AngularJS IL

cordova-plugin-vibration:0.3.10

Notablechangesinclude:

Mostofthepluginsdocsarenowtranslatedintootherlanguages.

FirefoxOShasupdatedmanyoftheirproxiesforplugins

FirefoxOSsupportaddedtodevicemotionplugin

ManyupdatestofilepluginforBlackBerry10,FirefoxOSandWindows

BlackBerry10&FirefoxOSsupportaddedtoglobalizationplugin

Thepluginshavebeenupdatedonourregistryatplugins.cordova.io.

Youcanupdateanypluginbyremovingit,andthenreaddingit.E.g.Toupdateyourfileplugin:

cordovapluginrmorg.apache.cordova.filecordovapluginaddorg.apache.cordova.fileOtherchangesinclude:

ReadMore

06Aug2014»ApacheCordovaAndroid3.5.1UpdateOnMonday,wereleasedCordovaAndroid3.5.1,toaddressacoupleofsecurityissues.Afterwards,talkingwith

theoriginalresearchers,werealizedthatthetextofthesecurityannouncementthatwentoutwasn’tquiteright,

sowe’veamendedit.

Youcanreadtheamendedblogposthere.

Page 15: Mobile Apps Using AngularJS - Adam Klein @ AngularJS IL

TheissueinCVE-2014-3502isthatCordovaapplicationswould,bydefault,passanyURLsthattheycouldn’t

loadtotheAndroidintentsystemforhandling.ThisletsdevelopersconstructURLsthatopenemailapplications,

maps,orsendSMSmessages,orevenopenwebpagesinthesystembrowser,butitalsoallowedmalicious

URLsthatcouldpotentiallyopenotherapplicationsonthedevice.Thismeantthatifsomeonecouldexecutetheir

ownJavaScriptinyourapplication,thattheycoulduseotherapplicationsonthedeviceto“phonehome”withthe

user’sdata.ThisiswhywearerecommendingthatallAndroiddevelopersupgradetoCordova3.5.1.

ReadMore

Seeallentries

WanttoContribute?

Contributorsarewelcome!Andweneedyourcontributionstokeeptheprojectmovingforward.Youcanreport

bugs,improvethedocumentation,orcontributecode.

Thereisaspecificcontributorworkflowwerecommend.Startreadingthere.Moreinformationisavailableonour

wiki.

Page 16: Mobile Apps Using AngularJS - Adam Klein @ AngularJS IL

TheJIRAissuetrackerandthedevmailinglistaregoodplacestoidentifyareastohelpoutin.

Searchtheissuetracker: SearchQuery Search

Toshareyourcontributionswiththecommunity,youcansendapullrequestonGitHubtotheApachegit

mirrors.Youcanalsoadvocateforyourchangesdirectlyonourdevelopermailinglist.

Inorderforyourchangestobeaccepted,youneedtosignandsubmitanApacheICLA(IndividualContributor

LicenseAgreement).ThenyournamewillappearonthelistofCLAssignedbynon-committersorCordova

committers.

Anddon'tforgettotestanddocumentyourcode.

EachcomponentofApacheCordovaisinaseparategitrepository:

Platforms

AmazonFireOS

Android

Bada

Blackberry

FirefoxOS

Other

CordovaDocs

CordovaJS(JavaScriptAPI)

CordovaCLI

CordovaPlugman(PluginManager)

CordovaLib(CommonCode)

Page 17: Mobile Apps Using AngularJS - Adam Klein @ AngularJS IL

Plugins

FirefoxOS

iOS

MacOSX

Qt

Tizen

Ubuntu

WebOS

Windows(desktop)

WindowsPhone7

WindowsPhone8

Browser

BatteryStatus

Camera

Console

CordovaLib(CommonCode)

CordovaMobileSpec(TestSuite)

CordovaMedic(TestAutomation)

Weinre(WebInspectorRemote)

CordovaAppHarness

CordovaHelloWorld(SampleApp)

CordovaCoho(ReleaseTool)

CordovaRegistryWeb(PluginRegistryUI)

CordovaRegistry(PluginRegistryApp)

CordovaLabs(ExperimentalContent)

Page 18: Mobile Apps Using AngularJS - Adam Klein @ AngularJS IL

Contacts

Device

DeviceMotion

DeviceOrientation

Dialogs

File

FileTransfer

Geolocation

Globalization

In-AppBrowser

Media

MediaCapture

NetworkInformation

Splashscreen

Statusbar

Page 19: Mobile Apps Using AngularJS - Adam Klein @ AngularJS IL

Statusbar

Vibration

MailingList

DevMailingListDevmailinglistisaplacefordiscussionaboutdevelopingApacheCordova.

IfyouareaCordovauserlookingforhelp,usethecordovatagonStackOverflow.

Writingtothelist [email protected]

Subscriptionaddress [email protected]

Digestsubscriptionaddress [email protected]

Unsubscriptionaddresses [email protected]

Gettinghelpwiththelist [email protected]

Browseonline

Page 20: Mobile Apps Using AngularJS - Adam Klein @ AngularJS IL

CommitsMailingListCommitsmailinglisttrackscommitlogsforApacheCordovarepos.

Writingtothelist [email protected]

Subscriptionaddress [email protected]

Digestsubscriptionaddress [email protected]

Unsubscriptionaddresses [email protected]

Gettinghelpwiththelist [email protected]

Browseonline

IssuesMailingListIssuesmailinglisttrackscommentsandupdatestoJiraitemsregardingApacheCordova.

Writingtothelist [email protected]

Subscriptionaddress [email protected]

Digestsubscriptionaddress [email protected]

Unsubscriptionaddresses [email protected]

Gettinghelpwiththelist [email protected]

Browseonline

Page 21: Mobile Apps Using AngularJS - Adam Klein @ AngularJS IL

Download&Archives

ItisrecommendedthatthecordovaCLIbeinstalledfromnpmratherthandownloadingthis.zipversion.For

moreinformationoninstallingthenpmversionseetheCommand-LineInterfacesectionofthedocumentation.

YoucanfindourreleasezipswithcorrespondingOpenPGPkeys,MD5andSHAfilesontheApacheCordovadist

page.

Ourartworkisalsoavailable.

Olderversionscanbedownloadedfromthearchive.

Page 22: Mobile Apps Using AngularJS - Adam Klein @ AngularJS IL

QuickLinks

General Development ApacheSoftwareFoundation

AboutCordova

ApacheProjectPage

License

Artwork

Download

Documentation

SourceCode

IssueTracker

Wiki

MailingList

Support

AboutASF

Thanks

BecomeaSponsor

Security

Page 23: Mobile Apps Using AngularJS - Adam Klein @ AngularJS IL

Copyright©2012,2013TheApacheSoftwareFoundation,LicensedundertheApacheLicense,Version2.0.ApacheandtheApachefeatherlogosaretrademarksofTheApacheSoftwareFoundation.

Page 24: Mobile Apps Using AngularJS - Adam Klein @ AngularJS IL

Easilycreateappsusingthewebtechnologiesyouknowandlove:HTML,CSS,

andJavaScriptPhoneGapisafreeandopensourceframeworkthatallowsyoutocreatemobileappsusingstandardizedwebAPIsfortheplatforms

youcareabout.

►►InstallPhoneGapInstallPhoneGap ►►GettingStartedGuidesGettingStartedGuides

WatchIntro

Page 25: Mobile Apps Using AngularJS - Adam Klein @ AngularJS IL

Trigger.iO

Page 26: Mobile Apps Using AngularJS - Adam Klein @ AngularJS IL

MostcommonlyusedGreatforSinglePageAppsPerformance

Page 27: Mobile Apps Using AngularJS - Adam Klein @ AngularJS IL
Page 28: Mobile Apps Using AngularJS - Adam Klein @ AngularJS IL
Page 29: Mobile Apps Using AngularJS - Adam Klein @ AngularJS IL
Page 30: Mobile Apps Using AngularJS - Adam Klein @ AngularJS IL

CommonUIcontrolsNavigationViewsTabsSidemenusOvercomebrowserquirks

Page 31: Mobile Apps Using AngularJS - Adam Klein @ AngularJS IL

CSSFrameworknotmobilefirst,mobileonly

Automaticallyrecognize"grade"

Page 32: Mobile Apps Using AngularJS - Adam Klein @ AngularJS IL

refresherdeleteswipe

reorder

<ion-refresher

pulling-text="Pulltorefresh..."

on-refresh="refresh()">

</ion-refresher>

Page 33: Mobile Apps Using AngularJS - Adam Klein @ AngularJS IL
Page 34: Mobile Apps Using AngularJS - Adam Klein @ AngularJS IL

SmoothtransitionsEachtabhasit'sownnavigationhistory

Androidbackbuttonsupport

Page 35: Mobile Apps Using AngularJS - Adam Klein @ AngularJS IL

CustomanimationsAndroidbackbuttonsupport

Page 36: Mobile Apps Using AngularJS - Adam Klein @ AngularJS IL

PreventhidingelementsCallbacksonkeyboardopen/close

Page 37: Mobile Apps Using AngularJS - Adam Klein @ AngularJS IL

300msdelayNormalizedbehaviour

Page 38: Mobile Apps Using AngularJS - Adam Klein @ AngularJS IL
Page 39: Mobile Apps Using AngularJS - Adam Klein @ AngularJS IL

ItlooksawesomeItmovesawesome

It'seasytouseIt'sbasedonAngularJS

Page 40: Mobile Apps Using AngularJS - Adam Klein @ AngularJS IL

DriftyCo.BenSperry&MaxLynch

Startedat2012Raised$1Million

Page 41: Mobile Apps Using AngularJS - Adam Klein @ AngularJS IL
Page 42: Mobile Apps Using AngularJS - Adam Klein @ AngularJS IL
Page 43: Mobile Apps Using AngularJS - Adam Klein @ AngularJS IL

It'snew(v1.0.0-beta8)TherewillbebugsMissingfeaturesChangeAPINotmuchstackoverflow

Page 44: Mobile Apps Using AngularJS - Adam Klein @ AngularJS IL

AreyoudevelopingAny.DO'scompetitor?AreyoudevelopingananimatedGame?CheckHTML5'slimitations(backgroundtasks,customvideocontrol,etc.)CheckiOsguidelines

Page 45: Mobile Apps Using AngularJS - Adam Klein @ AngularJS IL

[email protected]@500TechIL500tech.comhackademy.co.ilangular.co.il