Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Builds Desktop-App for Web Developers

Builds Desktop-App for Web Developers

Introduction Mozilla.org XULRunner
Introduction XULApp StarterKit based-on XULRunner
Add-ons Demo

Rack Lin (阿土伯)

January 14, 2013
Tweet

More Decks by Rack Lin (阿土伯)

Other Decks in Programming

Transcript

  1. about:me •  ViViPOS  Co.,  Ltd  CTO   –  Using  JavaScript

     For  “Point  Of  Sale”  System.   •  PHP  /  JavaScript  /  Java  Programmer  (NOW   Favoring  Scala  )     •  [email protected]   •  hXps://twiXer.com/racklin   •  hXp://www.plurk.com/racklin   •  hXps://www.facebook.com/racklin1002   •  hXp://racklin.blogspot.tw/      (Non  Updated)  
  2. Desktop  App •  Wiki-­‐>  ApplicaZon  so[ware   •  PC  Magazine:

      – An  applicaZon  that  runs  stand  alone  in  a  desktop   or  laptop  computer.  Contrast  with  "Web-­‐based   applicaZon,"  which  requires  the  Web  browser  to   run.   – The  same  as  definiZon  #1  above,  except  that  the   term  may  be  used  to  contrast  desktop   applicaZons  with  mobile  applicaZons  that  run  in   smartphones  and  tablets  
  3. Cross-­‐Pla.orm  GUI  Toolkits   •  GTK+   •  Qt  

    •  wxWidgets   •  Swing  /  SWT  
  4. Binding  Language •  GTK+   – C  /  C++  /  Java

     /  Python  /  Ruby  /  PHP  /  Javascript   •  QT   – C  /  C++  /  Java  /  Python  /  Ruby  /  PHP  /  Javascript   •  wxWidgets   – C  /  C++  /  Java  /  Python  /  Ruby  /  PHP  /  Javascript   •  Swing  /  SWT  /  JavaFX   – Java  (  Scala  /  JPython  /  JRuby  /  Javascript)  
  5. HTML5  Toolkits •  Webkit   – TideSDK   – QtWebkit   – app.js

     (nodejs  for  webkit)   •  Gecko   – XULRunner
  6. Rich  Client  Pla.orm •  A  standard  bundling  framework   • 

    User  interface  management    (e.g.  menus  and  toolbars)       •  User  selngs  management     •  Storage  management     •  Window  management   •  Update  manager   –  Eclipse  RCP   –  Netbeans  Pla.orm   –  Spring  Framework  RCP  
  7. WHY  RCP •  Project  or  Product   –   You  frequently

     Branch  /  Code  Generator     Customer  A Customer  B Customer  C You  are  doing  Project  NOT  Product.
  8. WHY  RCP •  Upstream  Core  Components     •  CustomizaZon

     by  Components  or  Add-­‐ons   – Customer  A  (  Core  +  A1  +  B1  +  C1  ….)   – Customer  B  (  Core  +  A1  +  C1  +  D1  …)   – Customer  C  (  Core  +  A1  +  E1  +  F1  …)   XULRunner  /  ApplicaZon Core  (Main  UI  /  API)
  9. Components  /  Add-­‐ons   •  Easy  to  Development  and  Test.

      •  Easy  to  Online-­‐Update.   •  Easy  to  Maintenance   Slime   Component  /  Add-­‐on
  10. Why  XULRunner •  Cross-­‐Pla.orm   •  Gecko  rendering  engine  

    – HTML5  *   – CSS3   – JavaScript   – XML  (XSLT,  XMLHXpRequest,  DOMParser)    
  11. Why  XULRunner  (60%  Power) •  XUL   – XUL   – XUL

     Overlays   •  XPCOM(Cross-­‐Pla.orm  Component  Object  Model)   – C++  /  Python  /  Java  /  Javascript   – Low  Level  API   •  Ex.  File  Systems  /  Databases  /  Thread  
  12. Why  XULRunner  (90%  Power) •  I18n  /  l10n    

    – DTD  EnZZes  (.dtd)  /  StringBundles  (.properZes)   •  InstallaZon  and  upgrade  mechanism   – XPInstall   •  Extension  Manager   •  XBL   – reusable  components   •  Preferences  System  
  13. XULApp  StarterKit •  Build  Scripts   –  MacOSX  /  Linux

     /  Windows   •  Skeleton  UI  Selngs   –  Window  /  Menubar  /  Statusbar   •  Javascript  Libraries   –  jQuery   –  GREUZls   –  Lodash   •  Embedded  Develop  Tools   –  SQLite  Manager   –  DOM  Inspector   –  JSConsole    
  14. Don’t  Hard  Coding •  Using  MainApp  Add-­‐on   •  Enhancement

     by  the  other  Add-­‐on   •  CustomizaZon  by  the  other  Add-­‐on   •  Decoupling  your  applicaZon.   •  Hello-­‐demo  sample  code:   –  hXps://github.com/racklin/xulapp-­‐starterkit-­‐app-­‐ hello-­‐demo
  15. Crazy  Ideas •  Embedded  NodeJS   •  Using  expressjs  as

     Web  Services  For  Desktop   ApplicaZon.   •  NodeJS  code:   –  hXps://github.com/racklin/xulapp-­‐starterkit-­‐addon-­‐ nodejs   •  Expressjs-­‐demo  sample  code:   –  hXps://github.com/racklin/xulapp-­‐starterkit-­‐addon-­‐ expressjs-­‐demo  
  16. Thinking •  XULRunner  For  HTML5  Developers   – Live-­‐Update  For  Your

     HTML5  ApplicaZon     – Using  Add-­‐ons  to  extends  features  .   – IndexedDB  ??   •  Mozilla  Storage  Interface   – Embedded  Libraries   •  Any  Files  Live  Updatable    
  17. Reuse  of  Add-­‐ons •  Reuse    Add-­‐ons     – addons.mozilla.org

      – There  are  12,995  add-­‐ons  for  FireFox  18.
  18. Resources •  Slide:     hXp://goo.gl/z8BCG   •  XULApp  StarterKit:

      hXps://github.com/racklin/xulapp-­‐starterkit   •  XULRunner  –  MDN   hXps://developer.mozilla.org/en-­‐US/docs/ XULRunner