Windows 8 Integration: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
Line 7: Line 7:
[[file:WIndows8Breakdown.png|sreenshot]]
[[file:WIndows8Breakdown.png|sreenshot]]


== Access to builds and devices ==
== Access to builds ==


Everyone doing work in this area should have access to early builds. What’s needed to accomplish this?
Everyone doing work in this area should have access to early builds. What’s needed to accomplish this?
Line 14: Line 14:
** Download latest Win8 DP from Microsoft [http://msdn.microsoft.com/en-us/windows/apps/br229516 HERE]
** Download latest Win8 DP from Microsoft [http://msdn.microsoft.com/en-us/windows/apps/br229516 HERE]
** Instructions on creating a bootable USB key [http://social.msdn.microsoft.com/Forums/en-US/windowsdeveloperpreviewgeneral/thread/661d46c3-f6b9-41a4-a696-9d8c225208b6 HERE]
** Instructions on creating a bootable USB key [http://social.msdn.microsoft.com/Forums/en-US/windowsdeveloperpreviewgeneral/thread/661d46c3-f6b9-41a4-a696-9d8c225208b6 HERE]
Everyone working in this area needs hardware. MSDN says "any win7 hardware should work?  [http://blogs.msdn.com/b/b8/archive/2011/09/13/experiencing-windows-8-touch-on-windows-7-hardware.aspx Here's what MS has to say] What do we have experience with or recommend?
* Touch screen desktops
** .
* Touch screen laptops
** .
* Tablets
** .


== Internet Explorer 10 ==
== Internet Explorer 10 ==

Revision as of 05:03, 30 October 2011

Intro

Microsoft Windows 8 will be the next version of the Windows operating system which is aimed at desktops, laptops, netbooks, tablets, servers, and media center PCs.

A major part of Windows 8 is the introduction of Metro-style applications which are based on a new application development and distribution framework. This document will summarize the changes and challenges of Metro-style development of 3rd party browsers.

sreenshot

Access to builds

Everyone doing work in this area should have access to early builds. What’s needed to accomplish this?

  • Does MSDN or Microsoft Connect or any other program get us earlier access to Win8 or Win8 tools?
    • Download latest Win8 DP from Microsoft HERE
    • Instructions on creating a bootable USB key HERE

Internet Explorer 10

  • TBD

Windows Store

  • Big question: would there be licensing and certification issues similar to iOS?
    • "Store policy and various runtime restrictions automatically exclude certain types of apps, which can only be implemented as desktop apps." (link)
  • Automatic updating - working within the confines of Microsoft's update mechanism

Metro Architecture

  • Unlike Desktop, Metro apps will ONLY be available through the Windows store.
  • There are no overlapping windows, nor traditional popup windows, everything is chromeless, everything is designed to be consistent across applications.
  • Some interprocess communication is possible within Metro, but it is very limited.
  • Not possible to simply and easily port existing apps to Metro. A significant amount of conventional desktop functionality will not be available.
  • A second app can be shown in Metro app with the snap state. It is shown side by side and you can determine the width of each window via a separator.
  • The top and bottom edges are for per app toolbars. The left and right edge are reserved for system toolbars (This my require Fennec redesign if we end up using it for Metro).
  • You can schedule popup notifications when your Metro app is not running.

Sandbox Security Model

Metro applications are run in a sandbox/jail environment called the "app container". Process Explorer can show this information for a given process. The sandbox ensures that no application can modify the system or access data from another application directly.

Most of the calls from the process to kernel are direct, but some of them like reading a file or accessing the webcam needs special permission. These calls are proxied through a broker that might ask the user for consent. Most resources that an app requires need to be specified as "capabilities" in a manifest file that is bundled with the binaries.

Language support

  • Applications can be built in Javascript, C++, C#, or VB.NET
  • WinRT is available in each language through the `Windows` namespace

C++

  • Compiles to native code but has some extra syntax flare.

HTML and Javascript

  • WinJS library provides access to WinRT
  • "Chakra" engine uses metadata to generate js/html projections of WinRT objects dynamically

API Spec

WinRT / Win32 / COM

  • General WinRT overview and porting guide Link
  • Windows Runtime (WinRT) Link
  • Win32 & COM support Link

Graphics

  • Subset of Direct2D, Direct3D, DirectWrite drawing apis supported. Link

Networking

  • Win32 WS* APIs Link
  • WinRT Networking Link

Suspend/resume

  • Most of this info comes from this video on Metro app suspension
  • There is no multi-tasking of Metro apps: Only one app runs unsuspended at a time, apps are suspended when not in foreground
  • Desktop is treated as one app; all other Metro apps are suspended when desktop is active
  • Upon suspension, app gets notification that it is being suspended
    • At this point, app must save state because it could be terminated later without notice
    • App gets 5s to handle suspend, otherwise crashes
  • During suspension
    • App is not scheduled by the NT kernel
    • No CPU, Disk, Network consumption
    • All threads suspended
    • App remains in memory
  • App is instantly resumed when brought to foreground
  • Suspension best practices:
    • Save state quickly (<5s)
    • Assume you will be terminated: Save user session data
    • Update app's tile
    • Release exclusive access to shared resources (files, devices, network, etc)
    • Save app data incrementally before suspend

Registering callbacks for suspend and resume (JS)

//Register for the Suspending event and call suspendingHandler when received
Windows.UI.WebUI.WebUIApplication.addEventListener("suspending", suspendingHandler); 

//Handle the suspending event and save the current user sesssion using WinJS sessionState
function suspendingHandler(eventArgs) {
  //We are getting suspended
}

//Register for the Resuming event and call resumingHandler when received
Windows.UI.WebUI.WebUIApplication.addEventListener("resuming", resumingHandler);

function resumingHandler() {
  //We are getting resumed, in general do nothing
}

Activation Example (JS)

//Register handler for activation event
Windows.UI.WebUI.WebUIApplication.addEventListener("activated", activatedHandler);

function activatedHandler(eventArgs) {
  if (eventArgs.kind == Windows.ApplicationModel.Activation.ActivationKind.launch) {
    //Tile activation initialization logic here
  }
  else if (eventArgs.kind == Windows.ApplicationModel.Activation.ActivationKind.shareTarget) {
    //Share activation initialization logic here
  }
  //etc...
}

Live tiles

  • Apps that have tiles implement the `Windows.Launch` contract
  • Tile is specified by an XML file that follows a template (limited number of templates provided by Windows?)
  • Tile (XML) can be updated while app is running
  • Tile can be updated using push notifications
    • Push new tile XML to a URI provided by "Windows Push Notification Service" (WNS)
    • WNS pushes tile to user's device

Contracts

  • There is a new concept called contracts for interconnection/sharing with different metro apps.
  • Implementing contracts provides more integration with the OS (e.g. with the "charms" toolbar)
  • Known contracts are:
    • Windows.BackgroundTasks
    • Windows.File
    • Windows.FilePicker
    • Windows.Launch - Apps that implement this get a tile in the Windows 8 Metro "desktop"
    • Windows.Protocol
    • Windows.Search
    • Windows.ShareTarget
  • Information about which apps fulfill each contract is maintained in the registry
    • HKCU\Software\Classes\Extensions\ContractId
    • One key for each type of contract, subkeys are registrations for all extensions that implement that contract
  • Apps can be activated through the contracts they implement
    • Event args provide context

Hardware Configurations

Computers and peripherals that work well with Windows 8.

  • HP TouchSmart 9300 Elite
    • Multi-touch capable (up to two fingers)
    • Beefy enough to build code on it
    • Not very portable

Computers and peripherals that DONT work well with Windows 8.

  • Wacom Bamboo tablet
    • Current generation of drivers do not generate native touch events


Links