SlideShare uma empresa Scribd logo
1 de 69
Baixar para ler offline
Windows Store app
development
FOYZUL KARIM
What is Windows 8 anyway?
Your own Start screen, Live
Share yourself
New ways of interaction
Touch and mouse
Searching made easy
App Store
And many more…
“   Okey… But I don’t know
    .NET…


    YOU MIGHT ASK!!!
                                                                  ”
Which programming languages does this Operating System support?
“   You can develop if you
    are…

                             ”
Web developer
HTML, CSS, Javascript, jQuery

                                    The web is native                    Build on what you
Distribute easily                   in Windows 8                         already have
Windows Store apps sell in more     Windows Store apps support most      Your best stuff is on the web
than 200 markets, with support      web standards like HTML5, CSS3,
                                    and JavaScript. Use common           and you don’t have time to
for local currencies in over 120    elements like canvas, SVG, video,    rebuild it. Windows Store apps
markets, and developers can         audio, 2D transforms, transitions    support the >iframe< element
localize their apps in more than    and animations just like you would
100 languages. Windows Store        when supporting many modern          and WebView controls so you
also offers full platform support   browsers. You can also use           can present your best content
                                    common frameworks and libraries      in a new way. You can even
for free apps, trials (time-based   like jQuery.
and feature-based) and paid                                              combine it with other coding
apps, including in-app              When you write your Windows          languages like C#, C++, VB,
purchase. The revenue share         Store app using web standards, it
                                    has access to all the underlying     and XAML into one powerful
base is 70%, but when an app        performance benefits of Windows      app.
achieves $25,000 USD in             8, including the high-performance
revenue—aggregated across           Chakra JavaScript engine, GPU-
all sales in every market—that      powered hardware acceleration
                                    and hardware sensors such as
app moves to 80% revenue            accelerometers, GPS and
share for the lifetime of that      gyroscopes.
app.
Windows Developer
C#, C++, VB
.NET
Build apps that                  Easier distribution                  Connect to the
reach more                       and app                              OS and cloud
people                           maintenance
Apps are core to the Windows     Access the Windows Store and         With the new Windows
8 experience, and with the       package your Windows Store           contracts, your app integrates
reach of the Windows install     app for distribution directly        seamlessly with other apps to
base and the Windows Store       within Visual Studio – all without   create powerful user
distribution channel, you have   having to build your own install     experiences like sharing,
the opportunity to reach         package. Once your app is            searching and file pickers with
hundreds of markets              available through the Windows        very little code. And through
worldwide. And unlike other      Store, you have access to            cloud roaming, you can create
platforms, Windows 8 apps        valuable telemetry data to           a continuous experience across
scale automatically across       monitor your app quality             devices by roaming data that
devices – all while using the    including JavaScript exception       lets people pick up a task right
same code.                       rate, crash rate and app             where they left off.
                                 responsiveness rate.
Ratio Interactive
Designers
Adobe photoshop, Illustrator
                                  Unleash your                          Elegant hardware
                                  creativity on a                       provides the
Speak a modern                    new digital                           perfect stage for
design language                   canvas                                your experience
Microsoft's design language       With Windows 8, your app is the       Windows 8 runs on amazing
was created with digital in       star of the show, as the              hardware, from tablets to
mind. It allows content to come   operating system fades to the         laptops to all-in-ones with large
to life and at the same time      background. Your app can              high-definition screens. It’s the
help maintain a consistent        take advantage of unique              perfect place to showcase
personality and experience for    features like live tiles, contracts   your creativity and vision
the user. The language            and cloud services to design          through the experiences you
provides a universal tool to      experiences that engage with          create.
craft great apps that scale       users in new ways.
gracefully across multiple
screen sizes.
So? Which platform do you prefer as
your development environment ?
Web platform   .NET platform   Others
Html           C#              C++
CSS            Visual Basic
JS
I prefer money. What about money?
Image courtesy: http://www.insidehousing.co.uk/pictures/643xAny/2/5/0/37250_MONEY_MAGNET.jpg
Earn from your apps
Choose business model wisely

Selling differently         Advertising                        Third party transactions
Collect full price before   Attention-grabbing ads that are    Develop your own payment
download                    not perceived as intrusive         system into your CRM or other
                                                               existing system
Time limited trial          Code that is easy to
                            integrate with both Windows 8
Feature limited trial       and your app to help prevent
In app purchase             crashes and protect battery life
                            Attractive revenue shares for
                            developers
                            The reach of Microsoft’s global
                            sales force and its strong
                            relationships
Getting started

    Get the tools
    Get the developer license
    Start development and create 'Hello World'
Windows Store app

    It runs on Windows 8 operating system
    It runs on both tablet and desktop environment at a time
    Compiled binaries of all supported languages are using same
     runtime engine
    Runtime engine is called WinRT
