SlideShare uma empresa Scribd logo
1 de 22
 
Meet Mojo™ ,[object Object],[object Object],[object Object],A brief introduction to Palm ®  webOS™ applications
Goals ,[object Object],Mojo apps are like web pages Development model is accessible App structure, basic framework usage ,[object Object],[object Object]
webOS UI ,[object Object],[object Object],[object Object]
Terminology: Scenes ,[object Object],[object Object],[object Object]
Terminology: Stages ,[object Object],[object Object],[object Object],[object Object]
Structure of a webOS app ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
appinfo.json ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
index.html <html> <head></head> <body> <div id=&quot;flashlight&quot; style=&quot;width:100%; height:100%; background-color:#FF9&quot;></div> </body> </html>
Typical Mojo index.html <head>  <title>Framework Library</title> <script src=&quot;/usr/palm/frameworks/mojo/mojo.js&quot;  type=&quot;text/javascript&quot;  x-mojo-version=&quot;1&quot;></script> <link href=&quot;stylesheets/fr-library.css&quot; media=&quot;screen&quot;  rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /> </head> <body></body>
sources.json [ { &quot;source&quot;: &quot;app/assistants/app-assistant.js&quot; }, { &quot;source&quot;: &quot;app/assistants/detail-assistant.js&quot; }, { &quot;source&quot;: &quot;app/assistants/list-assistant.js&quot;, &quot;scenes&quot;: &quot;list&quot; } ]
The Assistants Directory ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
The Views Directory ,[object Object],[object Object],[object Object],[object Object],[object Object]
app/views/ main/main-scene.html <div id=&quot;power-switch&quot;  x-mojo-element=&quot;RadioButton&quot;> </div> <div id=&quot;main-light&quot; style=&quot;width:100%; height:382px;  background-color:#224;&quot;> </div>
app/assistants/main-assistant.js MainAssistant = function() {}; MainAssistant.prototype.setup = function() {… MainAssistant.prototype.switchLight = function(ev) {…
MainAssistant.prototype.setup() var attributes = { choices: [ {label: &quot;Off&quot;, value: false}, {label: &quot;On&quot;, value: true} ] }; var model =  { value: false }; this.controller.setupWidget('power-switch',    attributes, model);
MainAssistant.prototype.setup(), Part #2 this.switchLight = this.switchLight.bind(this); this.controller.listen('power-switch', Mojo.Event.propertyChange, this.switchLight); this.light = this.controller.get('main-light');
MainAssistant.prototype.switchLight() MainAssistant.prototype.switchLight = function(event) { this.light.style.backgroundColor =  event.value ? &quot;#FF9&quot; : &quot;#224&quot;; };
Finished Flashlight App
Dive Deeper ,[object Object]
 
 

Mais conteúdo relacionado

Último

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Último (20)

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 

Destaque

Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Destaque (20)

AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 

Meet Mojo @ Palm Developer Day, 4/24/2010

  • 1.  
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9. index.html <html> <head></head> <body> <div id=&quot;flashlight&quot; style=&quot;width:100%; height:100%; background-color:#FF9&quot;></div> </body> </html>
  • 10. Typical Mojo index.html <head> <title>Framework Library</title> <script src=&quot;/usr/palm/frameworks/mojo/mojo.js&quot; type=&quot;text/javascript&quot; x-mojo-version=&quot;1&quot;></script> <link href=&quot;stylesheets/fr-library.css&quot; media=&quot;screen&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /> </head> <body></body>
  • 11. sources.json [ { &quot;source&quot;: &quot;app/assistants/app-assistant.js&quot; }, { &quot;source&quot;: &quot;app/assistants/detail-assistant.js&quot; }, { &quot;source&quot;: &quot;app/assistants/list-assistant.js&quot;, &quot;scenes&quot;: &quot;list&quot; } ]
  • 12.
  • 13.
  • 14. app/views/ main/main-scene.html <div id=&quot;power-switch&quot; x-mojo-element=&quot;RadioButton&quot;> </div> <div id=&quot;main-light&quot; style=&quot;width:100%; height:382px; background-color:#224;&quot;> </div>
  • 15. app/assistants/main-assistant.js MainAssistant = function() {}; MainAssistant.prototype.setup = function() {… MainAssistant.prototype.switchLight = function(ev) {…
  • 16. MainAssistant.prototype.setup() var attributes = { choices: [ {label: &quot;Off&quot;, value: false}, {label: &quot;On&quot;, value: true} ] }; var model = { value: false }; this.controller.setupWidget('power-switch', attributes, model);
  • 17. MainAssistant.prototype.setup(), Part #2 this.switchLight = this.switchLight.bind(this); this.controller.listen('power-switch', Mojo.Event.propertyChange, this.switchLight); this.light = this.controller.get('main-light');
  • 18. MainAssistant.prototype.switchLight() MainAssistant.prototype.switchLight = function(event) { this.light.style.backgroundColor = event.value ? &quot;#FF9&quot; : &quot;#224&quot;; };
  • 20.
  • 21.  
  • 22.  

Notas do Editor

  1. Some key parts of the UI and technical terminology discuss how mojo apps work like pages in a browser All implemented in HTML, CSS, JavaScript Discuss how many of the concepts you’re familiar with in desktop browsers fit into Mojo apps Accessibility One of the most exciting things about the webOS platform App dev model is much more accessible to people than other mobile platforms Mobile platforms like PalmOS or iPhone, you really have to be a C programmer Many more web developers, and on webOS, they can all leverage the skills they’ve developed &amp; tools they’re familiar with. Goals - give you a conceptual head start When you dl the SDK, you’ll be productive more quickly SDK is publicly available now
  2. Applications run in cards, Basis of webOS’s multitasking Native component called SysMgr runs the UI and switches between them Cards are like windows in a desktop browser Implemented entirely on HTML, CSS, JavaScript Each is a small web page -- index.html
  3. Terminology: Scenes Various screens in a card are called scenes Stacked up. List, details, edit, etc… Each scene written separately, but not a different HTML document. they’re all sibling divs in the body.
  4. There are other types: Dashboards for unobtrusive notifications Popup alerts for more immediate interruptions Picture shows the messaging app -- strips at the bottom are dashboard stages. All of these are implemented as separate HTML documents Child windows of the app Mojo provides APIs to create &amp; manage stages. Job of an app is to coordinate and run the scenes in 1 or more stages Let’s see how they do it…
  5. Directory structure, with basic required files Some of these are obvious Icon, images, stylesheets Extras: Miniicon.png framework_config.json Log levels, debug mode, timing, escaping
  6. Title - displayed in the launcher Main - the HTML file to load for the app Id - unique identifier for the application Version - used by app catalog, launcher, must follow the 3 part format Vendor - string identifying the maker of the app, displayed in the launcher. Others: Visible: Hidden in the launcher noWindow: Hidden window noWindow:true in appinfo, main stage is hidden instead of shown as a card. This is needed if you don’t want all your stages closed when the user throws away your main card. Apps must always keep at least one stage open. close your card &amp; display only a dashboard stage open a card again if the app is launched
  7. Index.html, Pretty much what you’d expect Just a web page -- Don’t actually need to load Mojo at all Can just write content, and it goes into the card. Most useful &amp; trivial app is a flashlight Note that I don’t know of any current apps that actually work this way. Story about Rich’s calculator Frequently surprised by how quickly &amp; easily we could get things working
  8. From our framework library app -- Mojo team uses internally Removed doctype &amp; HTML tags Not much left: Script tag to load framework Link tag to load the app’s stylesheet Script tag has x-mojo-version=1… specifies version when we need to make breaking changes, we make a new version Mojo also loads the Prototype framework Empty body When Mojo is loaded, it does everything else: loading &amp; invoking your app code Setting up the first scene Informing SysMgr that the stage is ready for display.
  9. Mojo uses sources.json to load your app code List of JS source files Can load them in script tags, but wasteful if you have multiple stages. We put them in the assistants dir, but they can be kept wherever you like. If you’re optimizing app launch time, you can use the ‘scenes’ property. Specifies that the script is only needed for that scene It will be loaded automatically when the scene is pushed
  10. JavaScript code Apps coordinate stages &amp; run UI in them. They do this mostly by implementing assistant objects Mojo provides generic controllers for various things Apps provide assistants for the controllers that implement all the app-specific behavior AppController/Assistant - Handling launch arguments, creation of stages StageController/Assistant - Scene management. Encapsulation of common scene behavior. SceneController/Assistant- Most app code. Configures widgets, responds to user input, pushes/pops other scenes, etc, Dialogs, Widgets, etc…
  11. app/views Views directory contains the HTML for the app’s scenes. One subdirectory per scene E.g., List, details, edit, options… Scene dirs contain a template for the scene Template is a fragment of HTML Sometimes with property substitutions Basic structure, devoid of dynamic content Declares Mojo widgets Possibly HTML templates for widgets Show you an actual Mojo app, so I added a power switch to the flashlight app
  12. Scene template for the main scene in the Mojo flashlight Main scene is pushed by default Template main-scene.html is loaded Declaration of widget Id &amp; custom property to indicate widget name App specifies other info for the widget in the scene assistant Div for light Takes up rest of screen Can adjust the brackground color
  13. Source file for the main scene assistant Declares the MainAssistant class You can use Prototype’s Class.create() if you prefer. Implements 2 methods Setup() Configures widgets, Implements app-specific behavior switchLight() Event handler for the radio button that turns the light on &amp; off
  14. Three main jobs of a scene assistant’s setup() method: Initialize state in the assistant Set up the scene’s widgets Add event listeners where needed This is an assistant, accesses the scene controller at this.controller. setupWidget() is a SceneController method that tells the framework how to instantiate mojo widgets Attributes control the look &amp; behavior of the widget Model holds the data the widget operates on Note: setupWidget() does not actually instantiate the widget… the framework does that later.
  15. switchLight() is our event handler function. Bind it so when it’s triggered, ‘this’ will be a reference to the assistant object instead of the window Here we store the new function back in the object, which prevents us from accidentally using the unbound function. Listen() is a method available on the SceneController object. Wrapper around addEventListener(), Looks up the element by ID propertyChange events sent when a widget modifies some data Get() is another method available on the SceneController object. Simple wrapper around getElementById(), which looks up the element in the correct document. Espcially important if your application is using multiple stages. Saves the main light div in the assistant object, so we can reference it later
  16. switchLight() is just the handler for the propertyChange event sent by the Mojo RadioButton widget Fetches the new value from the event uses it to set the background color to turn the light on or off. Note that we can reference ‘this.light’, since we bound the function in setup.
  17. This is what it looks like -- Press the on/off button, and the large div toggles between dark blue and light yellow. That’s all there is to creating a basic Mojo app Obviously it can get a lot more complicated, but it’s easy to get things working.