Quantcast
Channel: Building Apps for Windows
Viewing all 623 articles
Browse latest View live

More Countries, More Languages, Improved targeting when buying ads to promote your apps

$
0
0

In June, we launched a feature in Dev Center that allows you to purchase ads to promote your app. This feature is one of several options available to promote your app, including Windows Store badges, the Microsoft Affiliate Program, and promotional codes. The promote your app feature offers two promotion choices: paid ads that run in other apps using the Microsoft Advertising SDK, and house ads (free ads) to cross-promote an app in other apps you’ve published in the Store. For more information on the Microsoft Advertising SDK, please read the New advertising features and walkthrough of using Microsoft ads and mediation blog post.

Today we’ll talk about new options for the promote your app feature that launched last week, with increased availability and languages, customized targeting options, and an additional reporting view. These features are designed to improve the effectiveness of your ads, driving more customers to download and try your apps:

  • Support for 51 new markets
  • Localized text used in your ad image
  • Reach estimates
  • Recommended settings for campaign targeting
  • OS targeting
  • World map reporting view

More countries in more languages

Support for 51 new markets

The promote your app feature is now available in 66 markets, up from 15. Developers from any market can purchase these ads, and run them in any of the supported markets.

Current Markets 
Australia New Zealand
Belize Philippines
Canada Singapore
Hong Kong SAR South Africa
India Trinidad and Tobago
Ireland United Kingdom
Jamaica United States
Malaysia
New Markets
Algeria Colombia Honduras Nicaragua Sweden
Argentina Denmark Indonesia Norway Switzerland
Austria Dominican Republic Iraq Oman Taiwan
Bahamas Ecuador Italy Panama Thailand
Bahrain Egypt Jordan Paraguay Tunisia
Barbados El Salvador Kuwait Peru United Arab Emirates
Belgium Finland Lebanon Puerto Rico Uruguay
Bolivia France Mexico Qatar Venezuela
Brazil Germany Morocco Saudi Arabia Vietnam
Chile Guatemala Netherlands Spain
China Haiti

Localized creatives

When creating ad images for campaigns, text options have previously been available only in English. Now, images can be created with text in 15 languages:

Arabic German
Chinese (Simplified) Italian
Chinese (Traditional) Norwegian
Danish Portuguese (Brazil)
Dutch Portuguese (Portugal)
English Spanish
Finnish Swedish
French

The text for the Windows Store badge, as well as the custom text, will show in the language you select for that campaign. You have to localize the custom text before putting it into the campaign, and then the Windows Store badge will auto-populate with the language you select. Below is an example of an ad in English and the version with Spanish localization:

1_localizedEn2_localizedEs

Targeting Improvements

Reach estimates

While creating a campaign with custom targeting, Dev Center will now provide you an estimate of the Windows users that will see your ad. The graph shows your current targeting selections as a percentage of all Windows ad-enabled app users in the selected markets. This allows you to adjust your targeting settings to ensure you’re reaching an acceptable number of Windows customers, and maximize the benefit of your campaign.
3_estimatedReach

Recommended settings for campaign targeting

There are two new options for campaign targeting: “auto targeting” and “manual targeting”. When you choose “auto targeting”, we will pick the best targeting options based on the app’s install history, category, and various other attributes. When you choose “manual targeting”, Dev Center will preselect your target audience with the recommended settings, and you can adjust these settings as you see fit. The recommendations are calculated based on the historical install base for that particular app, and calculations for new apps are based on similar apps in the Store.
4_audience

OS targeting

You can now select which operating system you’d like to target in your ad campaign. You can choose phone, PC/tablet, or both, and narrow it further by choosing Windows 8.x systems and/or Windows 10 systems. Your options will be limited to your app’s availability on each OS, so for example if your app only targets Phone users on 8.x systems, this will be the only option available to you.

5_osTarget

World map reporting view

The world map view is an advertising performance report that shows your eCPM and ad impressions on a global scale. It allows you to see which markets are the most profitable, somewhat profitable, and minimally profitable.   Ad performance can still be seen as a graph view if you prefer, the map view just adds an additional level of detail. To view the world map view, simply click on the “Map” option under Advertising performance.

6_adPerf

As we continue to roll out new features and tools for Dev Center, please let us know if there are issues (via developer support) or new features you’d like to see included in future releases (user voice).


MSDN Magazine: Special Windows 10 Issue

$
0
0

MSDN magazine has released a special Windows 10 issue. The issue spans a large number of topics from Visual Studio tooling to game development to user experience to notifications.

If you don’t get the print magazine, don’t worry, all the articles are online for free.

Here is the complete list of articles:

Some of these topics have been covered by Building Apps blog in the past but most have been expanded for the magazine. If you have any topics you’re looking for Building Apps blog to cover, please tell us in the comments or at @WindowsDev

Windows 10 UWP app templates for Adobe Photoshop

$
0
0

Until now, Universal Windows Platform app design templates were only available in Adobe Illustrator and PowerPoint. Sparked by your feedback at Build 2015, the UWP design templates now include Adobe Photoshop. Gain access to the latest and greatest UWP design elements including common controls, patterns, theme colors, and type styles. To get started, simply copy elements from the templates into your own Photoshop files. Using the templates will help you achieve polished designs more quickly and provide a more accurate glimpse of what your UI will look like as a finished product. If you want to create an app that fits within the Windows family, these are a great tool for you.

There is a template with nine different screen sizes for creating mockups which can help you visualize how your app will scale across all devices, from the smallest phone to a large desktop. We look forward to seeing what you’ll create next and encourage you to check back for updates to the templates as Windows evolves. If you have additional feedback, head over to the Windows platform developer User Voice

Download the UWP app design templates for Adobe Photoshop

Related Links

Controls

2_controls 1_controls

Fonts

3_fonts

Colors

4_colors

Screen sizes

5_screens

Announcing DragonBoard 410c support in Windows 10 IoT Core, Arduino partnership updates

$
0
0

It’s been an exciting time over the last six months with our first release of Windows 10 IoT Core during //build/ 2015, the first public release in early August 2015, and most recently a new Windows Insider Preview release. Today I’m pleased to share what’s next for Makers on Windows 10 with new support for the DragonBoard 410c and an update for our Arduino partnership – with more to come.

DragonBoard 410c support

At WinHEC 2015 in Shenzhen, we announced with Qualcomm that support for Windows 10 IoT Core on the DragonBoard 410c was coming. The wait is over, and it is available today as a public preview through the Windows Insider Program!

Windows 10 IoT Core now supports the following capabilities of DragonBoard 410c above and beyond what’s already supported on other ARM platforms:

  • Onboard WiFi and Bluetooth
  • DirectX graphics

We are very excited to add the DragonBoard 410c, which features the Qualcomm® Snapdragon™ 410 processor to our family of supported Windows 10 IoT Core devices! You can get started here.
1_DragonBoard410
DragonBoard 410c

Arduino Partnership

At //build/ 2015 we announced our Windows partnership with Arduino, and Windows became the first Arduino certified OS. We also announced two bridging technologies designed to connect the physical world of Arduino with the Windows ecosystem and computing power – Windows Virtual Shields for Arduino and Windows Remote Arduino.

You can now get the Windows Insider Preview of Windows 10 IoT core with the next four technology investments as part of our Arduino partnership:

  1. Windows 10 IoT Core Universal Windows Platform (UWP) support for Arduino Wiring
  2. Windows 10 IoT Core Universal Windows Platform support for direct memory mapped UWP Providers
  3. Windows Store availability of the Windows Virtual Shields Application
  4. Windows Store availability of the Windows Remote Arduino Experience Application

Arduino Wiring

We want to make it easy for you to use existing Arduino Wiring Sketches, libraries, and hardware with Windows 10 IoT Core Universal Windows Apps (UWA) on a Raspberry Pi 2 or other supported board. By creating a new Visual Studio template, supporting NuGet Packages, and platform improvements we’re making it easier than ever to build on Windows 10 IoT Core.

Simply drag-and-drop (or cut-and-paste) your favorite and readily-available Arduino Wiring INO and library files into Visual Studio, connect your hardware over GPIO, SPI, I2C, ADC or PWM to your Raspberry Pi 2 or other supported Windows 10 IoT Core device, and run your code. Visual Studio and Windows will do all the heavy lifting to create a UWA and deploy it on your behalf, and you can also leverage the power of Visual Studio with Windows to debug your Arduino Wiring code.

With Arduino Wiring being supported as an extension to the Universal Windows Platform, you can even create a UWA that combines Arduino Wiring, C# and XAML. This enables you to build great projects with mixed mode programming like the plotter near the end of this video. Try out Arduino Wiring here.

2_plotter
Mixed mode plotter using a Raspberry Pi 2, Windows 10 IoT Core and Arduino Wiring

Windows Virtual Shields for Arduino Application

This technology lets you leverage sensors and actuators on your Windows 10 device from an Arduino over USB, WiFi, and Bluetooth. For example, you can access your Windows 10 Phone accelerometer or your Windows 10 Desktop Screen from an Arduino over WiFi.

The Windows Virtual Shields for Arduino application is now in the Windows Store, and has improved the workflow to get started. The app is all you need on the Windows 10 device. Try it out here.

3_slotCars
Windows IoT Core, Raspberry Pi 2 and Windows Phone controlling slot cars

Windows Remote Arduino Experience

This technology lets you develop on your Windows 10 device and access the physical world via an Arduino over USB, WiFi, and Bluetooth. For example, you can program in C# on your Windows 10 Phone and drive a servo connected on your Arduino over Bluetooth.

We also created a Windows app that enables you to explore GPIO, ADC, and PWM functionality without writing any code on your Windows 10 device. The Windows Remote Arduino Experience app is now available in the Windows Store. Give it a try!

High Performance Option for GPIO, SPI, and I2C

You can also get a Windows Insider Preview of a new, performant direct memory mapped driver model. This new memory mapped driver model that is 60-90 times faster than the inbox driver, resulting in GPIO pulse rates of over 4 MHz. If you’re using the Arduino Wiring support described above then you will be able to configure it to use this driver.

We have created UWP providers for the GPIO, SPI, and I2C busses that enable you to leverage the performance improvements of the direct memory mapped driver with only very small changes to your existing code. To learn more click here.

We can’t wait to see what you’ll make.

Windows App Studio Release – Windows 10 Store Package support and other new features

$
0
0

The Windows App Studio Windows 10 Store Support Release is now available, allowing you to easily create and publish a universal Windows app in record time with no code required. This release builds on the foundation created with July’s App Studio Windows 10 Preview release. You can directly submit your app to the Store through Dev Center, now with no intermediate step in Visual Studio required. In addition, this release brings a host of other new features.

New Features:

Windows 10 Store Package with Screen Shots

Windows App Studio now generates a Store package for your Windows 10 apps, including automatically created screenshots for the Store listing.

Immersive Simulator (full screen web view)

No one wants to preview their app only in a tiny viewport. Included with this release is a big full screen simulator into Windows App Studio. Now it’s easy check out the app you’re building and interact with it in a full screen mode as you’re working on it.