Windows 8 Platforms and Tools
High level overview
What tools do we need




Windows 8          Visual Studio 2012       Blend
Operating system   Integrated Development   Designing IDE
                   Environment
Developer license

 Visual studio                     Command prompt
 •   Getting a developer license   •   Getting a developer license
 •   Renewing the license
Application
development
Templates
JavaScript templates
C# Templates
Visual Basic Templates
C++ Templates
Blank application templates
JavaScript Application   C# Application   C++ Application
Deep Dive into JavaScript
Shall we?
Hello Rock Stars




http://starshapedrock.com/wp-content/uploads/2008/08/star1.jpg
HTML Code

 Code        Simulated output




            Image Courtesy http://starshapedrock.com/wp-content/uploads/2008/08/star1.jpg
I don’t see
any main
program
or starting
code?
My Gosh..
its Magic!!!
Application Manifest
Where the hell is JavaScript?
default.js
A tale of
Promise




            http://img9.joyreactor.com/pics/post/full/funny-pictures-auto-rage-comics-heck-no-383799.jpeg
What do we mean by promise?
In programming world?
http://wiki.commonjs.org/wiki/Promises
Promises provide a well-defined interface for interacting with an
object that represents the result of an action that is performed
asynchronously, and may or may not be finished at any given point in
time. By utilizing a standard interface, different components can
return promises for asynchronous actions and consumers can utilize
the promises in a predictable manner.




http://msdn.microsoft.com/en-us/library/windows/apps/br211867.aspx
A promise provides a mechanism to schedule work to be done on a value
that has not yet been computed. It is a convenient abstraction for managing
interactions with asynchronous APIs.
Promise.then
promise.then(onComplete, onError, onProgress).done( /* Your success
and error handlers */ );
WinJS.UI.processAll()

Returns Promise object
WinJS.UI.processAll().then()
Promise object has a method ‘then()’
WinJS.UI.processAll().then(
              function completed() {
document.getElementById("definitionButton").addEventListener("click",
buttonClicked);
                }
            )
Inside of the then method we add necessary code
args.setPromise(
         WinJS.UI.processAll().then(
           function completed() {
document.getElementById("definitionButton").addEventListener("click",
buttonClicked);
                  }
              )
         );
setPromise makes sure that splash screen isn't taken down until the
app's page is ready.
What else can promise do?
Strict Mode (JavaScript)

    Strict mode is a way to introduce better error-checking into your
     code.
    When we use strict mode, we cannot,
        use implicitly declared variables, or
        assign a value to a read-only property, or
        add a property to an object that is not extensible
Two examples

    "use strict"; function testFunction(){      function testFunction(){ "use strict";
     var testvar = 4; return testvar; }           testvar = 4; return testvar; } testvar
     testvar = 5;                                 = 5;
    variable declaration outside the            The variable declaration outside
     function causes the syntax error             the function does not cause a
     "Variable undefined in strict                syntax error, but the declaration
     mode."                                       inside the function does.
HTML
JavaScript code to change the div’s text
Output in
simulator
What about registering button
clicks?
Data Dash (data-*)
Custom data attributes are intended to store custom data private to the
page or application, for which there are no more appropriate attributes
or elements. [w3c]

 <div    id="contenthost"
         data-win-control="Application.PageControlNavigator"
         data-win-options="{home: '/pages/home/home.html'}">
</div>
Windows Controls
DATA-WIN-CONTROL
WinJS.UI.*
Windows controls in Javascript library
Rate this App!

Code               Output
Rate this App!
function to return the element




 Add the event listener




 Event description
Working with Data
Data binding
Style and Data
binding
Where do we
                               put the data?




http://i.imgur.com/FrCKi.jpg
Data storage locations

User data                     App data                          Server
Libraries accessed by the     Application Data APIs for the     HTML5 Application Cache
Windows Runtime StorageFile   Windows Runtime
and file pickers                                                Cookies
                              IndexedDB
SkyDrive                                                        Cloud Services, OpenData
                              Extensible Storage Engine (ESE)   Services, and Cloud Databases
HTML5 File API
                              HTML5 Web Storage
                              WinJS.Application.sessionState
                              WinJS.Application.local state
                              storage
                              WinJS.Application.roaming
                              state storage
Lets go to IDE…Thank you.

Mais conteúdo relacionado

Mais de Foyzul Karim

BizBook365.com 16Feb2018 Demo
BizBook365.com 16Feb2018 DemoBizBook365.com 16Feb2018 Demo
BizBook365.com 16Feb2018 DemoFoyzul Karim
 
Angular4 kickstart
Angular4 kickstartAngular4 kickstart
Angular4 kickstartFoyzul Karim
 
