SlideShare ist ein Scribd-Unternehmen logo
1 von 31
Downloaden Sie, um offline zu lesen
1   © 2011 Hewlett-Packard Development Company, L.P.
Enyo: A JS Framework for
                    Mobile Devices

Ben Combee
Sr. Developer Relations Engineer
Frameworks Team, Palm GBU




2   © 2011 Hewlett-Packard Development Company, L.P.
3   © 2011 Hewlett-Packard Development Company, L.P.   Confidential
HP webOS Architecture

                                                             webOS Service Bus

                                                                                                    JS Service
        Web App                                        “Hybrid” App                  Compiled App
                                                                                                                  Built-in
                                                                                                     Node.js     webOS
                                                                                                     Service     Services
          Web App Runtime                                                Compiled App
                                                                                                     Runtime
           (WebKit + v8)                                                   Runtime


                                             UI System Manager                                       Activity Manager


                                                       Low-level OS Components (Linux)



4   © 2011 Hewlett-Packard Development Company, L.P.                  Confidential
Enyo Begins with Ares




5   © 2011 Hewlett-Packard Development Company, L.P.
Enyo Applications




6   © 2011 Hewlett-Packard Development Company, L.P.
                                                       6
Anatomy of an Enyo App




7   © 2011 Hewlett-Packard Development Company, L.P.
                                                       7
Anatomy of a Enyo Application
– appinfo.json
    •   Standard webOS application metadata, not needed for use in browser

– index.html
    •   Initial page loaded by system manager, pulls in enyo framework and creates app
        object

– depends.js
    •   Loaded by enyo.js, JS code to declare what other files are needed for your app

– app.js
    •   Main application object

– app.css
    •   Any styles needed specifically for your application




8   © 2011 Hewlett-Packard Development Company, L.P.   Confidential
appinfo.json
{ "id": "com.palmdts.enyo.helloworld“,
   "version": "1.0.0",
   "vendor": "HP“,
   "type": "web“,
   "main": "index.html“,
   "title": "Enyo HelloWorld“,
   "icon": "icon.png“,
   "uiRevision": 2 }
– “main” could direct to a different HTML file
– Lots more options documented on developer.palm.com




9   © 2011 Hewlett-Packard Development Company, L.P.   Confidential
depends.js
enyo.depends(
 "HelloWorld.js",
 "HelloWorld.css",
 "app/");


– Supports loading both individual JS and CSS files as well as pointing
  to directories that have their own depends.js file.
– Strings support expansion of $enyo variable to refer to root of
  framework tree for loading extension modules or themes.




10   © 2011 Hewlett-Packard Development Company, L.P.   Confidential
index.html
<!doctype html>
 <html><head>
   <title>enyo HelloWorld</title>
   <script src="../../../framework/enyo.js”></script>
 </head>
 <body>
   <script type="text/javascript">
     new enyo.Canon.HelloWorld().
       renderInto(document.body);
   </script>
 </body></html>
– Can add launch=“debug” to <script> tag to load all framework source




11   © 2011 Hewlett-Packard Development Company, L.P.   Confidential
app.js
enyo.kind({
   name: "enyo.Canon.HelloWorld",
   kind: enyo.Control,
   content: "Hello World!"});
– Very simple example, this app is just a <div> with “Hello, World!” as its
  content
– Key idea is that your app is a enyo.kind and other code renders it into
  the page
– First kind to be rendered has special powers with handling application-
  level events




12   © 2011 Hewlett-Packard Development Company, L.P.   Confidential
The Philosophy of Enyo




13   © 2011 Hewlett-Packard Development Company, L.P.
Applications Are the Target




14   © 2011 Hewlett-Packard Development Company, L.P.
Code Reuse Through Components




                                                        http://www.flickr.com/photos/hugosimmelink/1506521934
15   © 2011 Hewlett-Packard Development Company, L.P.
Kinds and Inheritance
– Each kind has a parent kind
– When overridding a method from parent, can call
  this.inherited(arguments) to call parent’s implementation
– enyo.Object is base of the tree
– Implements a property system to allow setting object values on
  instantiation with setPROP/getPROP/PROPchanged methods
– enyo.Component is base of all items that go into app tree
– Components can own a nested collection of objects
– Components have a “$” hash of all owned objects by name, e.g.
  this.$.button.setEnabled(true)




