SlideShare ist ein Scribd-Unternehmen logo
1 von 23
Series 40 Developer Training
Build a Series 40 Web App in One Hour




Michael Samarin, Ph.D
Director,
Developer Training and Evangelism
Futurice Oy

+358 40 518 18 09
michael.samarin@futurice.com
                                        @MichaelSamarin
What Are Series 40 Web Apps
» W3C Widget specification (http://www.w3.org/TR/widgets/) says:
    › “Widgets are client-side applications that are authored using
      Web standards, but whose content can also be embedded into
      Web documents. “
» Series 40 Web Apps are based on the W3C Widget specification
    › Authored using a set of development tools provided by Nokia
    › Targeted to be run on Series 40 mobile devices
    › Using browser engine Nokia Browser for Series 40 (alternative
      name Nokia Proxy Browser, former Ovi Proxy Browser), which
      is pre-installed on all latest Series 40 devices and available as
      download for older devices.
What Are Series 40 Web Apps
» In total, there are 32 devices that support Nokia Browser (Series
  40 5th Edition, Feature Pack 1 and up).
» http://www.developer.nokia.com/Devices/Device_specification
  s/?page=2&filter1=series40webapps
» Core use cases: Connected data-driven applications
    › Social networking, RSS readers, trivia games, …
Web Apps Are Not Web Pages
» Although developed using web
  standards, web apps are not the
  same as traditional web pages
   › Appear and behave like standalone
     applications
   › Located in application grid like regular
     applications
   › A ”custom fit” for a small-screen mobile
     device
   › Package can contain local content like
     graphics, data samples, scripts
Tools for Series
40 Web Apps
» Nokia Web Tools 1.5
» Eclipse Based (Aptana Studio)
  web development
  environment
» Customized by Nokia for
  Series 40 Web apps
» Includes templates, libraries,
  code snippets, simulator,
  debugger, deployment options
  unique to Series 40 Web Apps
  development
» Bluetooth Launcher 1.5 for on-
  device deployment
Nokia Browser for Series 40
» Unique proxy browser with server side JavaScript /
  Compression engine for Series 40
» Engine that made Series 40 Web Apps possible, because
  most Series 40 devices do not have enough CPU/RAM to
  run a full WebKit based web browser
» Nokia Browser Proxy hosts the Web App client, and acts as
  a proxy between the Nokia Browser Client and the Web
  App server, so can be described as ”Cloud-Assisted Web
  Runtime”
Nokia Browser for Series 40
»   Nokia Browser main features:

     › JavaScript runs on Nokia Browser Proxy server side

     › Application content compressed before sending to the client

     › CSS minimized, images compressed, partial HTML updates whenever
       possible

»   Current Nokia Browser main constraints:

     › HTML 4.01 with CSS 2.0 mobile profile (selected parts of CSS 3 also available)

     › Certain DOM events not supported (onkey*, onmouse*, ontouch*)

     › Limitations on animations (a limited set of transition timing functions
       available)

     › No device API access

     › No home screen widgets
JavaScript and Mobile Web Library
» Regular JavaScript statements are executed by the Nokia
  Browser Proxy server
» JavaScript function calls in your code cause a round-trip to
  Nokia Browser Proxy
» Special library called Mobile Web Library (MWL) provides client-
  local JS functions
» Functions executed fully on the client side (Nokia Browser
  Client)
» Used via a namespace called mwl
› MWL is limited, however
                  covers the most common
                  use cases that can be run
                  on the client side:
                   › Running simple CSS
                     transitions/animations
  Mobile Web       › Handling gestures (swipe,
Library - MWL        long press)
                   › Inserting new nodes to
                     DOM

                › Implemented natively by
                  the Nokia Browser Client
Mobile Web Library - MWL
    CSS Manipulation             Timers                      Misc
    addClass                     timer                       setInputValue
    removeClass                  stopTimer                   insertHTML
    toggleClass                                              replaceChild
    switchClass                                              scrollTo
    iterateClass                                             loadURL
    setGroupTarget
    setGroupNext
    show
    hide
    toggle

»   In addition to these, MWL also provides functions for registering listeners for
    synthetic events (gestures) and navigation keys
     ›   addSwipeLeftListener(), addLongPressListener(), …

     ›   addNavLeftListener(), addNavUpListener(), …
Common JavaScript Use Cases
»   Non-MWL JavaScript can be used almost as usual

     ›   Just keep in mind that it causes a round-trip to the Nokia Browser Proxy

     ›   Be especially careful when using 3rd party JS libraries (e.g. jQuery or jQuery Mobile)

»   Handling AJAX

     ›   No performance hit caused by the Nokia Browser architecture itself

     ›   No limitations with same origin security policies

     ›   Mashing up content from different sources possible!

»   Lazy loading vs. front loading

     ›   Round-trips can sometimes be avoided by front loading data at startup

»   Preparing DOM for mobile client use

     ›   E.g. building lists/tables to be inserted into the app
Animations and Transitions
» Certain properties can be animated locally on the
  client side:
   › Element’s width, height, margin-left and margin-top

   › Or a combination of these

» Consequently, there are a few design patterns that
  are especially recommended
   › Accordion

   › Carousel

   › Tabs
Animations and Transitions
» These have certain common advantages/properties
   › Based on the principle of concealing/revealing content

   › Client-local, animated transitions can be easily added

» When used correctly, unnecessary round trips to
  the Nokia Browser Proxy server are almost
  automatically avoided!
Animating Height & Width
Animating Margins

                    …or…




                    …or…
Important Notes on Animations
» Local Preview, Cloud Preview and an actual device will all work
  slightly differently, so don’t rely overly on the simulator.
» GIF animations don’t work in the simulator but DO on the
  device. Be careful with GIF, because of high CPU usage
» Contrary to regular browser scripting, animations on the Client
  are blocking
» Only a single element can be animated at one time for
  performance reasons
CSS Transitions
»   The Mobile Web Library allows you to run CSS transitions on the client side
     ›   No round trip to Nokia Browser Proxy server needed!

     ›   Devices not supporting animated transitions automatically fall back to discrete property changes

»   Use cases for transitions:
     ›   Accordion expanding

     ›   Going to a details view by clicking on a list item

     ›   Search box appearing/disappearing

     ›   Slide shows

»   Current limitations:
     ›   Properties you can animate: width, height, margin-left, margin-top

     ›   Only top-level CSS classes can be used with MWL in animations
AnimatedPageChangeSample
                          How it works


Page #1                Page #1     Page #2      Page #1    Page #2



Page #2


Default positioning                            Then we wrap both
                       We move Page #2
for the 2 pages (the                           pages in a container
                       up by how high Page
dashed line is the                             element (red), which
                       #1 is, and to the
viewport of the                                we can move
                       right by how wide
phone)                                         sideways with an
                       Page #1 is, so we get
                                               animation
                       them side-by-side
Video Training
» https://projects.developer.nokia.com/videotraining




5/2/201
                                                       19
2
Browser Integration FAQ
» Is it possible to integrate the app with the Nokia Browser
  back button?
   › No, this is not supported at the moment

» Can I create custom items for the Nokia Browser options
  menu?
   › Not at the moment
   › If such funtionality is needed, create a custom implementation
     with HTML/CSS

» Can I close my app from JavaScript?
   › No, there is no such MWL method or window.close()
     available in the current release
Common Usage FAQ
» How do I obtain the real screen resolution from JavaScript?
    › First of all: do you really need to do this?

    › Would flexible CSS be enough?

    › Known issue: user agent of the JavaScript context is not the same as the actual
      client – it is the Nokia Browser Proxy

    › Makes it difficult to get the actual resolution

    › Workaround: pass the real user agent to a 3rd party server for inspection to
      detect the device resolution

         › Client UA is sent in AJAX requests

» CSS Compression challenges
Qualify for a Asha 303
» Attend the webinar session. You name has to be
  on the attendee list. 1 entry per name
» Send an email
    ›   web.apps@nokia.com to register your name

    ›   Subject “Asha 303 for May 3rd web app webinar”

    ›   State the intended application you are going to write and
        estimate publishing date

» Publish your Series 40 web app to Nokia Store
  and pass QA. Send an email
    ›   web.apps@nokia.com with the name and link of your app in
        Nokia Store

    ›   Publishing date has to be between May 3rd and July 1st
Thank you!




@MichaelSamarin

Weitere ähnliche Inhalte

Mehr von Microsoft Mobile Developer

Location based services for Nokia X and Nokia Asha using Geo2tag
Location based services for Nokia X and Nokia Asha using Geo2tagLocation based services for Nokia X and Nokia Asha using Geo2tag
Location based services for Nokia X and Nokia Asha using Geo2tagMicrosoft Mobile Developer
 
Lumia App Labs: Lessons learned from 50 windows phone 8 design consultations
Lumia App Labs: Lessons learned from 50 windows phone 8 design consultationsLumia App Labs: Lessons learned from 50 windows phone 8 design consultations
Lumia App Labs: Lessons learned from 50 windows phone 8 design consultationsMicrosoft Mobile Developer
 
Windows Phone 8 speech: parliamo con la nostra app
Windows Phone 8 speech: parliamo con la nostra appWindows Phone 8 speech: parliamo con la nostra app
Windows Phone 8 speech: parliamo con la nostra appMicrosoft Mobile Developer
 
La pubblicazione di un'applicazione sullo store
La pubblicazione di un'applicazione sullo storeLa pubblicazione di un'applicazione sullo store
La pubblicazione di un'applicazione sullo storeMicrosoft Mobile Developer
 
Il pattern mvvm come strutturare al meglio il vostro progetto
Il pattern mvvm come strutturare al meglio il vostro progettoIl pattern mvvm come strutturare al meglio il vostro progetto
Il pattern mvvm come strutturare al meglio il vostro progettoMicrosoft Mobile Developer
 
Lens app trasformare il telefono in una fotocamera
Lens app trasformare il telefono in una fotocameraLens app trasformare il telefono in una fotocamera
Lens app trasformare il telefono in una fotocameraMicrosoft Mobile Developer
 
Nokia Asha webinar: Developing health-care applications for Nokia Asha phones
Nokia Asha webinar: Developing health-care applications for Nokia Asha phonesNokia Asha webinar: Developing health-care applications for Nokia Asha phones
Nokia Asha webinar: Developing health-care applications for Nokia Asha phonesMicrosoft Mobile Developer
 
Nokia Asha webinar: Add VoIP services to your Nokia Asha apps
Nokia Asha webinar: Add VoIP services to your Nokia Asha appsNokia Asha webinar: Add VoIP services to your Nokia Asha apps
Nokia Asha webinar: Add VoIP services to your Nokia Asha appsMicrosoft Mobile Developer
 
LUMIA APP LABS #18: INTRODUCING NOKIA IMAGING SDK 1.0
LUMIA APP LABS #18: INTRODUCING NOKIA IMAGING SDK 1.0LUMIA APP LABS #18: INTRODUCING NOKIA IMAGING SDK 1.0
LUMIA APP LABS #18: INTRODUCING NOKIA IMAGING SDK 1.0Microsoft Mobile Developer
 

Mehr von Microsoft Mobile Developer (20)

Lessons learned from Nokia X UI reviews
Lessons learned from Nokia X UI reviewsLessons learned from Nokia X UI reviews
Lessons learned from Nokia X UI reviews
 
Location based services for Nokia X and Nokia Asha using Geo2tag
Location based services for Nokia X and Nokia Asha using Geo2tagLocation based services for Nokia X and Nokia Asha using Geo2tag
Location based services for Nokia X and Nokia Asha using Geo2tag
 
HERE Maps for the Nokia X platform
HERE Maps for the Nokia X platformHERE Maps for the Nokia X platform
HERE Maps for the Nokia X platform
 
Nokia In-App Payment - UX considerations
Nokia In-App Payment - UX considerationsNokia In-App Payment - UX considerations
Nokia In-App Payment - UX considerations
 
Introduction to Nokia Asha SDK 1.2 (beta)
Introduction to Nokia Asha SDK 1.2 (beta)Introduction to Nokia Asha SDK 1.2 (beta)
Introduction to Nokia Asha SDK 1.2 (beta)
 
UX considerations when porting to Nokia X
UX considerations when porting to Nokia XUX considerations when porting to Nokia X
UX considerations when porting to Nokia X
 
Kids' games and educational app design
Kids' games and educational app designKids' games and educational app design
Kids' games and educational app design
 
Nokia X: opportunities for developers
Nokia X: opportunities for developersNokia X: opportunities for developers
Nokia X: opportunities for developers
 
Lumia App Labs: Nokia Imaging SDK 1.1
Lumia App Labs: Nokia Imaging SDK 1.1Lumia App Labs: Nokia Imaging SDK 1.1
Lumia App Labs: Nokia Imaging SDK 1.1
 
Intro to Nokia X software platform and tools
Intro to Nokia X software platform and toolsIntro to Nokia X software platform and tools
Intro to Nokia X software platform and tools
 
Lumia App Labs: Lessons learned from 50 windows phone 8 design consultations
Lumia App Labs: Lessons learned from 50 windows phone 8 design consultationsLumia App Labs: Lessons learned from 50 windows phone 8 design consultations
Lumia App Labs: Lessons learned from 50 windows phone 8 design consultations
 
Windows Phone 8 speech: parliamo con la nostra app
Windows Phone 8 speech: parliamo con la nostra appWindows Phone 8 speech: parliamo con la nostra app
Windows Phone 8 speech: parliamo con la nostra app
 
La pubblicazione di un'applicazione sullo store
La pubblicazione di un'applicazione sullo storeLa pubblicazione di un'applicazione sullo store
La pubblicazione di un'applicazione sullo store
 
Il pattern mvvm come strutturare al meglio il vostro progetto
Il pattern mvvm come strutturare al meglio il vostro progettoIl pattern mvvm come strutturare al meglio il vostro progetto
Il pattern mvvm come strutturare al meglio il vostro progetto
 
Lens app trasformare il telefono in una fotocamera
Lens app trasformare il telefono in una fotocameraLens app trasformare il telefono in una fotocamera
Lens app trasformare il telefono in una fotocamera
 
NFC, Bluetooth e comunicazione tra app
NFC, Bluetooth e comunicazione tra appNFC, Bluetooth e comunicazione tra app
NFC, Bluetooth e comunicazione tra app
 
Nokia Asha webinar: Developing health-care applications for Nokia Asha phones
Nokia Asha webinar: Developing health-care applications for Nokia Asha phonesNokia Asha webinar: Developing health-care applications for Nokia Asha phones
Nokia Asha webinar: Developing health-care applications for Nokia Asha phones
 
Connettersi al Cloud Azure Mobile Services
Connettersi al Cloud Azure Mobile ServicesConnettersi al Cloud Azure Mobile Services
Connettersi al Cloud Azure Mobile Services
 
Nokia Asha webinar: Add VoIP services to your Nokia Asha apps
Nokia Asha webinar: Add VoIP services to your Nokia Asha appsNokia Asha webinar: Add VoIP services to your Nokia Asha apps
Nokia Asha webinar: Add VoIP services to your Nokia Asha apps
 
LUMIA APP LABS #18: INTRODUCING NOKIA IMAGING SDK 1.0
LUMIA APP LABS #18: INTRODUCING NOKIA IMAGING SDK 1.0LUMIA APP LABS #18: INTRODUCING NOKIA IMAGING SDK 1.0
LUMIA APP LABS #18: INTRODUCING NOKIA IMAGING SDK 1.0
 

Kürzlich hochgeladen

Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
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
 
Ryan Mahoney - Will Artificial Intelligence Replace Real Estate Agents
Ryan Mahoney - Will Artificial Intelligence Replace Real Estate AgentsRyan Mahoney - Will Artificial Intelligence Replace Real Estate Agents
Ryan Mahoney - Will Artificial Intelligence Replace Real Estate AgentsRyan Mahoney
 
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
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
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
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????blackmambaettijean
 
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
 
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
 
"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
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 

Kürzlich hochgeladen (20)

Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
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
 
Ryan Mahoney - Will Artificial Intelligence Replace Real Estate Agents
Ryan Mahoney - Will Artificial Intelligence Replace Real Estate AgentsRyan Mahoney - Will Artificial Intelligence Replace Real Estate Agents
Ryan Mahoney - Will Artificial Intelligence Replace Real Estate Agents
 
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
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
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
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????
 
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
 
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
 
"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
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 

Webinar: Build a Nokia Series 40 web app in one hour

  • 1. Series 40 Developer Training Build a Series 40 Web App in One Hour Michael Samarin, Ph.D Director, Developer Training and Evangelism Futurice Oy +358 40 518 18 09 michael.samarin@futurice.com @MichaelSamarin
  • 2. What Are Series 40 Web Apps » W3C Widget specification (http://www.w3.org/TR/widgets/) says: › “Widgets are client-side applications that are authored using Web standards, but whose content can also be embedded into Web documents. “ » Series 40 Web Apps are based on the W3C Widget specification › Authored using a set of development tools provided by Nokia › Targeted to be run on Series 40 mobile devices › Using browser engine Nokia Browser for Series 40 (alternative name Nokia Proxy Browser, former Ovi Proxy Browser), which is pre-installed on all latest Series 40 devices and available as download for older devices.
  • 3. What Are Series 40 Web Apps » In total, there are 32 devices that support Nokia Browser (Series 40 5th Edition, Feature Pack 1 and up). » http://www.developer.nokia.com/Devices/Device_specification s/?page=2&filter1=series40webapps » Core use cases: Connected data-driven applications › Social networking, RSS readers, trivia games, …
  • 4. Web Apps Are Not Web Pages » Although developed using web standards, web apps are not the same as traditional web pages › Appear and behave like standalone applications › Located in application grid like regular applications › A ”custom fit” for a small-screen mobile device › Package can contain local content like graphics, data samples, scripts
  • 5. Tools for Series 40 Web Apps » Nokia Web Tools 1.5 » Eclipse Based (Aptana Studio) web development environment » Customized by Nokia for Series 40 Web apps » Includes templates, libraries, code snippets, simulator, debugger, deployment options unique to Series 40 Web Apps development » Bluetooth Launcher 1.5 for on- device deployment
  • 6. Nokia Browser for Series 40 » Unique proxy browser with server side JavaScript / Compression engine for Series 40 » Engine that made Series 40 Web Apps possible, because most Series 40 devices do not have enough CPU/RAM to run a full WebKit based web browser » Nokia Browser Proxy hosts the Web App client, and acts as a proxy between the Nokia Browser Client and the Web App server, so can be described as ”Cloud-Assisted Web Runtime”
  • 7. Nokia Browser for Series 40 » Nokia Browser main features: › JavaScript runs on Nokia Browser Proxy server side › Application content compressed before sending to the client › CSS minimized, images compressed, partial HTML updates whenever possible » Current Nokia Browser main constraints: › HTML 4.01 with CSS 2.0 mobile profile (selected parts of CSS 3 also available) › Certain DOM events not supported (onkey*, onmouse*, ontouch*) › Limitations on animations (a limited set of transition timing functions available) › No device API access › No home screen widgets
  • 8. JavaScript and Mobile Web Library » Regular JavaScript statements are executed by the Nokia Browser Proxy server » JavaScript function calls in your code cause a round-trip to Nokia Browser Proxy » Special library called Mobile Web Library (MWL) provides client- local JS functions » Functions executed fully on the client side (Nokia Browser Client) » Used via a namespace called mwl
  • 9. › MWL is limited, however covers the most common use cases that can be run on the client side: › Running simple CSS transitions/animations Mobile Web › Handling gestures (swipe, Library - MWL long press) › Inserting new nodes to DOM › Implemented natively by the Nokia Browser Client
  • 10. Mobile Web Library - MWL CSS Manipulation Timers Misc addClass timer setInputValue removeClass stopTimer insertHTML toggleClass replaceChild switchClass scrollTo iterateClass loadURL setGroupTarget setGroupNext show hide toggle » In addition to these, MWL also provides functions for registering listeners for synthetic events (gestures) and navigation keys › addSwipeLeftListener(), addLongPressListener(), … › addNavLeftListener(), addNavUpListener(), …
  • 11. Common JavaScript Use Cases » Non-MWL JavaScript can be used almost as usual › Just keep in mind that it causes a round-trip to the Nokia Browser Proxy › Be especially careful when using 3rd party JS libraries (e.g. jQuery or jQuery Mobile) » Handling AJAX › No performance hit caused by the Nokia Browser architecture itself › No limitations with same origin security policies › Mashing up content from different sources possible! » Lazy loading vs. front loading › Round-trips can sometimes be avoided by front loading data at startup » Preparing DOM for mobile client use › E.g. building lists/tables to be inserted into the app
  • 12. Animations and Transitions » Certain properties can be animated locally on the client side: › Element’s width, height, margin-left and margin-top › Or a combination of these » Consequently, there are a few design patterns that are especially recommended › Accordion › Carousel › Tabs
  • 13. Animations and Transitions » These have certain common advantages/properties › Based on the principle of concealing/revealing content › Client-local, animated transitions can be easily added » When used correctly, unnecessary round trips to the Nokia Browser Proxy server are almost automatically avoided!
  • 15. Animating Margins …or… …or…
  • 16. Important Notes on Animations » Local Preview, Cloud Preview and an actual device will all work slightly differently, so don’t rely overly on the simulator. » GIF animations don’t work in the simulator but DO on the device. Be careful with GIF, because of high CPU usage » Contrary to regular browser scripting, animations on the Client are blocking » Only a single element can be animated at one time for performance reasons
  • 17. CSS Transitions » The Mobile Web Library allows you to run CSS transitions on the client side › No round trip to Nokia Browser Proxy server needed! › Devices not supporting animated transitions automatically fall back to discrete property changes » Use cases for transitions: › Accordion expanding › Going to a details view by clicking on a list item › Search box appearing/disappearing › Slide shows » Current limitations: › Properties you can animate: width, height, margin-left, margin-top › Only top-level CSS classes can be used with MWL in animations
  • 18. AnimatedPageChangeSample How it works Page #1 Page #1 Page #2 Page #1 Page #2 Page #2 Default positioning Then we wrap both We move Page #2 for the 2 pages (the pages in a container up by how high Page dashed line is the element (red), which #1 is, and to the viewport of the we can move right by how wide phone) sideways with an Page #1 is, so we get animation them side-by-side
  • 20. Browser Integration FAQ » Is it possible to integrate the app with the Nokia Browser back button? › No, this is not supported at the moment » Can I create custom items for the Nokia Browser options menu? › Not at the moment › If such funtionality is needed, create a custom implementation with HTML/CSS » Can I close my app from JavaScript? › No, there is no such MWL method or window.close() available in the current release
  • 21. Common Usage FAQ » How do I obtain the real screen resolution from JavaScript? › First of all: do you really need to do this? › Would flexible CSS be enough? › Known issue: user agent of the JavaScript context is not the same as the actual client – it is the Nokia Browser Proxy › Makes it difficult to get the actual resolution › Workaround: pass the real user agent to a 3rd party server for inspection to detect the device resolution › Client UA is sent in AJAX requests » CSS Compression challenges
  • 22. Qualify for a Asha 303 » Attend the webinar session. You name has to be on the attendee list. 1 entry per name » Send an email › web.apps@nokia.com to register your name › Subject “Asha 303 for May 3rd web app webinar” › State the intended application you are going to write and estimate publishing date » Publish your Series 40 web app to Nokia Store and pass QA. Send an email › web.apps@nokia.com with the name and link of your app in Nokia Store › Publishing date has to be between May 3rd and July 1st