BizBook365 - Modern Inventory System for Shops
BizBook365 - Modern Inventory System for ShopsBizBook365 - Modern Inventory System for Shops
BizBook365 - Modern Inventory System for ShopsFoyzul Karim
 
Kickstart android development with xamarin
Kickstart android development with xamarinKickstart android development with xamarin
Kickstart android development with xamarinFoyzul Karim
 
Unit testing (workshop)
Unit testing (workshop)Unit testing (workshop)
Unit testing (workshop)Foyzul Karim
 
Windows store app development V1
Windows store app development V1Windows store app development V1
Windows store app development V1Foyzul Karim
 

Mais de Foyzul Karim (8)

BizBook365.com 16Feb2018 Demo
BizBook365.com 16Feb2018 DemoBizBook365.com 16Feb2018 Demo
BizBook365.com 16Feb2018 Demo
 
Angular4 kickstart
Angular4 kickstartAngular4 kickstart
Angular4 kickstart
 
BizBook365 - Modern Inventory System for Shops
BizBook365 - Modern Inventory System for ShopsBizBook365 - Modern Inventory System for Shops
BizBook365 - Modern Inventory System for Shops
 
Kickstart android development with xamarin
Kickstart android development with xamarinKickstart android development with xamarin
Kickstart android development with xamarin
 
Unit testing (workshop)
Unit testing (workshop)Unit testing (workshop)
Unit testing (workshop)
 
Windows store app development V1
Windows store app development V1Windows store app development V1
Windows store app development V1
 
Data types
Data typesData types
Data types
 
Linq
LinqLinq
Linq
 

Último

Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
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
 
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
 
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
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
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
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
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
 
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
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
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
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 

Último (20)

Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
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!
 
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
 
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
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
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
 
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
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
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
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 