Windows App Studio Collection App

Wouldn’t it be great if you could easily manage the contents of a collection for an app without making any update to the app itself? Now you can with the newly released Windows App Studio Collection App available here. This app lets you easily manage the collections for all your apps in real time without the need to go to the Windows App Studio website. Update the data in the app and it will update the data in your relevant projects and apps with no additional actions required.
1_collectionsWoofWoof

Live Tiles Editor

You can now design dynamic Live Tiles for your Windows 10 apps from within Windows App Studio. This will work on any Windows 10 app you create with the exception of Hosted Web Apps. With this tool, you fully customize your Live Tiles to make your app more dynamic for your customers when they view it from the Start menu or on a Windows 10 mobile device.
2_LiveTileEditor

…and more, including:

  • Advanced theme and icon editors
  • Better sideloading support for Windows 10 apps
  • Hero Image Editor
  • Improvements to the UX in apps generated with added visual features
  • Initial Windows 10 IoT support
  • Windows App Studio NuGet packages
  • Source code on GitHub for libraries and sample apps

As many of you already know, with Universal Windows apps the same app can run on PCs, Mobile devices, and Raspberry Pi 2s and other IoT devices. Windows Universal apps generated in Windows App Studio will share all of this great functionality and they’ll run on a wide range of devices.

For those of you with existing Windows 8.1 projects in App Studio, with just a couple of mouse-clicks, you can upgrade your project to Windows 10. All you need to do is to navigate to your Windows 8.1 Projects page, and click on the “Convert” icon for any app(s) you’d like to upgrade. It really is that easy.

Enjoy the new Windows App Studio release and let’s go build some apps!

Introducing Notifications Visualizer for Windows 10

$
0
0

Notifications Visualizer is a new Universal Windows app in the Store that helps developers design adaptive Live Tiles for Windows 10.

The app provides instant visual previews of your tile while editing, similar to Visual Studio’s XAML editor/design view. The app also checks for errors, ensuring you create a valid tile payload. Below is a screenshot of the Notification Visualizer app:

1_visualiserApp

One of the great things about this tool is that it provides an easy way to create and test adaptive tile payloads without having to edit and deploy the app itself. Once you’ve created a payload with the perfect visual results, you can then integrate it into your app. See Quickstart: Sending a local tile notification to learn more.

Notifications Visualizer comes pre-loaded with a number of sample payloads to showcase what’s possible with adaptive Live Tiles and help you get started. Then you can experiment with all the different text options, groups/subgroups, background images, etc. And you can even see how the tile “adapts” to different devices, like tablets or phones, where more or less content can be displayed. After you’ve made changes, you can save your updated payload to a file for future use.

Note: The Visualizer is a simulation of the Start Menu. It is not always 100% accurate and also does not support some payload properties like baseUri. So when you have the tile design you want to use, test it by pinning the tile to Start to verify that it looks as intended.

The editor also provides real-time errors and warnings. For example, your payload must be less than 5 KB in size (a platform limitation), and the Visualizer will warn you if your payload exceeds that. It will also give you warnings about incorrect attribute names or values, helping you debug any visual issues.

2_visualiserApp

You can also control tile properties like display name, color, logos, and ShowName. And you can set a badge value too. All of these options help you instantly understand how your tile properties and tile notification payloads interact, and the results they produce.

Of course you can still generate notification payloads from code, and this process is explained in this NotificationsExtensions blog post.

Click the Store icon below to get the app:
3_downloadFromStore

Learn more about Live Tiles in Windows 10…

Check out the following posts on the “Tiles and Toasts” section of MSDN Blogs to find more about creating the best & most engaging tiles and notifications in Windows 10:

This post was written by Andrew Bares, a program manager on the Developer Platform team.

Window Store app submission deadlines for the upcoming holidays

$
0
0

Every year the Windows Store, similar to all major retailers, sees a large increase in user downloads and purchases. Last year the holiday months of November, December and January generated 40% more app sales than the average for the year.

To take advantage of this holiday opportunity, you’ll want to update or submit your app no later than November 18 for Thanksgiving (US) and December 15 for the Christmas holiday. Updating your apps now ensures they are ready for other upcoming holidays and festivities around the world.

Microsoft Holiday Submission Deadline for App Publishing by the Holiday
Thanksgiving Thursday,
November 26
Friday,
November 27
Wednesday,
November 18
Christmas Thursday,
December 24
Friday,
December 25
Tuesday,
December 15
New Year’s Friday,
January 1
Friday,
December 18

I recommend you to submit as early as possible, as volumes are traditionally higher and turn-around times may be a bit longer than what you normally experience as a result.

Add video interstitial ads to your Windows Store apps

$
0
0

This past August we announced the Microsoft Universal Ad Client SDK with support for video interstitial ads and ad mediation. Video interstitials are full screen video ads, 20-30 seconds, that typically offer up to 10x the eCPM (value per thousand views) vs traditional banner ads. This makes video interstitial ads a valuable tool for app and game monetization.

If you’ve been thinking about adding video interstitials your app or game, but aren’t sure where to start, read on.

How to add video interstitials to your apps

The first step is to understand if your app can accommodate video interstitial ads:

  • Supported packages: Windows 8.1, Windows Phone 8.1, Windows 10 UWP (phone, tablet, and PC)
  • Supported project types:  C# or Visual Basic with XAML, JavaScript with HTML, and C++ with DirectX and XAML interop”
  • Supported markets:  The market availability for video interstitial ads is the same as for banner ads

Once verified, the next step is to add the video interstitial code to your app by following the walkthrough described in the manage advertising through Dev Center blog or in the Windows/Windows Phone 8.1 and Windows 10 documentation. Briefly, to add video interstitials, you have to:

  1. Download and install the Microsoft Universal Ad Client SDK
  2. Create an ad unit in Dev Center, add the reference to your VS project, and call the appropriate APIs (you don’t need to use the XAML designer)
  3. Add code to manage the instantiation, showing, and detection of success of video ads.

Note: This ad unit can only be used for your video interstitial; it will not work on any banner ad control in the app.

Best practices for using video interstitials

As you implement video interstitial in your apps, keep in mind some best practices that may increase the effectiveness and success of your video ads.

DO:

  • Fit interstitial ads within the natural flow of the app, such as between levels.
  • Associate ads with tangible upsides, such as hints toward level completion, extra time to retry a level, or custom avatar features.
  • If your app requires that a video ad be watched to completion, state that clearly so that so customers aren’t surprised with an error message if they hit the close button.
  • Be mindful of the customer’s data plan. For example, warn the customer before serving a video ad on a mobile device that is near/over its data limit (or don’t show it at all). The APIs in the ConnectionProfile class that can help with this.
  • Continuously improve how you use ads in your app. Look at the ad reports and make design changes to improve fill and completion rates.

DO NOT:

  • Overdo it. Don’t force ads more than every 5 minutes or so, unless the customer explicitly engages with an optional tangible benefit, beyond just playing the game.
  • Launch video interstitials when the app launches. Customers may believe they clicked the wrong tile.
  • Launch video interstitials at exit. This is detrimental to your success, since completion rates will be near zero.
  • Schedule two or more video ads back to back. Customers will be frustrated to see the ad progress bar reset to the starting point. Many will think it’s a bug.
  • Penalize a customer for failures in ad serving. Example: If you show an option to “watch an ad to get rewards”, you should provide rewards if the customer did his part, even if the ad wasn’t served correctly.

For a comprehensive list of best practices for see the Video interstitial best practices.

Examples of Windows apps using video interstitials

Below are three great examples of using video interstitials to monetize games.

Examples 1 and 2 are rewards-based ads, where the customer is explicitly seeking some benefit, such as a hint or extra time to complete the level, and the video ad is initialized through the app’s user interface. Example 3 is a Paywall ad, where the customer must watch an ad at some regular interval.

Publisher Rolling Donut Apps uses video interstitials as an IAP replacement in their match-3 title Jewel Star. The concept of the game is simple – match 3 or more jewels to make them disappear. What happens if you don’t complete a level in the allotted number of turns? Rather than asking you to pay to continue playing, Jewel Star offers you additional turns for watching a video ad.

Publisher Ratrod Studio Inc. also uses video interstitials as an IAP replacement. In this instance, though, video ads don’t eliminate paid IAP altogether. Rather, in Mike V Skateboard Party Lite they offer players a reward they may otherwise pay for. In the video below you can see how this is executed. A player enters the Skate Shop, where they can make in-app purchases. Displayed prominently is a “GET FREE EXP!” button. When a player clicks that button, a 15-second video ad is shown. After the video ad finishes, the player is awarded 10 experience points.

Finally, publisher Random Salad Games takes a different approach with video interstitials in their title Hearts Online. In this instance, they smartly leverage the format of their game. After completing two of four hands of the card game, the game pauses for an intermission, essentially mimicking a TV game show’s “message from our sponsors” advertisement.

In each of these examples, the publishers used video interstitials in a manner that is not overly impactful to the app experience.

Video interstitials are particularly effective for games, though could also be used in other app scenarios. Try them out, and let me know if you have any questions.


Combining Two Apps into One at Box with the Universal Windows Platform

$
0
0

We recently interviewed Box about how they migrated their Windows 8 apps to create the new Windows 10 Box app, how the Universal Windows Platform (UWP) made the process simpler, and what features had the biggest impact on the project.

Box’s introduction to UWP

Box wanted to create a more flexible app that would make users happy no matter what device they were using. When the Box team learned about the UWP at the Microsoft Build Conference, they thought it was the best way to update their existing Windows apps. At the time, they were maintaining two codebases and two UIs; and when it came to testing, every function had to be tested for each target device.

“By combining the two apps in Windows 10 as a universal Windows app, it decreased our engineering overhead, and increased our velocity for future iterations. We’re really excited about this.” – Lois Wang, Senior Product Manager at Box. She provided us with screenshots of the app in action.

1_box

The developers at Box combined their Windows 8 desktop app with their matching Silverlight Windows Phone app. To port to Windows 10 UWP, they only needed to design an amazing user experience for each device and then combine the core logic into one app.

An amazing developer experience

Box was delighted when the UWP also turned out to be a great developer experience. “Compared to our previous experience building Windows apps, Windows 10 apps are a lot easier and faster to build. Also, the Dev Center takes care of the deployment,” said Lois.

The Windows Store offers a beta process where developers can publish their app and invite selected customers to download the beta, while keeping it hidden from the live Store. With Windows 10, those users are automatically upgraded to the production version when available. Box’s Enterprise users appreciate the convenience of the Windows Store, a user-friendly way to deploy the app to corporate end users. “And to us, this makes deployment a much simplified story. Publishing to the Windows Store reduces the burden for us to create installers. Most of the devs who are familiar with the business logic are not experts with the installers. That’s a huge overhead that we can avoid,” said Lois.

Migrating to Windows 10