16   © 2011 Hewlett-Packard Development Company, L.P.   Confidential
Support Flexible Layouts




     HFlexBox                                           VFlexBox                  Absolute   Nested



17   © 2011 Hewlett-Packard Development Company, L.P.              Confidential
Favor Code Generation and Layout Tools




                                                        http://www.geograph.org.uk/photo/76980
18   © 2011 Hewlett-Packard Development Company, L.P.
Example of Application Structure
components: [
  {kind: "AppMenu", components: [
    {caption: "Show on One Page", onclick: "showOnePage"}]},
    {kind: "VFlexBox", width: "320px",
     style: "border-right: 1px solid gray;",
        components: [
          {kind: "RadioGroup", style: "padding: 10px;",
           onChange: "radioGroupChange", components: [
             {caption: "Packages", flex: 1},
             {caption: "Index", flex: 1} ]},
          {kind: "Pane", flex: 1, onclick: "tocClick",
           className: "selectable",
           domAttributes: {"enyo-pass-events": true},
……




19   © 2011 Hewlett-Packard Development Company, L.P.   Confidential
Prefer JavaScript Over HTML




{ “js” } > <html>

20   © 2011 Hewlett-Packard Development Company, L.P.
JS Will Get Faster Quicker Than WebKit




                                                        >

21   © 2011 Hewlett-Packard Development Company, L.P.
Cache DOM in Local JavaScript Objects




22   © 2011 Hewlett-Packard Development Company, L.P.
Support Device and Desktop




23   © 2011 Hewlett-Packard Development Company, L.P.
Support webOS Special Features
– Wrappers for Palm System Services
– Support for talking to application-provided node.js services
– Mocking of Palm services for desktop development/testing
– Notifications using dashboard
– Multiple card/window management
– IFRAME-based cross-app launching
– OBJECT-based hybrid applications




24   © 2011 Hewlett-Packard Development Company, L.P.   Confidential
Enyo as a Platform




25   © 2011 Hewlett-Packard Development Company, L.P.
                                                              25
The Enyo API
      enyo.ActivityButton enyo.AjaxContent enyo.AlphaDivider enyo.AnimatedImage enyo.Animator enyo.AppMenu
                 enyo.AppMenuItem enyo.BasicCarousel enyo.BasicDrawer enyo.BasicInput enyo.BasicRichText
            enyo.BasicScroller enyo.BasicService enyo.BasicWebView enyo.Box enyo.Button enyo.ButtonHeader
          enyo.Carousel enyo.CarouselInternal enyo.CheckBox enyo.Component enyo.ConfirmPrompt enyo.Control
         enyo.CroppableImage enyo.CrossAppResult enyo.CrossAppUI enyo.CustomButton enyo.CustomListSelector
       enyo.Dashboard enyo.DatePicker enyo.DbList enyo.DbRepeaterList enyo.DbService enyo.DbService.Request
        enyo.Dialog enyo.DialogPrompt enyo.dispatcher enyo.Divider enyo.DividerDrawer enyo.dom enyo.DomNode
              enyo.DomNodeBuilder enyo.Drag enyo.DragScroller enyo.Drawer enyo.EditMenu enyo.FadeScroller
          enyo.FilePicker enyo.FlexLayout enyo.FloatingHeader enyo.Flyweight enyo.g11n.FmtStyles.prototype
                 enyo.g11n.GeoLocator.prototype enyo.g11n.NameFmt.prototype enyo.g11n.PhoneFmt.prototype
          enyo.g11n.PhoneNumber.prototype enyo.g11n.TzFmt.prototype enyo.gesture enyo.GrabButton enyo.Grid
       enyo.Group enyo.GroupedToolButton enyo.HBox enyo.Header enyo.HelpMenu enyo.HFlexBox enyo.HFlexLayout
           enyo.HLayout enyo.HtmlContent enyo.Hybrid enyo.IconButton enyo.Iframe enyo.Image enyo.ImageView
        enyo.Input enyo.InputBox enyo.IntegerPicker enyo.Item enyo.json enyo.keyboard enyo.LabeledContainer
       enyo.LazyControl enyo.ListSelector enyo.ManagedDomBuilder enyo.Menu enyo.MenuCheckItem enyo.MenuItem
               enyo.MockService enyo.NotificationButton enyo.Object enyo.OrderedContainer enyo.PageHeader
              enyo.PalmService enyo.palmServices enyo.Pane enyo.PaneLayout enyo.PasswordInput enyo.Picker
         enyo.PickerButton enyo.PickerGroup enyo.Popup enyo.PopupList enyo.PopupSelect enyo.PrevNextBanner
              enyo.Progress enyo.ProgressBar enyo.ProgressBarItem enyo.ProgressButton enyo.ProgressSlider
            enyo.Pushable enyo.RadioButton enyo.RadioGroup enyo.RadioToolButton enyo.RadioToolButtonGroup
                enyo.Repeater enyo.Request enyo.RichText enyo.RoundedBox enyo.RoundedInput enyo.RowGroup
                     enyo.RowItem enyo.Scrim enyo.ScrimmedConfirmPrompt enyo.Scroller enyo.ScrollFades
                   enyo.ScrollingImage enyo.ScrollStrategy enyo.SearchInput enyo.Selection enyo.Service
                   enyo.SizeableCanvas enyo.SizeableImage enyo.Slider enyo.SlidingPane enyo.SlidingView
         enyo.SnapScroller enyo.Sound enyo.Spacer enyo.Spinner enyo.SpinnerLarge enyo.Stateful enyo.string
                  enyo.SwipeableItem enyo.SystemService enyo.TabButton enyo.TabGroup enyo.TempDbService
             enyo.TimePicker enyo.Toaster enyo.ToggleButton enyo.Toolbar enyo.ToolButton enyo.ToolButton2
               enyo.ToolButtonGroup enyo.ToolInput enyo.transitions.Fade enyo.transitions.LeftRightFlyin
               enyo.transitions.Simple enyo.VBox enyo.VFlexBox enyo.VFlexLayout enyo.Video enyo.ViewImage
       enyo.VirtualCarousel enyo.VirtualList enyo.VirtualRepeater enyo.WebService enyo.WebView enyo.windows



26   © 2011 Hewlett-Packard Development Company, L.P.   Confidential
Big Groups of APIs
– Language Extensions
– OOP and Component System
– DOM Management
– Input Controls
– Containers
– Lists and Repeaters
– Services
– Globalization (G11N)
– webOS Platform Support

27   © 2011 Hewlett-Packard Development Company, L.P.   Confidential
DEMOS

28   © 2011 Hewlett-Packard Development Company, L.P.
29   © 2011 Hewlett-Packard Development Company, L.P.
developer.palm.com
                      pdc@palm.com


30   © 2011 Hewlett-Packard Development Company, L.P.
31   © 2011 Hewlett-Packard Development Company, L.P.

Weitere ähnliche Inhalte

Was ist angesagt?

Develop mobile applications with Flex
Develop mobile applications with FlexDevelop mobile applications with Flex
Develop mobile applications with FlexConFoo
 
Adobe Flash platform の法人利用
Adobe Flash platform の法人利用Adobe Flash platform の法人利用
Adobe Flash platform の法人利用Keisuke Todoroki
 
Creating Mobile Content Using Flash
Creating Mobile Content Using FlashCreating Mobile Content Using Flash
Creating Mobile Content Using Flashpaultrani
 
Titanium Studio [Updated - 18/12/2011]
Titanium Studio [Updated - 18/12/2011]Titanium Studio [Updated - 18/12/2011]
Titanium Studio [Updated - 18/12/2011]Sentinel Solutions Ltd
 
Bring Your Android Apps to BlackBerry 10 in minutes
Bring Your Android Apps to BlackBerry 10 in minutesBring Your Android Apps to BlackBerry 10 in minutes
Bring Your Android Apps to BlackBerry 10 in minutesDr. Ranbijay Kumar
 
Feed Herny developer training : crossplatform and HTML5
Feed Herny developer training : crossplatform and  HTML5Feed Herny developer training : crossplatform and  HTML5
Feed Herny developer training : crossplatform and HTML5Mobile Monday Brussels
 
Adobe AIR Mobile development for Android and PlayBook
Adobe AIR Mobile development for Android and PlayBookAdobe AIR Mobile development for Android and PlayBook
Adobe AIR Mobile development for Android and PlayBookMihai Corlan
 
Xamarin COE by Mukteswar Patnaik
Xamarin COE by Mukteswar PatnaikXamarin COE by Mukteswar Patnaik
Xamarin COE by Mukteswar PatnaikMukteswar Patnaik
 
Getting started with PhoneGap
Getting started with PhoneGapGetting started with PhoneGap
Getting started with PhoneGapMihai Corlan
 
Christopher Allen's Presentation at eComm 2009
Christopher Allen's Presentation at eComm 2009Christopher Allen's Presentation at eComm 2009
Christopher Allen's Presentation at eComm 2009eCommConf
 
Social Enabler for XPages
Social Enabler for XPagesSocial Enabler for XPages
Social Enabler for XPagesNiklas Heidloff
 
Building Mobile Web Apps using ASP.NET MVC, HTML5, & jQuery Mobile
Building Mobile Web Apps using ASP.NET MVC, HTML5, & jQuery MobileBuilding Mobile Web Apps using ASP.NET MVC, HTML5, & jQuery Mobile
Building Mobile Web Apps using ASP.NET MVC, HTML5, & jQuery MobileJon Cortez
 
Keynote Client Connectivity And The Cloud
Keynote Client Connectivity And The CloudKeynote Client Connectivity And The Cloud
Keynote Client Connectivity And The CloudGoogleTecTalks
 
Introduction to j query mobile framework
Introduction to j query mobile frameworkIntroduction to j query mobile framework
Introduction to j query mobile frameworkShreerang Patwardhan
 
Building apps for multiple devices
Building apps for multiple devicesBuilding apps for multiple devices
Building apps for multiple devicesTerry Ryan
 

Was ist angesagt? (20)

Develop mobile applications with Flex
Develop mobile applications with FlexDevelop mobile applications with Flex
Develop mobile applications with Flex
 
Adobe Flash platform の法人利用
Adobe Flash platform の法人利用Adobe Flash platform の法人利用
Adobe Flash platform の法人利用
 
Creating Mobile Content Using Flash
Creating Mobile Content Using FlashCreating Mobile Content Using Flash
Creating Mobile Content Using Flash
 
Titanium Studio [Updated - 18/12/2011]
Titanium Studio [Updated - 18/12/2011]Titanium Studio [Updated - 18/12/2011]
Titanium Studio [Updated - 18/12/2011]
 
Bring Your Android Apps to BlackBerry 10 in minutes
Bring Your Android Apps to BlackBerry 10 in minutesBring Your Android Apps to BlackBerry 10 in minutes
Bring Your Android Apps to BlackBerry 10 in minutes
 
Portlet factory 101
Portlet factory 101Portlet factory 101
Portlet factory 101
 
Feed Herny developer training : crossplatform and HTML5
Feed Herny developer training : crossplatform and  HTML5Feed Herny developer training : crossplatform and  HTML5
Feed Herny developer training : crossplatform and HTML5
 
Adobe AIR Mobile development for Android and PlayBook
Adobe AIR Mobile development for Android and PlayBookAdobe AIR Mobile development for Android and PlayBook
Adobe AIR Mobile development for Android and PlayBook
 
Xamarin COE by Mukteswar Patnaik
Xamarin COE by Mukteswar PatnaikXamarin COE by Mukteswar Patnaik
Xamarin COE by Mukteswar Patnaik
 
Getting started with PhoneGap
Getting started with PhoneGapGetting started with PhoneGap
Getting started with PhoneGap
 
Web works presso
Web works pressoWeb works presso
Web works presso
 
Android programming basics
Android programming basicsAndroid programming basics
Android programming basics
 
Android Deep Dive
Android Deep DiveAndroid Deep Dive
Android Deep Dive
 
Christopher Allen's Presentation at eComm 2009
Christopher Allen's Presentation at eComm 2009Christopher Allen's Presentation at eComm 2009
Christopher Allen's Presentation at eComm 2009
 
Social Enabler for XPages
Social Enabler for XPagesSocial Enabler for XPages
Social Enabler for XPages
 
Frontend. Global domination.
Frontend. Global domination.Frontend. Global domination.
Frontend. Global domination.
 
Building Mobile Web Apps using ASP.NET MVC, HTML5, & jQuery Mobile
Building Mobile Web Apps using ASP.NET MVC, HTML5, & jQuery MobileBuilding Mobile Web Apps using ASP.NET MVC, HTML5, & jQuery Mobile
Building Mobile Web Apps using ASP.NET MVC, HTML5, & jQuery Mobile
 
Keynote Client Connectivity And The Cloud
Keynote Client Connectivity And The CloudKeynote Client Connectivity And The Cloud
Keynote Client Connectivity And The Cloud
 
Introduction to j query mobile framework
Introduction to j query mobile frameworkIntroduction to j query mobile framework
Introduction to j query mobile framework
 
Building apps for multiple devices
Building apps for multiple devicesBuilding apps for multiple devices
Building apps for multiple devices
 

Ähnlich wie JS for Mobile: The Enyo Framework (jsconf.us 2011)

Native App + Wep App = ? (Hybrid Applications)
Native App + Wep App = ? (Hybrid Applications)Native App + Wep App = ? (Hybrid Applications)
Native App + Wep App = ? (Hybrid Applications)GameWisp
 
JQuery Mobile vs Appcelerator Titanium vs Sencha Touch
JQuery Mobile vs Appcelerator Titanium vs Sencha TouchJQuery Mobile vs Appcelerator Titanium vs Sencha Touch
JQuery Mobile vs Appcelerator Titanium vs Sencha TouchSteve Drucker
 
Hybrid Mobile Apps - Meetup
Hybrid Mobile Apps - MeetupHybrid Mobile Apps - Meetup
Hybrid Mobile Apps - MeetupSanjay Patel
 
Worklight technical intro v2
Worklight technical intro v2Worklight technical intro v2
Worklight technical intro v2Vinh Nguyen
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to androidjavalabsf
 
White paper native, web or hybrid mobile app development
White paper  native, web or hybrid mobile app developmentWhite paper  native, web or hybrid mobile app development
White paper native, web or hybrid mobile app developmentIBM Software India
 
Flex 4.5 and mobile development
Flex 4.5 and mobile developmentFlex 4.5 and mobile development
Flex 4.5 and mobile developmentMichael Chaize
 
Hybrid App Development with PhoneGap
Hybrid App Development with PhoneGapHybrid App Development with PhoneGap
Hybrid App Development with PhoneGapDotitude
 
OWIN (Open Web Interface for .NET)
OWIN (Open Web Interface for .NET)OWIN (Open Web Interface for .NET)
OWIN (Open Web Interface for .NET)Folio3 Software
 
Front-end. Global domination
Front-end. Global dominationFront-end. Global domination
Front-end. Global dominationStfalcon Meetups
 
Getting Acquainted with PhoneGap
Getting Acquainted with PhoneGapGetting Acquainted with PhoneGap
Getting Acquainted with PhoneGapJoseph Labrecque
 
Introduction phonegap
Introduction phonegapIntroduction phonegap
Introduction phonegapRakesh Jha
 
Advanced programing in phonegap
Advanced programing in phonegapAdvanced programing in phonegap
Advanced programing in phonegapRakesh Jha
 
Android In A Nutshell
Android In A NutshellAndroid In A Nutshell
Android In A NutshellTed Chien
 
Develop an app for Windows 8 using HTML5
Develop an app for Windows 8 using HTML5Develop an app for Windows 8 using HTML5
Develop an app for Windows 8 using HTML5Soumow Dollon
 

Ähnlich wie JS for Mobile: The Enyo Framework (jsconf.us 2011) (20)

Native App + Wep App = ? (Hybrid Applications)
Native App + Wep App = ? (Hybrid Applications)Native App + Wep App = ? (Hybrid Applications)
Native App + Wep App = ? (Hybrid Applications)
 
JQuery Mobile vs Appcelerator Titanium vs Sencha Touch
JQuery Mobile vs Appcelerator Titanium vs Sencha TouchJQuery Mobile vs Appcelerator Titanium vs Sencha Touch
JQuery Mobile vs Appcelerator Titanium vs Sencha Touch
 
Hybrid Mobile Apps - Meetup
Hybrid Mobile Apps - MeetupHybrid Mobile Apps - Meetup
Hybrid Mobile Apps - Meetup
 
PPT Companion to Android
PPT Companion to AndroidPPT Companion to Android
PPT Companion to Android
 
Worklight technical intro v2
Worklight technical intro v2Worklight technical intro v2
Worklight technical intro v2
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to android
 
Dineshotham Kumar Khambhammettu
Dineshotham Kumar KhambhammettuDineshotham Kumar Khambhammettu
Dineshotham Kumar Khambhammettu
 
Mobile Web Apps
Mobile Web AppsMobile Web Apps
Mobile Web Apps
 
Hybridapp
HybridappHybridapp
Hybridapp
 
White paper native, web or hybrid mobile app development
White paper  native, web or hybrid mobile app developmentWhite paper  native, web or hybrid mobile app development
White paper native, web or hybrid mobile app development
 
Flex 4.5 and mobile development
Flex 4.5 and mobile developmentFlex 4.5 and mobile development
Flex 4.5 and mobile development
 
Ionic2 First Lesson of Four
Ionic2 First Lesson of FourIonic2 First Lesson of Four
Ionic2 First Lesson of Four
 
Hybrid App Development with PhoneGap
Hybrid App Development with PhoneGapHybrid App Development with PhoneGap
Hybrid App Development with PhoneGap
 
OWIN (Open Web Interface for .NET)
OWIN (Open Web Interface for .NET)OWIN (Open Web Interface for .NET)
OWIN (Open Web Interface for .NET)
 
Front-end. Global domination
Front-end. Global dominationFront-end. Global domination
Front-end. Global domination
 
Getting Acquainted with PhoneGap
Getting Acquainted with PhoneGapGetting Acquainted with PhoneGap
Getting Acquainted with PhoneGap
 
Introduction phonegap
Introduction phonegapIntroduction phonegap
Introduction phonegap
 
Advanced programing in phonegap
Advanced programing in phonegapAdvanced programing in phonegap
Advanced programing in phonegap
 
Android In A Nutshell
Android In A NutshellAndroid In A Nutshell
Android In A Nutshell
 
Develop an app for Windows 8 using HTML5
Develop an app for Windows 8 using HTML5Develop an app for Windows 8 using HTML5
Develop an app for Windows 8 using HTML5
 

Kürzlich hochgeladen

A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 

Kürzlich hochgeladen (20)

A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 

JS for Mobile: The Enyo Framework (jsconf.us 2011)

  • 1. 1 © 2011 Hewlett-Packard Development Company, L.P.
  • 2. Enyo: A JS Framework for Mobile Devices Ben Combee Sr. Developer Relations Engineer Frameworks Team, Palm GBU 2 © 2011 Hewlett-Packard Development Company, L.P.
  • 3. 3 © 2011 Hewlett-Packard Development Company, L.P. Confidential
  • 4. HP webOS Architecture webOS Service Bus JS Service Web App “Hybrid” App Compiled App Built-in Node.js webOS Service Services Web App Runtime Compiled App Runtime (WebKit + v8) Runtime UI System Manager Activity Manager Low-level OS Components (Linux) 4 © 2011 Hewlett-Packard Development Company, L.P. Confidential
  • 5. Enyo Begins with Ares 5 © 2011 Hewlett-Packard Development Company, L.P.
  • 6. Enyo Applications 6 © 2011 Hewlett-Packard Development Company, L.P. 6
  • 7. Anatomy of an Enyo App 7 © 2011 Hewlett-Packard Development Company, L.P. 7
  • 8. Anatomy of a Enyo Application – appinfo.json • Standard webOS application metadata, not needed for use in browser – index.html • Initial page loaded by system manager, pulls in enyo framework and creates app object – depends.js • Loaded by enyo.js, JS code to declare what other files are needed for your app – app.js • Main application object – app.css • Any styles needed specifically for your application 8 © 2011 Hewlett-Packard Development Company, L.P. Confidential
  • 9. appinfo.json { "id": "com.palmdts.enyo.helloworld“, "version": "1.0.0", "vendor": "HP“, "type": "web“, "main": "index.html“, "title": "Enyo HelloWorld“, "icon": "icon.png“, "uiRevision": 2 } – “main” could direct to a different HTML file – Lots more options documented on developer.palm.com 9 © 2011 Hewlett-Packard Development Company, L.P. Confidential
  • 10. depends.js enyo.depends( "HelloWorld.js", "HelloWorld.css", "app/"); – Supports loading both individual JS and CSS files as well as pointing to directories that have their own depends.js file. – Strings support expansion of $enyo variable to refer to root of framework tree for loading extension modules or themes. 10 © 2011 Hewlett-Packard Development Company, L.P. Confidential
  • 11. index.html <!doctype html> <html><head> <title>enyo HelloWorld</title> <script src="../../../framework/enyo.js”></script> </head> <body> <script type="text/javascript"> new enyo.Canon.HelloWorld(). renderInto(document.body); </script> </body></html> – Can add launch=“debug” to <script> tag to load all framework source 11 © 2011 Hewlett-Packard Development Company, L.P. Confidential
  • 12. app.js enyo.kind({ name: "enyo.Canon.HelloWorld", kind: enyo.Control, content: "Hello World!"}); – Very simple example, this app is just a <div> with “Hello, World!” as its content – Key idea is that your app is a enyo.kind and other code renders it into the page – First kind to be rendered has special powers with handling application- level events 12 © 2011 Hewlett-Packard Development Company, L.P. Confidential
  • 13. The Philosophy of Enyo 13 © 2011 Hewlett-Packard Development Company, L.P.
  • 14. Applications Are the Target 14 © 2011 Hewlett-Packard Development Company, L.P.
  • 15. Code Reuse Through Components http://www.flickr.com/photos/hugosimmelink/1506521934 15 © 2011 Hewlett-Packard Development Company, L.P.
  • 16. Kinds and Inheritance – Each kind has a parent kind – When overridding a method from parent, can call this.inherited(arguments) to call parent’s implementation – enyo.Object is base of the tree – Implements a property system to allow setting object values on instantiation with setPROP/getPROP/PROPchanged methods – enyo.Component is base of all items that go into app tree – Components can own a nested collection of objects – Components have a “$” hash of all owned objects by name, e.g. this.$.button.setEnabled(true) 16 © 2011 Hewlett-Packard Development Company, L.P. Confidential
  • 17. Support Flexible Layouts HFlexBox VFlexBox Absolute Nested 17 © 2011 Hewlett-Packard Development Company, L.P. Confidential
  • 18. Favor Code Generation and Layout Tools http://www.geograph.org.uk/photo/76980 18 © 2011 Hewlett-Packard Development Company, L.P.
  • 19. Example of Application Structure components: [ {kind: "AppMenu", components: [ {caption: "Show on One Page", onclick: "showOnePage"}]}, {kind: "VFlexBox", width: "320px", style: "border-right: 1px solid gray;", components: [ {kind: "RadioGroup", style: "padding: 10px;", onChange: "radioGroupChange", components: [ {caption: "Packages", flex: 1}, {caption: "Index", flex: 1} ]}, {kind: "Pane", flex: 1, onclick: "tocClick", className: "selectable", domAttributes: {"enyo-pass-events": true}, …… 19 © 2011 Hewlett-Packard Development Company, L.P. Confidential
  • 20. Prefer JavaScript Over HTML { “js” } > <html> 20 © 2011 Hewlett-Packard Development Company, L.P.
  • 21. JS Will Get Faster Quicker Than WebKit > 21 © 2011 Hewlett-Packard Development Company, L.P.
  • 22. Cache DOM in Local JavaScript Objects 22 © 2011 Hewlett-Packard Development Company, L.P.
  • 23. Support Device and Desktop 23 © 2011 Hewlett-Packard Development Company, L.P.
  • 24. Support webOS Special Features – Wrappers for Palm System Services – Support for talking to application-provided node.js services – Mocking of Palm services for desktop development/testing – Notifications using dashboard – Multiple card/window management – IFRAME-based cross-app launching – OBJECT-based hybrid applications 24 © 2011 Hewlett-Packard Development Company, L.P. Confidential
  • 25. Enyo as a Platform 25 © 2011 Hewlett-Packard Development Company, L.P. 25
  • 26. The Enyo API enyo.ActivityButton enyo.AjaxContent enyo.AlphaDivider enyo.AnimatedImage enyo.Animator enyo.AppMenu enyo.AppMenuItem enyo.BasicCarousel enyo.BasicDrawer enyo.BasicInput enyo.BasicRichText enyo.BasicScroller enyo.BasicService enyo.BasicWebView enyo.Box enyo.Button enyo.ButtonHeader enyo.Carousel enyo.CarouselInternal enyo.CheckBox enyo.Component enyo.ConfirmPrompt enyo.Control enyo.CroppableImage enyo.CrossAppResult enyo.CrossAppUI enyo.CustomButton enyo.CustomListSelector enyo.Dashboard enyo.DatePicker enyo.DbList enyo.DbRepeaterList enyo.DbService enyo.DbService.Request enyo.Dialog enyo.DialogPrompt enyo.dispatcher enyo.Divider enyo.DividerDrawer enyo.dom enyo.DomNode enyo.DomNodeBuilder enyo.Drag enyo.DragScroller enyo.Drawer enyo.EditMenu enyo.FadeScroller enyo.FilePicker enyo.FlexLayout enyo.FloatingHeader enyo.Flyweight enyo.g11n.FmtStyles.prototype enyo.g11n.GeoLocator.prototype enyo.g11n.NameFmt.prototype enyo.g11n.PhoneFmt.prototype enyo.g11n.PhoneNumber.prototype enyo.g11n.TzFmt.prototype enyo.gesture enyo.GrabButton enyo.Grid enyo.Group enyo.GroupedToolButton enyo.HBox enyo.Header enyo.HelpMenu enyo.HFlexBox enyo.HFlexLayout enyo.HLayout enyo.HtmlContent enyo.Hybrid enyo.IconButton enyo.Iframe enyo.Image enyo.ImageView enyo.Input enyo.InputBox enyo.IntegerPicker enyo.Item enyo.json enyo.keyboard enyo.LabeledContainer enyo.LazyControl enyo.ListSelector enyo.ManagedDomBuilder enyo.Menu enyo.MenuCheckItem enyo.MenuItem enyo.MockService enyo.NotificationButton enyo.Object enyo.OrderedContainer enyo.PageHeader enyo.PalmService enyo.palmServices enyo.Pane enyo.PaneLayout enyo.PasswordInput enyo.Picker enyo.PickerButton enyo.PickerGroup enyo.Popup enyo.PopupList enyo.PopupSelect enyo.PrevNextBanner enyo.Progress enyo.ProgressBar enyo.ProgressBarItem enyo.ProgressButton enyo.ProgressSlider enyo.Pushable enyo.RadioButton enyo.RadioGroup enyo.RadioToolButton enyo.RadioToolButtonGroup enyo.Repeater enyo.Request enyo.RichText enyo.RoundedBox enyo.RoundedInput enyo.RowGroup enyo.RowItem enyo.Scrim enyo.ScrimmedConfirmPrompt enyo.Scroller enyo.ScrollFades enyo.ScrollingImage enyo.ScrollStrategy enyo.SearchInput enyo.Selection enyo.Service enyo.SizeableCanvas enyo.SizeableImage enyo.Slider enyo.SlidingPane enyo.SlidingView enyo.SnapScroller enyo.Sound enyo.Spacer enyo.Spinner enyo.SpinnerLarge enyo.Stateful enyo.string enyo.SwipeableItem enyo.SystemService enyo.TabButton enyo.TabGroup enyo.TempDbService enyo.TimePicker enyo.Toaster enyo.ToggleButton enyo.Toolbar enyo.ToolButton enyo.ToolButton2 enyo.ToolButtonGroup enyo.ToolInput enyo.transitions.Fade enyo.transitions.LeftRightFlyin enyo.transitions.Simple enyo.VBox enyo.VFlexBox enyo.VFlexLayout enyo.Video enyo.ViewImage enyo.VirtualCarousel enyo.VirtualList enyo.VirtualRepeater enyo.WebService enyo.WebView enyo.windows 26 © 2011 Hewlett-Packard Development Company, L.P. Confidential
  • 27. Big Groups of APIs – Language Extensions – OOP and Component System – DOM Management – Input Controls – Containers – Lists and Repeaters – Services – Globalization (G11N) – webOS Platform Support 27 © 2011 Hewlett-Packard Development Company, L.P. Confidential
  • 28. DEMOS 28 © 2011 Hewlett-Packard Development Company, L.P.
  • 29. 29 © 2011 Hewlett-Packard Development Company, L.P.
  • 30. developer.palm.com pdc@palm.com 30 © 2011 Hewlett-Packard Development Company, L.P.
  • 31. 31 © 2011 Hewlett-Packard Development Company, L.P.