Windows Store application development

  • 2. What is Windows 8 anyway?
  • 3. Your own Start screen, Live
  • 5. New ways of interaction Touch and mouse
  • 9. Okey… But I don’t know .NET… YOU MIGHT ASK!!! ” Which programming languages does this Operating System support?
  • 10. You can develop if you are… ”
  • 11. Web developer HTML, CSS, Javascript, jQuery The web is native Build on what you Distribute easily in Windows 8 already have Windows Store apps sell in more Windows Store apps support most Your best stuff is on the web than 200 markets, with support web standards like HTML5, CSS3, and JavaScript. Use common and you don’t have time to for local currencies in over 120 elements like canvas, SVG, video, rebuild it. Windows Store apps markets, and developers can audio, 2D transforms, transitions support the >iframe< element localize their apps in more than and animations just like you would 100 languages. Windows Store when supporting many modern and WebView controls so you also offers full platform support browsers. You can also use can present your best content common frameworks and libraries in a new way. You can even for free apps, trials (time-based like jQuery. and feature-based) and paid combine it with other coding apps, including in-app When you write your Windows languages like C#, C++, VB, purchase. The revenue share Store app using web standards, it has access to all the underlying and XAML into one powerful base is 70%, but when an app performance benefits of Windows app. achieves $25,000 USD in 8, including the high-performance revenue—aggregated across Chakra JavaScript engine, GPU- all sales in every market—that powered hardware acceleration and hardware sensors such as app moves to 80% revenue accelerometers, GPS and share for the lifetime of that gyroscopes. app.
  • 12.
  • 13.
  • 14. Windows Developer C#, C++, VB .NET Build apps that Easier distribution Connect to the reach more and app OS and cloud people maintenance Apps are core to the Windows Access the Windows Store and With the new Windows 8 experience, and with the package your Windows Store contracts, your app integrates reach of the Windows install app for distribution directly seamlessly with other apps to base and the Windows Store within Visual Studio – all without create powerful user distribution channel, you have having to build your own install experiences like sharing, the opportunity to reach package. Once your app is searching and file pickers with hundreds of markets available through the Windows very little code. And through worldwide. And unlike other Store, you have access to cloud roaming, you can create platforms, Windows 8 apps valuable telemetry data to a continuous experience across scale automatically across monitor your app quality devices by roaming data that devices – all while using the including JavaScript exception lets people pick up a task right same code. rate, crash rate and app where they left off. responsiveness rate.
  • 16. Designers Adobe photoshop, Illustrator Unleash your Elegant hardware creativity on a provides the Speak a modern new digital perfect stage for design language canvas your experience Microsoft's design language With Windows 8, your app is the Windows 8 runs on amazing was created with digital in star of the show, as the hardware, from tablets to mind. It allows content to come operating system fades to the laptops to all-in-ones with large to life and at the same time background. Your app can high-definition screens. It’s the help maintain a consistent take advantage of unique perfect place to showcase personality and experience for features like live tiles, contracts your creativity and vision the user. The language and cloud services to design through the experiences you provides a universal tool to experiences that engage with create. craft great apps that scale users in new ways. gracefully across multiple screen sizes.
  • 17.
  • 18.
  • 19.
  • 20. So? Which platform do you prefer as your development environment ? Web platform .NET platform Others Html C# C++ CSS Visual Basic JS
  • 21. I prefer money. What about money? Image courtesy: http://www.insidehousing.co.uk/pictures/643xAny/2/5/0/37250_MONEY_MAGNET.jpg
  • 22. Earn from your apps Choose business model wisely Selling differently Advertising Third party transactions Collect full price before Attention-grabbing ads that are Develop your own payment download not perceived as intrusive system into your CRM or other existing system Time limited trial Code that is easy to integrate with both Windows 8 Feature limited trial and your app to help prevent In app purchase crashes and protect battery life Attractive revenue shares for developers The reach of Microsoft’s global sales force and its strong relationships
  • 23. Getting started  Get the tools  Get the developer license  Start development and create 'Hello World'
  • 24. Windows Store app  It runs on Windows 8 operating system  It runs on both tablet and desktop environment at a time  Compiled binaries of all supported languages are using same runtime engine  Runtime engine is called WinRT
  • 25.
  • 26. Windows 8 Platforms and Tools High level overview
  • 27. What tools do we need Windows 8 Visual Studio 2012 Blend Operating system Integrated Development Designing IDE Environment
  • 28. Developer license Visual studio Command prompt • Getting a developer license • Getting a developer license • Renewing the license
  • 35. Blank application templates JavaScript Application C# Application C++ Application
  • 36. Deep Dive into JavaScript Shall we?
  • 38. HTML Code Code Simulated output Image Courtesy http://starshapedrock.com/wp-content/uploads/2008/08/star1.jpg
  • 39. I don’t see any main program or starting code? My Gosh.. its Magic!!!
  • 41. Where the hell is JavaScript?
  • 43. A tale of Promise http://img9.joyreactor.com/pics/post/full/funny-pictures-auto-rage-comics-heck-no-383799.jpeg
  • 44. What do we mean by promise? In programming world?
  • 45. http://wiki.commonjs.org/wiki/Promises Promises provide a well-defined interface for interacting with an object that represents the result of an action that is performed asynchronously, and may or may not be finished at any given point in time. By utilizing a standard interface, different components can return promises for asynchronous actions and consumers can utilize the promises in a predictable manner. http://msdn.microsoft.com/en-us/library/windows/apps/br211867.aspx A promise provides a mechanism to schedule work to be done on a value that has not yet been computed. It is a convenient abstraction for managing interactions with asynchronous APIs.
  • 46. Promise.then promise.then(onComplete, onError, onProgress).done( /* Your success and error handlers */ );
  • 49. WinJS.UI.processAll().then( function completed() { document.getElementById("definitionButton").addEventListener("click", buttonClicked); } ) Inside of the then method we add necessary code
  • 50. args.setPromise( WinJS.UI.processAll().then( function completed() { document.getElementById("definitionButton").addEventListener("click", buttonClicked); } ) ); setPromise makes sure that splash screen isn't taken down until the app's page is ready.
  • 51. What else can promise do?
  • 52. Strict Mode (JavaScript)  Strict mode is a way to introduce better error-checking into your code.  When we use strict mode, we cannot,  use implicitly declared variables, or  assign a value to a read-only property, or  add a property to an object that is not extensible
  • 53. Two examples  "use strict"; function testFunction(){  function testFunction(){ "use strict"; var testvar = 4; return testvar; } testvar = 4; return testvar; } testvar testvar = 5; = 5;  variable declaration outside the  The variable declaration outside function causes the syntax error the function does not cause a "Variable undefined in strict syntax error, but the declaration mode." inside the function does.
  • 54. HTML
  • 55. JavaScript code to change the div’s text
  • 57. What about registering button clicks?
  • 58.
  • 59. Data Dash (data-*) Custom data attributes are intended to store custom data private to the page or application, for which there are no more appropriate attributes or elements. [w3c] <div id="contenthost" data-win-control="Application.PageControlNavigator" data-win-options="{home: '/pages/home/home.html'}"> </div>
  • 61. WinJS.UI.* Windows controls in Javascript library
  • 63. Rate this App! function to return the element Add the event listener Event description
  • 67. Where do we put the data? http://i.imgur.com/FrCKi.jpg
  • 68. Data storage locations User data App data Server Libraries accessed by the Application Data APIs for the HTML5 Application Cache Windows Runtime StorageFile Windows Runtime and file pickers Cookies IndexedDB SkyDrive Cloud Services, OpenData Extensible Storage Engine (ESE) Services, and Cloud Databases HTML5 File API HTML5 Web Storage WinJS.Application.sessionState WinJS.Application.local state storage WinJS.Application.roaming state storage
  • 69. Lets go to IDE…Thank you.