Developing on the Universal Windows Platform also saved Box a significant amount of time. The first step in the migration process was to deprecate any code no longer supported, for example, the Silverlight code. One of their goals was to offer a true Windows 10 user experience, so they converted custom controls to Windows 10 controls. Since the Box team didn’t have to create the controls from scratch that accelerated development. Box used the split view control on their small screen UI, and they used the list view control on the main landing page for Box content. By taking advantage of the many assets and controls available readymade through Windows 10, they shortened the coding process and finished the project faster. Here’s a screenshot of the Box app displaying the user’s most recent files.

2_box

The last step was to create the new code necessary to use a fully adaptive view of the app for any size window. Windows users are accustomed to multitasking, and need the ability to resize windows to show other apps sharing the screen with the Box app. In this view of the Box app, it is sharing the screen with Microsoft Word.

3_box

Windows 10 interoperability

The interoperability provided by Windows 10 inspired the Box team during their conversion. Previously, they created and maintained custom code to interact smoothly with content creation apps, for example Microsoft Office or Adobe Creative Cloud. By using Windows 10 Contracts and API sets, Box simplified their app and achieved better app-to-app communication.

Here are their three favorite interoperability features.

  1. The Cached File Updater contract

    Using the Cached File Updater feature eliminated a significant amount of custom code. With a few lines of code, the Box app can share content with another app, and when users finished updating, they can save changes directly back to Box through the Cached File Updater. This means that a user can work on a remote file that the app maintains in its repository as though that file were local. In the Windows 8 desktop and phone apps, Box needed workarounds for the same functionality.

  2. The File Picker contract

    By using the File Open Picker contract and the File Save Picker contract, the Box developers created a consistent way for users to open and save their files. The File Picker works with the Cached File Updater for live synchronization with a repository in the cloud.

  3. The Share contract

    Box used the Share contract so their users could share content with other UWP apps that employ it. App-to-app communication supports sharing and receiving data, copy & paste, and drag & drop.

Wrapping up

Using the universal Windows Platform, Box increased interoperability with other apps, and optimized users’ workflow. The Box app helps you securely access and work on content, collaborate, and automate your workflows. Visit the Box developer site to start building your app on Box, visit the Box developer site. The Box app for Windows 10 is now available for download from the Windows Store.

Useful resources include:

Increase your app’s reach with Windows Store for Business

$
0
0

We announced earlier this year that a new storefront for businesses and organizations would be launching this fall. The new unified Windows Dev Center opened in July with the opportunity for developers to submit apps to the new storefront, and today the first release of Windows Store for Business is available to organizations in 21 markets.

Windows Store for Business is a web-based portal that IT decision makers, purchasers and administrators use to find, acquire, manage, and distribute Windows Store apps across their organization’s Windows 10 devices. This new capability allows you to expand your app reach to businesses, educational institutions, and other organizations.

In this blog I’ll describe the apps that can be found in Windows Store for Business today, walk through the Dev Center experience, and illustrate the organizational and user experience.

App Availability

This initial release of Windows Store for Business supports free apps and custom-developed line-of-business (LOB) apps that organizations provide to employees at no charge. Paid apps, and apps opted-out of organizational licensing in the Dev Center are not available to organizations in this release.

Support for paid apps, and support for in-app-purchases, is planned for a future release. We recommend you submit these apps for organizational licensing now, which will allow these apps to be available to organizations when we add support for paid content.

Acquisition Experience

I’ll walk through how organizations will find and acquire your Windows Store apps, obtain LOB apps, distribute, manage, and make apps available for people in their organization to install on Windows 10 devices. Understanding the process from their perspective is helpful so you can make the right decisions for your apps.

Find and acquire relevant apps

IT professionals can find apps in Windows Store for Business by browsing app collections, searching by keywords, or by browsing app categories. They can also invite a developer to create a custom LOB app. Organizations can acquire one or multiple licenses for an app in a single transaction.

1_professionalView
Windows Store for Business – IT professional view

LOB apps

Before Windows 10, organizations with custom LOB apps had to use sideloading or third-party management tools to distribute the apps. With Windows Store for Business, sideloading is no longer necessary. Organizations can acquire LOB apps directly from developers via Windows Store for Business and distribute and manage them via the same mechanisms as other Windows Store apps.

Distribute and manage apps

After organizations acquire apps, they have these distribution options:

  • Direct assignment to individuals and teams via Windows Store for Business
  • Placing the app in their private store page in Windows Store for users to find and download
  • Using a third-party management solution

Organizations manage apps and their licenses in one inventory. They can reclaim and reassign licenses as needed.
2_inventory

The users in the organization will be able to find apps very easily, for example in the private page of Windows Store:
3_businessStoreListing

Once the user has installed a selected app, it is updated automatically when an update is submitted through Dev Center.

Dev Center experience

Making apps broadly available to organizations

Windows Store for Business experience begins at app submission. Apps are offered to organizations by default. This allows you to take advantage of the new storefront without any additional steps on your part. While there is no disadvantage to allowing your app to appear in Windows Store for Business, if you would prefer to opt your app out of the process, just uncheck the box for Store-managed (online) volume licensing during the app submission process.

Developers also have the option to select Disconnected (offline) licensing.  This allows apps to be installed on unconnected devices, without using the Store’s online licensing system. Organizations with unique security needs or device management tools often need this option to use an app. When paid apps become available in Windows Store for Business, Microsoft will verify all companies requesting to self-manage paid apps before granting them access, and all offline licenses will be watermarked to identify the company that acquired the license.

4_orgLicensing

For more information about organizational licensing in the Dev Center, see Organizational licensing options.

Publishing line-of-business apps

When a company seeks to acquire an app specific to their organization, developed either in-house or from a third party, these apps are also submitted to Windows Store for Business via Dev Center. Organizations can then use Windows Store for Business to manage and distribute that app to Windows 10 devices. It only takes four steps:

  1. In Windows Store for Business: An IT pro professional invites a developer to publish a custom LOB app for that organization.
    5_LOB
  2. In Dev Center: Developer accepts the invitation.
  3. In Dev Center: Developer publishes the app targeting that organization
    6_distroAndVis
  4. In Windows Store for Business: After the app submission is available, an IT Professional can accept the app and add it to their inventory. They can distribute the app to users in their organization.
    7_newLob

 

So now that Windows Store for Business is live, make sure you add your business and educational apps to Windows Store and select the distribution option that works best for your app. If you develop line-of-business apps, we encourage you to work with your organizations to use Windows Store for Business as a distribution option.

Vungle SDK for Windows 10 Released

$
0
0

Microsoft is proud to announce our partnership with Vungle, the leading in-app video ad platform at Connect (); //2015. Vungle has released the Vungle SDK for Windows 10 apps, which powers monetization for apps across Windows 10 desktops, tablets, and phones.

Vungle_isometric_grid
About 35% of game developers currently use mobile video ads, and many find it a great source of revenue that can actually enhance UX. With this partnership, Microsoft now offers easy integration with one of the leading global monetization platforms for Windows developers.

If you’re ready to give in-app video ads a try, this guide will show you how to quickly integrate the Vungle SDK into your app so you can start earning revenue – in five easy steps. The code samples in this guide are in C#, but we provide sample app files in C#, C++, Visual Basic, and DirectX+XAML.

A few notes before you get started…

  • The integration requires a Vungle account, so create a Vungle account if you don’t have one handy.
  • If you haven’t already done so, head over to our dashboard and add your app to your account. You need to do this so that you can get your App ID, which you’ll be adding to your app with our SDK. It’s in red on your app’s page.
  1. Download the SDK
    Download the Vungle Windows SDK from the Vungle Dashboard. Extract the archive once it’s finished downloading.
  2. Add VungleSDK to your project
    1. In Visual Studio 2015, create a new project using the template appropriate for your application and programming language.
    2. Add a reference for your project to the Vungle Windows SDK file you downloaded.
    3. Make sure that your project has the “internetClient” capability in the package.appxmanifest file, as shown:
      <Capabilities>
          ...
          <Capability Name="internetClient" />
          ...
      </Capabilities>
      
    4. Import the VungleSDK namespace. For example:
      using VungleSDK;
  3. Obtain a VungleAd instance
    For example:
    VungleAd sdkInstance;
    // additional code if you need
    sdkInstance = AdFactory.GetInstance("yourAppId");
    

    In the above example, replace yourAppId with your app id that you got when you added your app to your account.

  4. Create and register an event handler
    Create event handler for OnAdPlayableChanged event. For example:
    //Event handler for OnAdPlayableChanged event
    private async void SdkInstance_OnAdPlayableChanged(object sender, AdPlayableEventArgs e)
    {
      //Run asynchronously on the UI thread
      await CoreApplication.MainView.Dispatcher.RunAsync(
        CoreDispatcherPriority.Normal,
        new DispatchedHandler(() => myRadMethod()));
    }
    

    Register this event handler for OnAdPlayableChanged event. For example:

    sdkInstance.OnAdPlayableChanged += SdkInstance_OnAdPlayableChanged;

    Check out our Advanced Settings Guide to subscribe to play events. These can be used to unpause audio, resume gameplay, etc.

  5. Play an ad with your desired options selected (learn how to set options in the Advanced Settings Guide); for example:
    private async void IncentivizedConfigButton_Click(object sender, RoutedEventArgs e)
    {
      await sdkInstance.PlayAdAsync(
        new AdConfig { Incentivized = true , SoundEnabled = false});
    }
    

See below for an example of an in-app video ad. For more information, visit vungle.com or [help page link for windows SDK).

November improvements in Dev Center: submission, promotion and developer agreement

$
0
0

Starting this week you will see new capabilities in Dev Center. In this blog I’ll describe what’s new in more detail and share ideas how to make best use of them:

  1. App submission: new price tiers, and preview of a new age rating system that will start to be rolled out in December
  2. App promotion and monetization: new download badges and Store updates to increase customer acquisitions
  3. Content and agreements: integrating the previously separate advertising content directly into Dev Center, as well as minor updates to the App Developer Agreement

1.) New capabilities for app submission

New simplified age rating process: IARC

In December we will begin the rollout of the new process to simplify obtaining age ratings for app and game submissions. Today, upon app submission, developers must self-select a Windows Store age rating, and then obtain and add all of the individual market-specific age ratings (e.g. ESRB, PEGI, DJCTQ).

With the new simplified age rating system, based on the global rating and age classification system, IARC, you will be prompted to answer questions in Dev Center once, and your answers in turn automatically generate all the age ratings your app needs. This new process can save developers expense and hours of time when submitting an app to the Windows Store.

We are rolling out IARC to a select group of developers in December to preview, wtih the migration continuing in early 2016. Once your account is enabled to user IARC, the first time you update update the package, price or metadata, you’ll need to answer the questions (but just one time only). So we recommend reading the IARC questions, now so you are prepared to answer them upon your first submission.

Twice number of price tiers

Dev Center has doubled the number of prices available for your apps and in-app products. There are now almost 200 prices available, within the same range (between US$0.99 and US$999.99 or equivalent in different currencies). This allows you to optimize and adjust more precisely how you price your apps.

