Building Windows 8 blog
Windows Store for developers blog
Visual Studio blog
The Windows blog
Inside SkyDrive blog
Download Windows 8 Release Preview
Windows Dev Center
Follow us @WinDevs
The //build/ conference
Developer forums
For Windows 8, the Bing team built News, Weather, Finance, Sports, Travel and Maps apps. This technical overview provides insight on the architecture of these apps, key Windows 8 features and the contracts they use, common controls they employ, and world readiness more generally.
Several members of the Bing team formed an apps team approximately one year ago to deliver a set of apps powered by Bing for Windows 8. The focus of these apps is to keep users informed by delivering fast and fluid experiences, with content from multiple sources. All the apps are optimized for touch and tablet devices, but also work great with a keyboard and mouse. We have spent the last several months making these apps world-ready.
When developing the apps, we had two objectives: to build a set of great apps to make Windows 8 even more compelling and to serve as a model for app developers. With this post, we provide you with a technical overview of the apps and offer insight/resources you can use to develop your own apps. Through the process, we learned a lot – even a few things we’d do differently next time. Keep reading for the full story.
Weather app: Find the weather conditions for your places of interest.
All our apps are written in HTML/Java Script, except the Maps app, which is built in XAML/C#. All the apps share a common client platform that provides several essential services, such as instrumentation, caching, query services, settings, roaming, profile management, market customizations, and speech fundamentals. We deliberately chose to have client side caching, to invest in prefetching and for the client to set the time to live of various pieces of data for a couple reasons.
Our apps are designed for all PC devices, many of which we expect to be tablet devices. Windows 8 tablets can be used to consume content as well as create content by consumers and businesses alike. In many situations, we know users go through various states of connectivity (fully connected on fast networks, weak connectivity over WiFi or cellular, flaky networks, and even no connectivity). Our goal was to build a rich client app that’s different from a webpage. We used IE concepts of caching all network data to the file system and re-using cached data while waiting for fresh data to arrive. We also designed experiences for when cached data wasn’t available and network requests failed. For these scenarios, we, provide graceful error messages, retry mechanisms and listen for network connectivity changes from the OS to automatically trigger a retry.
Our apps use several services that are built on the Bing stack and/or in Windows Azure. The Bing services and data are served via dedicated application servers built on the Bing platform. For example, the Finance app heavily uses data and services from Azure, whereas data and services for the Maps app are provided via the Maps control, which is built by the Bing Maps team. Our apps also have other articles, images and videos that are hosted in our Content Management System. If you want to create apps that take advantage of the Bing web index or industry leading publisher data, check out the Windows Azure Marketplace, where you can access the Bing Search API and info from leading publishers like STATS Sports or agencies like the United Nations.
Supporting hundreds of millions of users interacting with rich apps that are powered by lots of data and content requires a lot of server computing. To scale the hardware needs along with the number of users, we have invested heavily in caching at different tiers. Our content management system rendering server, services in Azure, as well as the local client platform itself cache data to reduce the server load. If you’re anticipating several thousand users, consider local caching as a means to limit server computing and to improve the user experience – you can find out more about app caching (AppCache) on the Dev Center.
Some of the ways our apps make use of caching on the client involve:
Design is a fundamental differentiator for our apps and plays a key role in building visually organized and intuitive to use apps. To achieve a consistent look and feel and a visually immersive experience across our apps, we built custom controls on top of the compelling UI controls that Windows provides. If you want a consistent look and feel across your apps or want to deliver against a signature user interface, we encourage you to take advantage of the flexibility of Windows and build your own UX framework or custom controls on top of Windows 8. There are ample resources available on MSDN to help you create your own UX framework and custom controls.
If your app relies upon data from a 3rd party, plan on full outages as well as partial outages from your data providers from time to time. We strive to make our apps avoid single points of failure and we build in several failsafe mechanisms. We invested in various failsafe practices on both the server and client side primarily for the benefit of our users. Across all our apps, we have data and services from many parts of Microsoft as well as industry partners. All these external sources have varying degrees of uptime SLAs and TTM (time to mitigate) service level outages. Any given panorama on any application could rely on data and services from multiple sources. To provide a good end user experience, we use failsafe techniques both on the server and client side, including caching, backup providers, graceful degradation of features or falling back on acceptably stale data in some cases (for example, destination information). Think about these failsafe measures and take steps to create adaptive UI and error messaging when design and develop your app, not during or after a data failure.
One question developers frequently ask is why we implement using client-side HTML, rather than server-based HTML5. The short answer is that apps on Windows 8 are not websites. Creating a great Windows Store app requires a deep level of integration with the platform that we simply cannot achieve with standard web code. If we had delivered features purely via the same HTML5 normally viewed in the browser, the pages would not have had access to the features of Windows 8 that really make the user experience great.
Building an app gave us several advantages, including:
Developing for Windows offers a standard set of experiences (screen size, touch targets, view states, orientation dimensions, among others). We wanted to tailor our code to offer the best user experience, given the user’s device. A one size fits all HTML5 experience doesn’t let us deliver a consistent and optimized user experience.
As I mentioned earlier, one of our objectives was to serve as a role model for 3rd party app developers. We wanted to call out several key Windows 8 features and contracts that we’ve implemented in an effort to make our apps more compelling for consumers as well as highlight what’s possible for you in Windows 8:
All apps offer navigation in the top app bar and contextually-relevant command buttons in the bottom app bar. These are accessed via a gesture (swiping down from the top of the screen or up from the bottom).
Maps app – app bar
Every app features a carefully designed snap mode. We didn’t just replicate all the features of the app in a narrower view. Instead, we thought about how the app might be used when snapped. In News for example we provide quick access to the list of stories, but don’t have a mini reading mode. We expect users to go back to full screen when they want to read. In Finance, the snapped view focuses on the main indices and your stock watchlist. In Weather, the snapped view provides a summarized description of the weather in the upcoming days.
Weather app & Finance app – Snap mode
All of our apps supports the share source contract. This contract allows us to send data to share targets like the Mail or People application.
News app – Share
The Maps app supports the print contract to print maps, details, directions, and search results.
The Weather app uses the lock screen to inform the user of current weather conditions, without having to unlock and run the app, or even go to the Start menu.
Except Maps, all our apps have Live Tiles and offer consumers useful notifications such as the latest news headlines, weather conditions and sports scores or other interesting information. So even on the Start screen, these apps are alive with activity, encouraging users to launch the app to find out more.
Every application supports the search contract, via the search charm. The search charm continues to be the place consumers can find local files, apps, and other information in Windows 8.
Travel App - Search
Every application supports the settings charm. The settings charm provides users a consistent way to access settings across all apps.
Our panoramas and list views support semantic zoom, a touch-optimized technique for presenting and navigating large sets of content within a single view. Because our apps are content-heavy with many groups of information, semantic zoom allows a user to get an overview of all that content, and jump directly to a group of interest.
Each app makes use of the new Windows 8 language manager and home location settings to optimize for the best experience for the user. As users start learning about these settings and see that apps respect them, all apps will get better as a result.
One of our goals in developing our apps was to offer all users the great level of accessibility and productivity provided by the news Windows 8 UI. Below are some highlights of the accessibility work we did for our apps.
While each of our apps provides unique info and functionalities, they all share the same general UI design that visually ties them together. For example, the navigation buttons in the top app bar look and work the same way in all our apps. And the news articles in the Sports app share the same visual elements as those in the Finance app.
It was a critical goal for us was to make our apps look and feel the same. Sticking to basic Windows guidelines and principles, we wanted all our apps to have a common workflow for accomplishing basic tasks, such as adding a stock ticker in the Finance app or adding a location in the Weather app. A common interface makes it more intuitive for users to interact with multiple apps. From an engineering standpoint, it enabled us to share a larger code base between our different apps and freed our engineers to focus on building differentiating app-specific features. To achieve this goal, we built several custom UX controls (details below) specific to our apps that are used by the Finance, Weather, Sports, Travel, and News apps.
There are many basic intrinsic controls available in HTML for developers to leverage, such as buttons and text boxes. On top of these, WinJS provides richer controls that have more complex UI and business logic, such as list view and app bar. When identifying which controls to use for the visual elements in our apps, we made sure to reuse intrinsic or WinJS controls as much as possible. In cases where we needed more sophisticated UI or business logic, we built custom controls that follow the WinJS guidelines. Some of our custom controls are composite controls made up of base WinJS and HTML controls, while some are derived from WinJS controls, and others are written from the ground up.
By building custom controls using the same principles as WinJS controls, we made it easy for our engineers to seamlessly develop and debug apps that use both WinJS and custom controls. More importantly, by building for WinJS templates, the presentation layer of our controls (HTML/CSS) is isolated from the business logic (Javascript). Here are a few key principles that we followed:
We took advantage of the hardware accelerated performance and many great new features of CSS3 to build the layout of our controls.
In general, we made sure to push as much of our layout logic to CSS as possible in order to maintain a high frame rate and UI fluidity.
There are over a dozen custom controls that our apps use to enhance the experience for users. Here’s are 2 controls that take advantage of the infrastructure described above:
News app – Article Reader control
Given the global reach of the Windows Store, we anticipate you might want to make your apps extensible to different markets and languages. As mentioned previously, all our apps are available in all supported Windows markets. We elected to build for all supported Windows market as a means to get our apps to as many Windows customers as possible. This section highlights the key components of work we did to get all our apps world-ready.
Some market-specific features in our apps:
Between RTM and GA for Windows 8, the teams went through a milestone of performance improvements. Some of the areas that were worked on include:
In addition to encouraging you to try out our apps and send us your feedback, we’d like to hear from you! Please leave us a comment and tell us more about your experiences building apps for Windows 8. Let us know if you have questions, and we’ll be happy to provide more detail. We’d also appreciate you letting us know what we could provide you to help you develop apps for Windows 8.
--Jigar Thakkar, Partner Development Manager, Application Experiences Team