Additionally, the price values for the following markets were updated to account for foreign exchange rate fluctuations:
1_prices

These changes require no action on your part, though you may want to explore in Dev Center all available prices (viewed when choosing the price of an app update), to consider using the new price tiers for your apps or in-app products.

2.) More ways to promote and monetize apps

New badges to promote your apps

As the Store continues to add content types, we’re also unifying the ‘Get it’ badge for use on your web site and in your communications to show your customers that your app or game is in the Store. The new badge takes advantage of the value of the Microsoft brand.

The Store also now supported badges specifically designed to promote yout new apps or games optimized for Windows 10. We recommend using it for apps you have developed with the Universal Windows Platform.

Badge for all apps and games (optional) Badge for UWP apps
 2_badgeForAllApps  

You can download the new badges and badge guidelines here.

You can also monetize these badges through the Microsoft Affiliate Program, which allows you to earn a commission on any app or game sale that is generated from a customer clicking on the badge on your web site or in your communications.

Updates to Windows Store that help increase customer acquisitions

In parallel with the Dev Center improvements, Windows Store added this month several new capabilities to help customers easily find more apps and games to purchase:

  • “Top grossing” list optimized to drive attention to the most successful apps that generate revenue through both paid and in-app purchase.
  • Most frequently acquired in-app products appear on the app description page, showing potential customers the IAPs available in your app, e.g.:
    3_inAppPurchases
  • Strikethrough discounted pricing (e.g. $8.99 $2.99) displays automatically in the Windows Store when a scheduled price promotions are used to put an app on sale to help drive customer attention to this reduced price:
    3_sale
  • List with all the apps from a developer, shown when clicking on the developer name in the page description for any app:
    3_listForAllAppsFromDeveloper
  • Streamlined purchase experience, through an option to remove the requirement to always enter the Microsoft account email and password with every purchase:
    3_betterPurchaseExperience

3.) New Microsoft Advertising Content and updates to the App Developer Agreement

pubCenter content now integrated into Dev Center

The Microsoft Advertising content, previously available via the pubCenter site  is now available via the new Dev Center monetization and promotion pages, making the content easier to access by integrating with the Dev Center experience.

Updated App Developer Agreement

The App Developer Agreement has been updated to reflect the recent Dev Center changes:
4_ada

COPPA is the previously disclosed option to indicate if an app that used Microsoft Advertising targets children, and in these cases Microsoft Advertising will manage targeting differently.

The Dev Center experience will continue to evolve and grow.  As you explore and use these new capabilities, send us feedback on areas you’d like to see us invest in or improvements needed via the Windows Feedback tool, the “Feedback” button in Dev Center (5_feedback found in the bottom right) or vote for new features in user voice.

Windows Bridge for iOS: Where we are and where we are headed

$
0
0

In August, we released the Windows Bridge for iOS as an open-source project on GitHub. Today we’re going to take you on a tour of what we’ve been working on for the last few months, some new tools we’re building to help you get started with the bridge and what’s coming next.

Where we are

The response we’ve gotten from the community since August has been simply fantastic. Over 4500 of you starred the repo, and what’s more, over 500 created your own fork. More than 200 issues have been filed (and several dozen closed, with many more in various stages of being fixed), and we’ve received a number of high quality pull requests, many of which we’ve already accepted.

At the same time, we’ve continued to regularly release fixes, updates and new features. Since our initial release in August, we’ve added support for:

  • GLKit. We’ve built out support for apps that make use of GLKit’s math libraries, textures, shaders and effects, as well as views and view controllers, so you can finally bring that game you’ve been working on to Windows devices.
  • Xibs, AutoLayout & Storyboard. One of the biggest requests we’ve gotten has been for Xib, AutoLayout and Storyboard support. We’ve added support for Xibs using our Xib2Nib tool as well as preliminary support for both AutoLayout and Storyboards.
  • KVO/KVC. Another widely requested feature, and one we were pleased to add robust support for a few weeks ago.
  • New sample projects. We’ve added sample projects showcasing GLKit support, intermixing of UIKit and XAML controls, and a simple HelloWorld project to help new users get started.
  • And much, much more. In addition to those features specifically called out here, we’ve continued to expand our coverage of iOS libraries, crushing bugs right and left along the way.

The goal of the bridge has always been to make it easy for iOS developers to make great Windows apps while reusing much of their existing Objective-C code and iOS development skills. Simply running iOS apps on Windows is one thing, but building native Windows apps using iOS code is, as they say, a whole ‘nother ball game.

With that in mind, the reasons for open sourcing the bridge were twofold: first, we wanted to get as much feedback as possible so we could make sure our priorities were aligned with developers’. And second, we wanted to lay the groundwork to build a strong community around the project so it could be extended by anyone and everyone would benefit.

Where we’re headed

Last week we launched a new landing page for the iOS bridge and in the coming weeks we’ll be releasing a series of tools designed to make it as easy as possible to bring your app to Windows. For all the folks who asked about API availability and our development roadmap on GitHub, we heard you loud and clear, and we’re baking those features directly into our new website.

The first tool we’re working on is an automatic app analyzer. You’ll be able to upload your IPA and our website will analyze it for compatibility with the bridge, delivering your results right in your browser. You’ll be able to see exactly how much work you’ll have to do to bring your app to Windows, along with suggestions, tips and workarounds for any libraries you’re using that the bridge doesn’t support yet.

We’re currently in the process of testing the app analyzer, but we need your help to make sure it’s ready. We need IPAs to test our analysis pipeline with, so we’ve set up a form to accept submissions here. If you submit your IPA for analysis, you’ll not only be helping guide our development, you’ll be among the first to get your results when the tool is ready.

If you haven’t been able to try out the bridge yet – or aren’t sure if it’s right for your project – we’re also working on making it easier to get started. In the coming weeks, we’ll be adding downloadable evaluation virtual machines (VMs) to our new site and from Dev Center. We’ll offer the VMs in four pre-configured packages for different virtualization environments: Parallels, VMWare, VirtualBox and Hyper-V. Each flavor will be refreshed once a month with the latest version of Visual Studio 2015 Community Edition, Windows IoT Core, Windows Bridge for iOS, Windows SDK and all the Universal Windows Platform samples.

Thanks for making this project such a success in its first few months. If you want to support the project, please submit your IPA to help test our analysis pipeline by clicking here. Otherwise, you can get involved by forking the repo, filing an issue or submitting a pull request on GitHub.

Post written by Nick Gerard, Program Manager, Windows Bridge for iOS

Demystifying HttpClient APIs in the Universal Windows Platform

$
0
0

As a Universal Windows Platform (UWP) app developer, if you are trying to communicate over HTTP with a web service or any server endpoint, you have multiple API choices. Two of the most used and recommended APIs for implementing the HTTP client role in a managed UWP app are System.Net.Http.HttpClient and Windows.Web.Http.HttpClient. These APIs should be preferred over older, discouraged APIs such as WebClient and HttpWebRequest (although a small subset of HttpWebRequest is available in UWP for backward compatibility).

We have received several questions about the differences between these APIs, equivalent functionalities between the two, which one to use when, and so on. In this post, we will try to address these questions and help clarify the purpose of these two APIs.

Brief Overview

The System.Net.Http.HttpClient API was first introduced in .NET 4.5, and a variant was made available via a NuGet package down-level for .NET 4.0 and Windows Phone 8 Silverlight apps. The goal of this API was to provide a simpler, cleaner abstraction layer and flexibility for implementing the HTTP client role, as compared to the older HttpWebRequest API. For example, it allows chaining custom handlers, by which developers could intercept each request or response, and implement custom logic. Up until Windows 8.1, this API had a fully managed .NET implementation underneath. In Windows 10, the implementation of this API for UWP has been changed to layer it on top of Windows.Web.Http and the WinINet HTTP stack of Windows.

On the other hand, the Windows.Web.Http.HttpClient API, was first introduced in Windows 8.1 and was available on Windows Phone 8.1 as well. The primary motivation behind creating this API was to consolidate the disparate HTTP APIs available for different Windows app languages (C#, VB, C++, JavaScript) into a single one that supports all the features from each of those APIs. Most of the basic API design was derived from that of System.Net.Http and the implementation is based on the WinINet HTTP stack of Windows.

When using these APIs in a Windows Store app, the supported OS versions and programming languages are as follows:

API OS Versions Supported Languages
System.Net.Http.HttpClient Windows, Windows Phone 8 onwards .NET languages only
Windows.Web.Http.HttpClient Windows, Windows Phone 8.1 onwards All Windows Store app languages

Which one should I use?

Since both of these APIs are available in UWP, the biggest question for HTTP developers is which one to use in their app. The answer is that it depends on a couple of factors:

  1. Do you need to integrate with native UI for collecting user credentials, control HTTP cache read and write behavior; or pass in a specific SSL client certificate for authentication?
    If yes – then use Windows.Web.Http.HttpClient. At the time of this writing, the Windows.Web.Http API provides greater control over HTTP settings in UWP than the System.Net.Http API. In future versions, the System.Net.Http API may also be enhanced to support these features on UWP.
  2. Do you intend to write cross-platform .NET code (across UWP/ASP.NET 5/iOS and Android)?
    If yes – then use System.Net.Http API. This allows you to write code that you can re-use on other .NET platforms such as ASP.NET 5 and .NET Framework desktop applications. Thanks to Xamarin, this API is also supported on iOS and Android, so you can reuse your code on these platforms as well.

Object Model

Now that we understand the motivation behind creating these two similar APIs and the rationale for choosing between the two, let’s look closer at the object model for each of these.

System.Net.Http

The topmost abstraction layer is the HttpClient object, which represents the client entity in the client-server model of the HTTP protocol. This client can issue multiple requests (represented by HttpRequestMessage) to the server and receive the corresponding responses (represented by HttpResponseMessage). The entity body and content headers of each HTTP request or response is represented by the HttpContent base class, and derived classes such as StreamContent, MultipartContent and StringContent. They provide different representations of the HTTP entity body. Each of these classes provide a set of ReadAs* methods to read out the entity body of a request or response as a string, byte array or a stream.

Each HttpClient object has a handler object underneath that represents all the HTTP-related settings of that client. Conceptually, you can think of the handler as representing the HTTP stack underneath the client. It is responsible for sending the client’s HTTP requests to the server and conveying the response back to the client.

The default handler class used in the System.Net.Http API is HttpClientHandler. When you create a new instance of an HttpClient object—for example, call new HttpClient()—an HttpClientHandler object is automatically created for you with the default HTTP stack settings. If you want to modify any of the default settings such as caching behavior, automatic compression, credentials or proxy, you can create your own instance of an HttpClientHandler directly, modify its properties and then pass it into the constructor of HttpClient, as follows:

HttpClientHandler myHandler = new HttpClientHandler();
myHandler.AllowAutoRedirect = false;
HttpClient myClient = new HttpClient(myHandler);

Chaining of Handlers

One of the key advantages of the System.Net.Http.HttpClient API design is the ability to insert custom handlers and create a chain of handler objects underneath an HttpClient object. For example, let’s say you are building an app that queries a web service for some data. You have custom logic to handle HTTP 4xx (client error) and 5xx (server error) responses from the server and want to take specific retry steps, such as trying a different endpoint or adding user credentials. You would ideally want to separate this HTTP-related work from the rest of your business logic which just cares about the data returned from the web service.

This can be achieved by creating a new handler class that derives from the DelegatingHandler class (e.g. CustomHandler1), then create a new instance of it and pass that in to the HttpClient constructor. The InnerHandler property of the DelegatingHandler class is used to specify the next handler in the chain – for example, you could add another custom handler (e.g. CustomHandler2) to the chain. For the last handler, you can set the inner handler to an HttpClientHandler instance – this will pass the request on to the HTTP stack of the OS. Here’s how this looks conceptually:

1_HttpClientWorkFlow

And here is the sample code to achieve this:

public class CustomHandler1 : DelegatingHandler
{
	// Constructors and other code here.
    protected async override Task<HttpResponseMessage> SendAsync(
        HttpRequestMessage request, CancellationToken cancellationToken)
    {
        // Process the HttpRequestMessage object here.
        Debug.WriteLine("Processing request in Custom Handler 1");

        // Once processing is done, call DelegatingHandler.SendAsync to pass it on the 
        // inner handler.
        HttpResponseMessage response = await base.SendAsync(request, cancellationToken);

        // Process the incoming HttpResponseMessage object here.
        Debug.WriteLine("Processing response in Custom Handler 1");

        return response;
    }
}

public class CustomHandler2 : DelegatingHandler
{
    // Similar code as CustomHandler1.
}
public class Foo
{
    public void CreateHttpClientWithChain()
    {
        HttpClientHandler systemHandler = new HttpClientHandler();
        CustomHandler1 myHandler1 = new CustomHandler1();
        CustomHandler2 myHandler2 = new CustomHandler2();

        // Chain the handlers together.
        myHandler1.InnerHandler = myHandler2;
        myHandler2.InnerHandler = systemHandler;

        // Create the client object with the topmost handler in the chain.
        HttpClient myClient = new HttpClient(myHandler1);
    }
}

Notes:

  1. If you intend to send the request to a remote server endpoint, the last Handler in a chain is typically HttpClientHandler, which actually sends the request out on the wire and receive the response from the HTTP stack of the OS. Alternatively, you could use a mock handler that pretends to be the server and returns fabricated responses.
  2. Adding processing logic in the handler before passing the request to the inner handler or the response to the upper handler can lead to performance loss. It is best to avoid expensive synchronous operations in this scenario.

For more details on the concept of chaining Handlers, see this post by Henrik Nielsen (Note that it refers to the ASP.NET Web API version of the API, which is slightly different from the .NET framework one discussed here. The concept of chaining handlers is common though.)

Windows.Web.Http

The object model for the Windows.Web.Http API is very similar to that of the System.Net.Http version described above – it also has the concept of a client entity, a handler (called “filter” in this namespace) and the option of inserting custom logic between the client and the system-default filter.

Most of the types are direct analogs of the types in the System.Net.Http object model, as follows:

HTTP client role aspect System.Net.Http type Corresponding Windows.Web.Http type
Client entity HttpClient HttpClient
HTTP request HttpRequestMessage HttpRequestMessage
HTTP response HttpResponseMessage HttpResponseMessage
Entity body of an HTTP request or response HttpContent IHttpContent
Representations of HTTP content as string/stream/etc. StringContent, StreamContent and ByteArrayContent HttpStringContent, HttpStreamContent and HttpBufferContent respectively
HTTP stack/settings HttpClientHandler HttpBaseProtocolFilter
Base class/interface for creating custom handlers/filters DelegatingHandler IHttpFilter

The previous discussion about chaining of handlers in the System.Net.Http API also applies to the Windows.Web.Http API, where you can create a chain of custom filters and pass them into the constructor of an HttpClient object.

Implementing Common HTTP Scenarios

We now look at some code snippets and quick notes for implementing the most common HTTP scenarios using each of the two HttpClient APIs. For complete details and guidance, please look at the MSDN documentation for Windows.Web.Http.HttpClient and System.Net.Http.HttpClient respectively.

Modifying headers

System.Net.Http:

To modify headers for all requests sent by an instance of HttpClient, use the following pattern:

var myClient = new HttpClient();
myClient.DefaultRequestHeaders.Add("X-HeaderKey", "HeaderValue");
myClient.DefaultRequestHeaders.Referrer = new Uri("http://www.contoso.com");

To modify the headers of for a specific request only, use:

HttpRequestMessage myrequest = new HttpRequestMessage();
myrequest.Headers.Add("X-HeaderKey", "HeaderValue");
myrequest.Headers.Referrer = new Uri("http://www.contoso.com");

Windows.Web.Http:

The patterns shown above apply to the Windows.Web.Http API as well.

Notes:

  1. Some headers are represented as collections and the Add and Remove methods need to be used to edit them.
  2. The HttpClient.DefaultRequestHeaders property represents the default set of headers that will be added to the request at the app layer. As the request is processed by the HTTP stack of the operating system, additional headers may be added before the request is sent out on the wire.

Setting Timeouts

System.Net.Http:

In the System.Net.Http API, there are two ways to set a timeout. To set a timeout for all requests made from that client, use:

myClient.Timeout = TimeSpan.FromSeconds(30);

To set a timeout on a single request, use the cancellation token pattern:

var cts = new CancellationTokenSource();
cts.CancelAfter(TimeSpan.FromSeconds(30));

var httpClient = new HttpClient();
var resourceUri = new Uri("http://www.contoso.com");

try
{
   HttpResponseMessage response = await httpClient.GetAsync(resourceUri, cts.Token);
}
catch (TaskCanceledException ex)
{
   // Handle request being canceled due to timeout.
}
catch (HttpRequestException ex)
{
   // Handle other possible exceptions.
}

Windows.Web.Http:

There is no timeout property on the Windows.Web.Http.HttpClient type. As a result, you must use the cancellation token pattern shown above.

Using authentication credentials

System.Net.Http:

In order to protect the credential information of the user, the HTTP stack does not add any authentication credentials to outgoing requests by default. To use specific user credentials, use the following pattern:

var myClientHandler = new HttpClientHandler();
myClientHandler.Credentials = new NetworkCredential(myUsername, myPassword); 

Windows.Web.Http:

For the Windows.Web.Http API, by default, a UI dialog is presented if the outgoing request is for a resource that requires user authentication. To disable the UI dialog, set the AllowUI property of HttpBaseProtocolFilter to false. To use specific credentials instead, use:

var myFilter = new HttpBaseProtocolFilter();
myFilter.ServerCredential = new PasswordCredential(“fooBar”, myUsername, myPassword);

Notes:

  1. In the above examples, myUsername and myPassword are string variables that can be populated via inputs obtained from the user via UI or from app configuration settings
  2. In UWP apps, the HttpClientHandler.Credentials property can be set only to null, DefaultCredentials, or an object of type NetworkCredential.

Using Client Certificates

System.Net.Http:

In order to protect the user’s credential information, this API does not send any client certificates to the server by default. To use client certificates for authentication, use:

var myClientHandler = new HttpClientHandler();
myClientHandler.ClientCertificateOptions = ClientCertificateOption.Automatic;

Windows.Web.Http:

There are two options for authenticating using client certificate – the default is to present UI for the user to choose the certificate. Alternatively, you can programmatically set a client certificate to use, as follows:

var myFilter = new HttpBaseProtocolFilter();
myFilter.ClientCertificate = myCertificate;

Notes:

  1. In order to use a client cert with either API, you must first add it to the app’s certificate store by following these instructions. Apps with enterprise capability can also use existing client certificates in the user’s ‘My’ store.
  2. For HttpClientHandler.ClientCertificateOptions , there are two allowed values: Automatic and Manual. Setting it to Automatic will choose the best matching client certificate from the app certificate store and use that for authentication. Setting it to Manual will ensure that no client certificate is sent even if the server requests it.

Proxy Settings

For both APIs, proxy settings are automatically obtained from Internet Explorer/Microsoft Edge settings and are used for all the HTTP calls by default. This enables apps to automatically work even if the user is connected to the internet through a proxy. Neither API provides a way to specify a custom proxy for your app. However, you can choose to not use the default proxy by setting HttpClientHandler.UseProxy to false (for System.Net.Http) or HttpBaseProtocolFilter.UseProxy to false (for Windows.Web.Http).

Cookie Handling

By default, both APIs save cookies that are sent by a server and automatically add them to subsequent requests to that URI within the same app container. The cookies for a particular URI can be read and new custom cookies can be added. Finally, both APIs have an option for disabling sending of cookies to the server: for System.Net.Http, set HttpClientHandler.UseCookies to false and for Windows.Web.Http, set HttpBaseProtocolFilter.CookieUsageBehavior to HttpCookieUsageBehavior.NoCookies.

System.Net.Http:

To add a cookie to all requests made by that client:

// Add a cookie manually.
myClientHandler.CookieContainer.Add(resourceUri, myCookie);

To add a cookie to a single request:

HttpRequestMessage myRequest = new HttpRequestMessage();
myRequest.Headers.Add("Cookie", "user=foo; key=bar");

To inspect all cookies for a given URI:

var cookieCollection = myClientHandler.CookieContainer.GetCookies(resourceUri);

Windows.Web.Http:

To add a cookie to all requests sent by a client:

// Add a cookie manually.
filter.CookieManager.SetCookie(myCookie);

To add a cookie to a single request, the pattern shown above apply to the Windows.Web.Http API as well.

Manage cookies:

// Get all cookies for a given URI.
var cookieCollection = filter.CookieManager.GetCookies(resourceUri);

// Delete a cookie.
filter.CookieManager.DeleteCookie(myCookie);

Notes:

  1. In the Windows.Web.Http API, the cookies in the cookie manager are shared within the app container across several networking APIs that are all implemented using the WinINet stack, such as Windows.Web.Syndication, Windows.Web.AtomPub, XHR and others. Thus, a cookie received via a server response to a Syndication API call in the past might be added to a subsequent HttpClient request to that same server within the same app container.

Max Connections per server

By default, the underlying HTTP stack of the operating system uses up to 6 HTTP connections per server. The System.Net.Http HttpClient API does not provide a way to control this. For Windows.Web.Http API, use:

var myFilter = new HttpBaseProtocolFilter();
myFilter.MaxConnectionsPerServer = 15;

Latest Updates

In Windows 10, we have added HTTP/2 support to both of these APIs in UWP apps. This support is on by default, so as a developer, you get advantages such as lower latency with no code changes. Both APIs (System.Net.Http and Windows.Web.Http) also allow explicitly disabling this feature and forcing the version to HTTP 1.1 or 1.0.

Going forward, we intend to continue adding support for highly requested features such as custom validation of server SSL certificates and the ability to add handlers/filters to HttpClient objects created elsewhere. We look forward to hearing the features that you need in these APIs in order to continue writing awesome apps on Windows. You can either file an idea on UserVoice or better yet, join the Windows Insiders program and submit feedback through the forums or the Windows Feedback app.

This post was written by Sidharth Nabar, a program manager on the Windows Networking APIs team.

XAML Behaviors, open source and on UWP

$
0
0

Your requests to grow the XAML Behaviors platform and bring them forward to support UWP app development have been heard. Today we announce the next step: XAML Behaviors natively supported for UWP and shipping as a NuGet package (for both native and managed projects). Additionally, to build a vibrant community around the platform, Behaviors are open source and on GitHub. Now, you can help influence the future direction of Behaviors.

The History of Behaviors

Originally released for WPF and Silverlight, and based on the concept of EventTriggers in WPF, designers and developers used Behaviors as an easy means for rapidly building their apps while promoting code reuse. Behaviors encapsulate reusable functionality for elements which could be easily added to XAML without the need for more imperative code.

WIth Visual Studio 2013, Behaviors were brought forward for use in Windows 8.1 Store apps (as Extension SDKs). Now, with the Universal Windows Platform, we will ship Behaviors as a NuGet package.

What are Behaviors and Actions?

Using both Behaviors and Actions, developers can create a wide variety of interactive scenarios.

Behaviors are attached to a control or element and listen for something to happen. What that “something” is can vary from an event firing (like a mouse click) or some data changing (as when a slider is moved to change a value). When the event the Behavior was listening for happens, it triggers one or more Actions.

Actions are invoked by Behaviors and execute on a selected element or control. Some examples of Actions can range from calling a method, navigating to another page, or triggering a storyboard.

Behaviors can be seen as event listeners and handlers. The following markup listens for a button to be clicked in order to play a storyboard:

<Button x:Name="button">
   <Interactivity:Interaction.Behaviors>
      <Core:EventTriggerBehavior EventName="Click">
         <Media:ControlStoryboardAction Storyboard="storyboard1"/>
      </Core:EventTriggerBehavior>
   </Interactivity:Interaction.Behaviors>
</Button>

Why are we open sourcing?

From adoption in popular frameworks to demand on UserVoice, it is clear that you want Behaviors to be bigger. It’s exactly because of this excitement that we want to open source Behaviors. Releasing as a NuGet package and hosting all Behaviors code on GitHub will allow new features and fixes to be addressed more quickly. When a new Behavior or feature is added to the repo, it can be consumed and used almost immediately. Opening up to contributions lets the Behaviors platform grow by empowering the community to set the pace and direction.

Open source model

Here’s our plan to build a vibrant community around Behaviors and open up the code.:

  1. Release cadence

    Behaviors will be released as an updated NuGet Package every quarter, provided there are meaningful changes. By releasing a stable version every three months, new contributions will constantly be taken into the GitHub repo and will build up the catalog of Behaviors for developers to use.

  2. Contribution model

    A committee of Microsoft Most Valuable Professionals (MVP) leaders will evaluate contributions to maintain quality and direction of the project. This project committee will approve and comment on submitted pull requests from the community.

    As the open source project grows and more contributors are committed to Behaviors, we plan to restructure the project to give authority to contributors who add the most value to the project. Whether it be through code, documentation, or other means of improving Behaviors, the goal is to give the community more control over Behaviors and empower users to build and add the features they most want to see.

  3. Integration into Blend

    1_blend
    In moving away from the Extension SDK approach, some changes have been made to the way Behaviors are presented in Blend for Visual Studio. These changes are reflected in Update 1 RTM release. Before, Behaviors were presented as a pre-populated list in the Assets Pane. Now, the Assets Pane prompts users with a link to install the NuGet Package. Clicking this link will download and reference the latest NuGet Package and will populate the list with all the latest and greatest Behaviors.

    You will also be able to get the latest version of Behaviors in both Visual Studio and Blend using the NuGet Package Manager.

    To install via the NuGet Package Console, run the following command for managed projects:

    PM> Install-Package Microsoft.Xaml.Behaviors.Uwp.Managed

    For native:

    PM> Install-Package Microsoft.Xaml.Behaviors.Uwp.Native
    2_nuget

Philosophy and direction

Behaviors will evolve as developers contribute to the project. However, not all pull requests will be accepted and merged into the repo. Here are the four philosophy and goals for Behaviors that we hope will help guide the types of contributions we receive.

  1. Targeting common interactive scenarios

    Behaviors should be a toolkit that target a wide audience of developers and empowers them to be more productive. The Behaviors taken into the project should address common and core user scenarios that many will find value in. To ensure that developers get the most out of what is published, Behaviors that address uncommon or limited scenarios may not be accepted into the core package. However, shipping these Behaviors in other NuGet packages that express a dependency on the core Behaviors NuGet package is encouraged. The project committee is actively looking into solutions for this and will guide the project accordingly.

  2. Writing good documentation and samples

    The Behaviors GitHub page, documentation, and sample apps should be good sources to teach new developers about Behaviors, and how to use them. Whether a user is new to building apps and using Behaviors, or experienced and looking to create their own custom Behaviors, the proper resources to do whatever a developer needs and wants to do should be provided.

  3. Concentrating on the SDK and not on the tooling

    Rather than concentrating on new tooling and the authoring experience behind Behaviors, building out the platform should be the goal. Behaviors are a toolkit for developers to leverage in their apps, instead of new value editors for Blend or Visual Studio.

  4. Co-evolving C++ Behaviors evolve instep

    Behaviors support both native and managed projects. While expecting more development and contributions on the C# side, there should still be adequate C++ support. If a Behavior does not utilize reflection, considerations should be made to add a C++ version to make sure no language gets left behind.

What can I do?

Start using Behaviors now. If you previously referenced the Behaviors Extension SDK, please download and install the NuGet package and reference that. The NuGet package ships with the exact same namespace and API as the original Extension SDK in most cases, so switching over is easy. While the Extension SDK will still be supported, further development will only be pursued in the NuGet version.

Additionally, with the release of the NuGet package, some partnering frameworks are simultaneously shipping updates that support the new Behaviors package: Caliburn.Micro and Cimbalino Toolkit now leverage the new Behaviors. Check them out!

Conclusion

The XAML Behaviors that you know and love from building 8.1 apps are now ready for UWP, open source, and shipped as a NuGet package. Contributions of new and useful Behaviors are always welcome and encouraged.

I’d like to extend a big thank you to our MVP leaders for dedicating their time and effort to this cause and helping to guide this project as Behaviors are opened to the community.

Visit the GitHub page to learn more. If you have feedback, suggestions, or comments we’d love to hear them! Tweet using #BehaviorsGoOpenSource. Share what where you’d like Behaviors to go by submitting issues on the GitHub page or email.

This blog post was written by Jon Chu, a Program Manager on Visual Studio and .NET


Announcing the Microsoft HoloLens ‘Share Your Idea’ campaign

$
0
0

The developer community anticipation for Microsoft HoloLens has been exciting to see, and we love the discussions about what you are planning to do with HoloLens and the Windows SDK.

We want to share everything we’ve learned about developing great holographic apps. To that end, we’re offering to jump start one of your app ideas. As you share your ideas with the HoloLens community, we’ll help you understand what it takes to build them.

Today, we’re excited to announce the launch of Share Your Idea. Share Your Idea is a website and forum where developers can submit ideas – answering the question, “what experiences do you want to see on HoloLens?” Ideas will be shared across the site, and the community will be able to vote on their favorites. Ultimately, the HoloLens team will pick our top three among the most popular ideas and let the community vote on which experience we will actually build and release to the world! We will work to bring your idea to life and show you every step in the journey – and when we’re done, we’ll deliver the source code back to the community.

Of course, the best ideas should showcase the central feature of HoloLens – holograms. A hologram is an object like any other object in the real world, with only one difference: instead of being made of physical matter, a hologram is made entirely of light and sound. And they exist in the world with you. Just as real world objects occlude each other, real world objects can occlude holograms, and holograms can occlude real world objects.

When thinking about great holographic apps, consider whether they exercise these capabilities:

  1. World coordinates. Holograms can be world locked, which means they stay where you put them. You can walk around the hologram to see the other side of it, revealing new details as you go.
  2. Scale. Holograms can share the same size as objects in the real world, but they can also shrink and grow.
  3. Interaction. HoloLens uses your gaze to determine what you want to interact with. Combine that with gesture and voice commands, you can create holograms that are fully interactive.
  4. Spatial Sound. Holograms can grab your attention with sound, leading you in a specific direction.
  5. Spatial Mapping. HoloLens knows about your world by giving apps information about surfaces in the user’s environment. From that, you can place holograms on floors, walls and tables.

 

What now? Go to http://hololens.com/shareyouridea to participate. Here’s a recap on what we will do:

  • From now until January 11th, idea submission and community voting is open to everyone.
  • The HoloLens team will pick our top three among the most popular ideas and let the community vote on which one we’ll build.
  • We’ll build it and show you every step along the way, including team planning, storyboarding, developing, designing, build reviews and more.
  • Lastly, once we’re done, we’ll open source the code so the HoloLens community can start building from it

Ultimately, the nice thing about holograms is that they can act just like real world objects and they can do things that break the laws of physics. You are limited only by your imagination. We’ll offer commentary to shape your ideas. We want to share our knowledge with the community, and understand what information and support you will need when you start developing your own ideas. We can’t wait to hear your suggestions.

Building a holographic development team

$
0
0

We’re now two days into the Share Your Idea project, and we’ve been blown away by the level of interest and creativity that’s already poured out. Earlier this week, a few of us shared #MadeWithHoloLens videos and images to spark discussion and show what’s possible. We have been able to show you our creations through mixed reality capture (MRC) with HoloLens – showing the holograms they are seeing in their world through the device.

We first talked about MRC at our Build 2015 conference earlier this year. It’s a great way to show you what we are working on, to show you some of what is possible with holograms. To show how they behave in the real world, to show them world locked and at true size and scale relative to other real world objects. We think that this will really help in the sharing of great ideas – we want to know about the experiences you want to see on HoloLens. And we want to help you visualize what is possible.

This is a great time to start talking about what it really takes to build a HoloLens apps and content, and about the team that we have lined up to make one of your ideas come alive. Microsoft HoloLens runs Windows 10. This means that any Universal Windows Platform (UWP) app can be brought to HoloLens. Apps like Edge and the Xbox app on Windows 10 are UWP apps – so similar to streaming Xbox games to Windows 10 PCs, you can stream Xbox games to HoloLens. If you want to start preparing for HoloLens now, start building UWP apps now.

With HoloLens you can both develop 3D content and see that 3D content in the world around you. Apps targeting the features of HoloLens take advantage of volume, environment and human interaction. These apps are no longer confined to a two-dimensional plane. You can bring the solar system in to your living room, you can see a mime run across a piano or create holographic greeting cards and share those experiences through mixed reality capture. Ideas like the Animated Storybook take advantage of placing holographic content into the real world, letting you walk around it and see everything with full volume.

1_animatedStorybook

Now, let’s talk about the team that will build one of your apps. Our experience in building apps for HoloLens shows a good investment in design and art has high value. We’d also like to get your feedback on how you want to interact with this team. The team that we have lined up to build the winning idea is:

  • 3 Developers
  • 2 Artists
  • 1 Designer
  • Some additional help from an audio designer

We’re only giving this team a few weeks to build your idea. Naturally, the idea we select will be something our team of 6 people can build in the time allotted. You’ll start seeing us comment on ideas to explain whether they’re too ambitious for the team and time we have. Look out for us. And we’re also answering developer questions sent to @HoloLens.

One idea that easily fits in the team’s scope is HoloChess.  Programming the game mechanics for chess is relatively straightforward, but designing the experience to be incredibly compelling will still take significant design effort.  Modelling the pieces and working through animating them in compelling ways is significant work. We also know that investments in this type of art makes a big difference.

2_holoChess

When building your holographic development team, consider the roles and capabilities needed. Some projects might need fewer people and others more – it’s the skillset that matters. Not only do you need expertise with graphics engines, input and workflow, you need design, art and audio skills too.

Continue to submit your great ideas, and don’t forget to vote on ideas too. We’ll see you in the comments.

What’s New for Developers in the Windows 10 SDK Build 10586 Update

$
0
0

To go along with the recent release of Windows 10, version 1511 update, we have released a Windows 10 SDK build 10586 update along with Visual Studio 2015 Update 1 this week. The update contains enhancements for developers to build, distribute, and monetize apps. Clint Rutkas takes a deeper look at some of the specifics of the update in a separate blog post. Next week, we’ll publish posts on developing for Continuum and using the Windows.UI.Composition API.

I’d also like to tell you about two other tools to help developers adopting the Universal Windows Platform (UWP):

General Availability of Mobilize.Net’s Silverlight bridge

I’m pleased to announce that the Silverlight bridge that accelerates bringing Windows Phone 8.1 apps to UWP, built by our partner Mobilize.Net, is now released and can be downloaded here. This free Visual Studio add-in analyzes source code, automatically converting code to use UWP APIs. Right now, the bridge has 2300 mappings and additional helpers to help with the migration.

Here are a few quotes from developers currently using the bridge:

“I was able to migrate 95% of the code for my application using the technical preview. Other than having to tweak a couple of references to the new Windows Storage model, the tool worked flawlessly”


“Using a new build of the tool, I had 18 errors on my solution. Fixing those 18 errors only took a few minutes rather than hours if I had to do the full port by hand.”


“I was able to convert 3 projects with minimum manual changes, related to image resolutions that are needed for Windows 10. We are ready to continue migrating our full portfolio of Windows Phone Silverlight apps”

Highlights include conversion of embedded SQL to SQLite and Windows Storage libraries, optimization of the error notification process and Improvements for the conversion of async methods that require additional logic. Their GitHub repository which has their conversion mappings, including over 800 mappings and semantic translation helpers, which can be customized and improved by the community. In addition to the mappings, helpers have been added or enhanced in the following areas: networking, UI navigation and elements, contacts and tasks, device properties, phone storage and GPS.

Evaluation Virtual Machines for Windows 10 development now available

If you are interested in developing for Windows 10 and want to test out the Windows Bridge for iOS or just general UWP development, we have released 60-day evaluation developer virtual machines (VM) on Windows Dev Center. These VMs have the latest snapshots of the tools for Azure and Windows IoT Core as well. Additionally, the VMs contain the Windows UWP samples from Github. These VMs will be released in multiple virtual hard disc formats as well: Hyper-V, Parallels, VirtualBox, and VMWare. If you have feedback on the VMs, please provide it over at the Windows Developer Feedback UserVoice site.

Thank you

Thank you to our Windows developer community for your passion and creativity – we can’t wait to see what you come up with next! My team and I love to hear your feedback, and we use it to guide platform investments. Please keep the feedback coming using our Windows Developer Feedback UserVoice site.

Windows 10 SDK Build 10586 breakdown

$
0
0

This week we released a new Windows 10 SDK. Let’s dive deeper into some of the Universal Windows Platform (UWP) improvements in the SDK update:

Visuals, Effects, and Animations

Introducing Windows.UI.Composition, a new API family that directly targets the UI foundation layer. The UI Foundation layer sits below the framework (e.g. XAML) and above the DirectX graphical layer. A set of samples on GitHub is also available. The new APIs provide:

  • Fast graphical rendering of lightweight Visuals in 3D coordinate space
  • A new declarative animation engine built for scale, with innovative Expression animations along with key-frame animations that all run independent of the UI thread
  • High performance, real-time UI effects system. Effects applied on Visuals can be customized, chained, and have their properties animated

SQLite

SQLite data access library now ships with the Universal Windows Platform for local data access needs across all Windows 10 device families. SQLite implements a self-contained, serverless, zero-configuration, transactional SQL database engine. Developers can reference the SDK SQLite instead of packaging their own library with their app. UWP How to: Data Access was updated to help developers with SQLite with UWP apps.

Input & Ink

The update includes improvements in ink and keyboard.

  • Direct Ink for Win32 Apps. The Ink Presenter APIs enable Microsoft Win32 apps to manage the input, processing, and rendering of ink input (standard and modified) through an InkPresenter object inserted into the app’s DirectComposition visual tree. Now Win32 apps can use the same ink as UWP apps
  • Keyboard Delivery Interceptor. Enables an app to override the system processing of raw keyboard input, including shortcut keys, access keys (or hot keys), accelerator keys, and application keys, but excluding secure attention sequence (SAS) key combinations. Note that Secure attention sequence (SAS) key combinations, including Ctrl-Alt-Del and Windows-L, continue to be processed by the system
  • Cross-process chaining of pointer input. Enabled via new pointer events (for both UWP apps and Classic Windows applications)

More Efficient and Flexible AppX Installation

The update provides more flexibility to app installation on devices:

  • Reduced Installation Footprint. Until now, we have required disc space on the device of twice the AppX package size to install an app. So a 1GB app package would require 2+GB of disk to complete the install. Now we require only a small amount of incremental space, so a 1GB app package would require about 1.1GB on disk.
  • Secondary drives on desktop. On desktop secondary drives are now supported for app installs so you can install apps to D: by changing the location in settings under storage.  On mobile, the storage setting similarly allows apps to be installed on a SD card if one is present

XAML Updates

The SDK now includes several updated APIs for beautiful UI:

  • Jump Lists. The new Windows.UI.StartScreen.JumpList and Windows.UI.StartScreen.JumpListItem classes provide apps with the ability to programmatically select the type of jump list they want to use, add custom task entry points, and add custom groups.
  • XAML Updates. These include the ability to specify the clipboard format via updated API on RichText, better navigation with updated Maps APIs, and improvements to the default menu size via a few primitive APIs

Bluetooth and Networking

The updated SDK includes improvements for Bluetooth and networking:

Sensors

Window 10 introduced several improvements to Contextual Sensing including the ability to detect activities (e.g. walking, running, biking, in vehicle), to count steps, to detect altitude and barometric pressure, and the ability to detect the presence/absence of a user close to the device. A good summary is provided in this blog post. In addition, this blog post describes some more advanced sensor features including the ability to do Sensor Batching for the accelerometer, a ReadingTransform to make it easy to maintain proper app orientation across devices, and the ability to define and use Custom Sensors. With these changes, the full range of sensor APIs are available to all devices running Windows and depreciated the (Lumia-only) SensoreCore APIs that were their predecessor.

The November update continues this trajectory with the ability to get the current reading from sensors and to use sensors as background triggers. For details, check out the extensive collection of Devices and Sensors UWP samples in our sample repository on GitHub.

Windows.Devices.Perception namespace

The Windows.Devices.Perception namespace contains the client APIs that allow a UWP application to access the color, depth, or infrared data of computer vision cameras.

Device Storage

Developers now have additional flexibility for storing files and associating them to specific users:

Windows App Certification Kit (Windows ACK)

The Windows App Certification Kit has been updated with improved tests. For a complete list of updates, visit the Windows App Certification Kit page.

Design Kit (Photoshop)

To make it easier to design apps, we recently introduced new UWP app design templates for Adobe Photoshop. We also updated our Microsoft PowerPoint and Adobe Illustrator templates and made a PDF version of our guidelines available. Visit the Design downloads page.

Start developing and @WindowsDev would love to see what you create. If you find bugs or issues, please use the Windows Feedback tool, MSDN forums.

Optimizing apps for Continuum for phone

$
0
0

With Windows 10, you have the productivity of a PC in your pocket. Continuum for phone enables you to connect a Windows mobile device to any external display with the new Microsoft Display Dock, USB-C, or Miracast.  Once connected, you can interact with Windows 10 apps on that display while using your mobile device.  For developers this means that your Universal Windows Platform (UWP) app can be used on any screen at any time. By default, all Windows 10 UWP apps that run on a Windows mobile device will be enabled for Continuum. To ensure your app looks and works great on Continuum, consider the following:

  1. Build responsive apps
  2. Target the right device family
  3. Include additional scaling assets
  4. Create multi-screen experiences

Build responsive apps

Using responsive techniques will ensure your app works beautifully on any screen size, regardless of Windows device family. There are no APIs or tools specific to Continuum; when your app is activated or moved to the connected display, your app will simply receive a SizeChanged event similar to when a desktop window is resized. When you receive this event, be sure your app adjusts as needed to optimize for the given size. In general, users should see a phone-optimized UI when using your app on their mobile device, and a desktop-optimized UI when using Continuum to use your app on the connected display.  Note that users can interact with the connected display with a keyboard and mouse, or the Continuum touchpad app on the mobile device (which mimics a precision touchpad).

With today’s hardware, it is safe to assume your app is running on a connected display if the effective resolution is greater than or equal to 800×600 effective pixels. See Responsive design 101 for Universal Windows Platform Apps for details on effective pixels and responsive techniques for all UWP apps.

 1_responsive

Tools for responsive XAML apps

A plethora of responsive tools are available to XAML developers.  See “Make your app look great on any size screen or window” for a deep dive, but here are a few of the available tools.

The RelativePanel class allows you to anchor UI elements relative to each other and the container such that they reflow to any screen size.

The VariableSizedWrapGrid class make it easy to wrap pictures and text in a grid according to window size.

The SplitView class can be used to create a top-level navigation experience, adjusted according to window size.

Finally, the VisualStateManager class allows you to define visual states that correspond to certain conditions, such as window size or custom triggers such as input type.

UserInteractionMode API

The UserInteractionMode API gives you context about the form factor of the display your app is running on.  It returns “mouse” when the device UI is optimized for mouse input, and “touch” when the device UI is optimized for touch input.  These returns do not describe the current input method, but rather what input method the shell your app is running in is optimized for.

With Continuum, “touch” will always be returned when your app is on the mobile device, and “mouse” will always be returned when your app is on the connected display.  UserInteractionMode will only change when your app is moved between screens.  UserInteractionMode does not send events – you’ll need to query this API upon receiving a SizeChanged event.  Note that UserInteractionMode is also used to inform developers when a desktop device is in tablet mode – Continuum is not the only use case.

Here is an example of how you might use UserInteractionMode in C# to switch between a mobile view and a desktop view for Continuum.

using Windows.UI.Xaml;
using Windows.UI.ViewManagement;

public sealed partial class MainPage : Page
{
  public MainPage()
  {
    InitializeComponent();
    // Every view gets an initial SizeChanged, so we will do all our
    // work there. This means that our view also responds to dynamic
    // changes in user interaction mode.
    Window.Current.SizeChanged += SizeChanged;
  }

  private void SizeChanged(object sender, RoutedEventArgs e)
  {
    switch(UIViewSettings.GetForCurrentView().UserInteractionMode)
    {
      // When mouse is returned, use desktop layout
      case UserInteractionMode.Mouse:
        VisualStateManager.GoToState(this, "DesktopLayout", true);
        break;

      // When touch is returned, use mobile layout
      case UserInteractionMode.Touch:
      default:
        VisualStateManager.GoToState(this, "MobileLayout", true);
        break;
    }
  }
}

DisplayInformation Class

The DisplayInformation class monitors and controls physical display information.  This class provides events to allow clients to monitor changes in the display an app view is running on.  You can use DisplayInformation to tailor experiences based on display properties.  For example, if you want your app to adapt based on the physical screen size of the device (as an estimate for form factor), you can use the DiagonalSizeInInches property as a trigger.

Target the right device family

If you build a UWP app that can run on a Windows mobile device, your app will run on Continuum by default.  If you only have a Windows Desktop and/or Xbox app, your app will not be supported on Continuum.

Universal device family

The best thing you can do is to make sure your app targets the universal device family, so that it can run on any Windows device.  If you do, you’re already doing everything needed to work on Continuum.  For more details, see Packaging Universal Windows apps for Windows 10 and Guide to Universal Windows Platform (UWP) apps.

This weather app is a good example.  The developer of this app did not know Continuum existed before they built the app. They were delighted to find that because they targeted the universal device family, their app worked just like it does on a desktop PC by default.

2_continuum

Note: On Continuum, apps are single instance – an app can only run on one screen at a time (except with multi-screen scenarios as described below). These side-by-side illustrations show how the app adapts across screens.

Mobile device family

While we recommend targeting the universal device family where possible, we understand that many developers come from mobile-only backgrounds.  If your app only targets the mobile device family, you can incorporate responsive techniques and get some basic reflow behavior for free. This will make your app work better on a connected display.

For example, the photos app below was built targeting only the mobile device family.  However, because the developer leveraged the RelativePanel and WrapGrid classes to define how their app responds to various phone sizes and orientations, their app content automatically responded and took advantage of the larger connected display screen sizes.

3_continuum

If you want make your mobile app look even better on Continuum, you can use the responsive techniques discussed above to further optimize the big screen layout of your app.  If you find yourself building new UI components or app views for Continuum, we suggest targeting the universal device family so your effort can be realized across all Windows devices.

Considerations for separate mobile and desktop packages

If you’re a developer with separate packages targeting the mobile and desktop device families, users will only get the behavior of your mobile app when they use it on Continuum.  However, you can improve the way your app works on Continuum by bringing views and/or assets from your desktop app to your mobile app, and triggering them when appropriate.

For example, the Microsoft Edge browser dynamically loads a mobile view or desktop view depending on which screen the app is running on. Because a desktop view already existed, Edge was able to port desired UI components to their mobile app for use on the connected display rather than rebuilding anything.

4_continuum

You can use triggers such as effective resolution or UserInteractionMode to determine when to show your desktop view vs. your mobile view.  See the code snippet in the UserInteractionMode section above for an example of switching between a mobile and desktop view on SizeChanged event.  You can also reference the VisualStateManager class for more information on building triggers.

Opting out of the connected display

If your mobile app isn’t ready for Continuum right away, no worries.  Simply add the following lines to your manifest to block your app on the connected display.  Making this change will cause your app tile to be greyed out on the connected display’s Start menu until it is enabled.  If the user tries to launch your app on the connected display while it is greyed out, they will see the following:

The namespace to be added to the <Package> tag:

<Package
    xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
    xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
    xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
    xmlns:mobile="http://schemas.microsoft.com/appx/manifest/mobile/windows10"
    IgnorableNamespaces="uap mp mobile">

The actual “true” / “false” restriction value:

<Extensions>
   <mobile:Extension Category="windows.mobileMultiScreenProperties">
      <mobile:MobileMultiScreenProperties RestrictToInternalScreen="true"/>
   </mobile:Extension>
</Extensions>

This <extensions> block is a child of <Application>.

When your app is ready for Continuum, simply set RestrictToInternalScreen to “false” and submit an update!

Additional scaling assets

To optimize for connected displays, you can provide UI assets (e.g. icons, pictures, bitmaps, etc.) for a variety of resolutions and scales.

Every device on the Windows platform is associated with a specific scale, derived from the effective resolution, which is computed from the physical pixel density and theoretical viewing distance.  There is no direct correlation between device size and scale.  These scales are used by the resource management system to determine which developer-provided assets will work best on a given display.

Here are a few examples:

6_scale

The mobile device will generally have a scale between 200 and 400.  The connected display will most likely have a scale of 100 (most monitors) or 150 (most TVs). When the user downloads your app from the Store, only scale assets for the mobile device screen will be deployed to the mobile device by default.  After this, an app update will be triggered each time the user connects to an external display with a new scale factor.  This update will pull down the best assets for the new display.  If the best assets are already on the mobile device, then no update is necessary.

For example, let’s say you have a scale-300 mobile device and scale-100 monitor.  When apps are running on the monitor, they want to use scale-100 assets.  The first time the user connects to this monitor no apps will have scale-100 assets available because they are not deployed to the mobile device by default, so the next best assets (scale-300) will be used.  Upon connection, the system will query all of the user’s downloaded UWP apps to see which ones have better scaled assets available, and an update will be triggered to pull down those assets.  In some cases, this may mean that scale-150 or scale-200 assets are flagged if scale-100 assets are not available.  An update will be triggered to pull down those assets.  The system will automatically apply the best-scaled assets to each display independently.  To save space, assets for screens that go unused for more than 30 days are removed.

Adding and referencing scale resources

To support more scale factors, simply include more scale resources in your app solution.  There are two ways to do this.

  1. Add new resources with .scale-xxx notation in an “Assets” folder
    7_assets
  2. Add new scale resource folders, with the identically named assets in each folder
    8_assets

If you use one of these two options, you can reference the desired resource with a URI (leaving out the “scale-xxx”) and the system will grab the best scaled asset for a given display.  For example: “ms-appx:///Assets/Logo.png” or “ms-appx:///desktop.png”. A tag in XAML could look like this: <Image x:Name=“LogoImage” Source=“ms-appx:///Assets/Logo.png”/>.

Create multi-screen experiences

With UWP APIs, you can take advantage of the mobile device and connected display simultaneously.

Media casting

You can use the built-in casting capability of the MediaElement control to show a media element on the connected display while your app remains on the primary display.  Simply feed the desired media element to the system, and Windows creates a view and plays that media element on the connected display.

9_bigBunny

Here’s an example of how you might leverage the MediaElement Control:

//Create a casting picker
CastingDevicePicker picker = new CastingDevicePicker();

//Filter it to only videos
picker.Filter.SupportsVideo = true;

//Add the event listener for the device selected event.
picker.CastingDeviceSelected += picker_DeviceSelected;

async void button_Clicked(object sender, RoutedEventArgs args)
{
  //Show the selection UX when the button is pressed
  await picker.Show(new Rect(0, 0, 5, 5), new Placement.Above);
}

void picker_DeviceSelected(CastingDevicePicker sender, CastingDeviceSelectedEventArgs args)
{
  //Get the selected device from the arguments
  CastingDevice selectedDevice = args.SelectedDevice;

  //use the casting device as desired
  await selectedDevice.RequestStartCastingAsync(mediaElementVideo.GetAsCastingSource());
}

ProjectionManager Class

The ProjectionManager class allows you to create rich, interactive multi-screen experiences.  It is easy to begin and end multi-view sessions, where you have full control over the view on each display.  Here are some additional guidelines.  Because you cannot guarantee the user has a keyboard and mouse, you should assume that the view on the mobile device (internal view) must fully control the view on the connected display (projected view).

As an example, Microsoft PowerPoint leverages the ProjectionManager class to create a robust multi-screen presentation experience, powered by a mobile device.  The view on the mobile device contains a slide preview, notes, and slide selection tool.  With this view, the user is in full control of the slides showing on the connected display.

10_ProjectionManager

Here’s an example of how you might leverage ProjectionManager to create a multi-screen experience:

private async void StartProjecting_Click(object sender, RoutedEventArgs e)
{
   //Check whether there is already active connection to an external display
   if (ProjectionManager.DisPlayAvailable)
   {
      int thisViewId;
      thisViewId = ApplicationView.GetForCurrentView().Id;

      var thisDispatcher = Window.Current.Dispatcher;
      await CoreApplication.CreateNewView().Dispatcher.RunAsync(CoreDispatcherPriority.Normal,()=>
      {
         // Display the page in the view. Not visible until “StartProjectionAsync” called
         var rootFrame = new Frame();
         rootFrame.Navigate(typeof(ProjectionViewPage), initData);
         Window.Current.Content = rootFrame;
         Window.Current.Activate();
      });

      // Show the view on a second display
      await ProjectionManager.StartProjectingAsync(rootPage.Id, thisViewId);
   }
}

private async void StopProjecting_Click(object sender, RoutedEventArgs e)
{
   await ProjectionManager.StopProjectingAsync(rootPage.ProjectionViewPageControl.Id,thisViewId);
}

Start building

Most developers who build responsive UWP apps that run on mobile devices won’t have to do any work to support Continuum.  But of course, every app is unique so we recommend testing and validating how your app works in this scenario.

Here’s an overview of what you should consider for Continuum, and a few additional resources.

  1. Most importantly, use responsive techniques to ensure your app reflows beautifully to any screen.  Targeting the universal device family will benefit you most on Continuum and across all Windows devices.
  2. Remember that users will most likely interact with your app on the connected display with keyboard and mouse.  Consider implementing and testing UI optimized for keyboard and mouse if your app is primarily touch-driven.
  3. Include additional scaling assets in your app package to make your app pixel perfect on any display.  Most screens a user might connect to will be scale-100 or scale-150.
  4. Leverage multi-screen APIs to create rich, interactive, robust multi-screen experiences.

To learn how to get set up, check out the Microsoft Display Dock and other hardware on microsoft.com, the wireless Actiontec ScreenBeam Mini2 Continuum Edition, and read about our Continuum for phone hardware configurations.

We look forward to using your apps on Continuum!

Post written by Liz Threlkeld, a Program Manager on Windows

Viewing all 623 articles
Browse latest View live