Quantcast
Channel: Apps – Windows Developer Blog
Viewing all 65 articles
Browse latest View live

What’s new in WebView in Windows 8.1

$
0
0

Incorporating web code and content into apps is becoming more the norm for app development. With Windows 8.1 Preview, you have choices in how you do that. Developers might be looking to integrate an advertising SDK, collecting web analytics about who’s using their app, or leveraging mature online web apps and services. To support existing code and content from the web, we’ve made more investment in the WebView control for Windows 8.1.

You may remember that the XAML framework included a WebView control, which enables you host web content in your XAML app. After getting feedback from developers who used this control in their Windows 8 apps, we made some improvements for Windows 8.1. To take advantage of these changes, make sure your app manifest is updated to require Windows 8.1.

WebView support in Windows Store apps written in HTML and JavaScript

With Windows 8.1, the WebView control is now available to use in HTML apps. Previously, apps written in HTML and JavaScript needed to use an iframe if they wanted to host web content that’s not part of the app. When you use the WebView control for site hosting you get better isolation, navigation, smart screen, and support for sites that can’t be hosted in an iframe. For more info see the talk John Hazen gave at the //Build conference.

In HTML apps, the WebView control is instantiated with the x-ms-webview element:

<x-ms-webview id="WebView" src=”http://www.microsoft.comstyle=”width:400px; height:400px;”>
</x-ms-webview>

The same underlying control is used for both the HTML and XAML versions of the control, so they have the same functionality. The only difference is some of the API names and data types are customized to fit in with the semantics of each platform.

WebView z-order layering changes

In Windows 8, the WebView control was implemented as an overlay window over the top of the app’s immersive window. It didn’t participate nicely in the app’s layering, and would sit on top of everything else such as popups, combo boxes, and the app bar. This is one of the main pain points we heard from customers using the control in Windows 8.

In Windows 8.1, however, WebView doesn’t have these layering issues. For example, this screenshot of a test app shows WebView with transforms applied and an app bar displaying over the top.

Screenshot of a test app showing WebView with transforms applied

XAML

<WebView x:Name="WebView1" RenderTransformOrigin="0.5,0.5">
    <WebView.RenderTransform>
        <CompositeTransform Rotation="30" ScaleX="1" ScaleY="1" SkewX="15" SkewY="0" />
    </WebView.RenderTransform>
</WebView>

HTML

<x-ms-webview id="WebView1" style="width:800px; height:600px; transform: rotate(30deg) skewX(15deg)"></x-ms-webview>

The new implementation for Windows 8.1 is now implemented as a DirectComposition surface, instead of an overlay window, and that allows developers to mix XAML and web content:

  • Popups show above WebView automatically, without using WebViewBrush
  • You can animate WebView and animations are hardware accelerated!
  • You can apply render transforms such as opacity, scale, skew, rotate, and translate. Input is translated for all 2D, but not 3D, transforms. In the screenshot above, you can click/tap on the textboxes and buttons inside the transformed WebView.

This new windowless mode is automatic for apps designed for windows 8.1. Windows 8 apps running on Windows 8.1 continue to use windowed mode for compatibility.

Browsing functionality

One of the scenarios for using WebView in apps is to provide a lightweight browsing experience. For example, an RSS feed app might provide a browsing experience for links in the content. WebView now includes additional API surface to make that easier:

The event lifecycle for navigation has been updated and extended. The main flow is now:

  • NavigationStarting – Indicates the WebView is starting a navigation due to an API call, user interaction, script etc. To enable filtering of the navigation, the eventArgs includes a cancel property which, when set to true, cancel the navigation.
  • ContentLoading – Indicates the HTML content has been received and is being loaded into the control.
  • DOMContentLoaded – Indicates that the main page has finished loading. If you need to use InvokeScriptAsync, wait for this event.
  • NavigationCompleted – Indicates the navigation is complete, or that a failure has occurred and why.

The exceptions to this flow are:

  • UnviewableContentIdentified – Is fired when a user navigates to content other than a webpage. The WebView control is only capable of displaying HTML content. It doesn’t support displaying standalone images, downloading files, viewing Office documents, etc. This event is fired so the app can decide how to handle the situation. Windows.System.Launcher.LaunchFileAsync() can be called so that the shell determines the right app to handle the file.
  • UnsafeContentWarningDisplaying – Is fired when the SmartScreen filter has detected that the page may be unsafe, and the SmartScreen shield is shown. SmartScreen detection is asynchronous, so can occur during and after navigation. When this event is fired, the page content can no longer be interacted with using InvokeScriptAsync etc.

These events are demonstrated in the first scenario of the WebView sample.

As webpages can contain iframes, and each iframe has its own navigation sequence, WebView now includes a set of parallel events for detecting the lifecycle of iframes within the page. These events are:

They follow the same pattern as the main page navigation events.

Content sources

In Windows 8, you could use WebView to load content from:

  • The internet using the Navigate() method and Source property (src in HTML)
  • Content from the app package, using “ms-appx-web:///directory/file” protocol as the Uri with the above APIs
  • The app can programmatically supply HTML markup using the NavigateToString() method

To improve scenarios where WebView is used to host embedded web content, we have added two content sources – Local State directories and the StreamUriResolver.

Local state directories

Sometimes you might want to create and/or store content locally, but then also load the content into WebView. For example, if you have an HTML game with downloadable levels, you can store the levels in the local state directories so they are available offline.

WebView can now load content from the local and temporary app state folders. These are the same folders that are discoverable using the LocalFolder and TemporaryFolder APIs, and can be used for storing app content. The app can create directories and files under these folders, and then navigate to them using the ms-appdata protocol.

To enable an app to have multiple islands of content that are isolated from each other, you are required to create a sub directory under the local or temporary folder’s and store the content within that directory. The Uri scheme is:

  • “ms-appdata:///local/TopLevelDirectory/file” for files from the local state and
  • “ms-appdata:///temp/TopLevelDirectory/file” for files from the app’s temporary state folder

Each of the top level directories under the local or temp folder is isolated from each other, and browsing to a folder is not enabled unless explicitly navigated to using the navigate API. For example, an eBook app might have a set of different books that it wants to store locally. It can create a folder per book, and then navigate to a book. If each book has its own folder under the LocalFolder, each book would be isolated from each other and cannot access content from other book’s folders.

The following code will create a “NavigateToState” folder under the local state folder and then copy a file from the app package to it.

C#

async void createHtmlFileInLocalState()
{
    StorageFolder stateFolder = await ApplicationData.Current.LocalFolder.CreateFolderAsync("NavigateToState", CreationCollisionOption.OpenIfExists);
    StorageFile htmlFile = await Windows.ApplicationModel.Package.Current.InstalledLocation.GetFileAsync("htmlhtml_example2.html");
    await htmlFile.CopyAsync(stateFolder, "test.html", NameCollisionOption.ReplaceExisting);
    loadFromLocalState.IsEnabled = true;
}

JavaScript

function createFileInState()
{
    Windows.Storage.ApplicationData.current.localFolder.createFolderAsync("NavigateToState", Windows.Storage.CreationCollisionOption.openIfExists).then(function (stateFolder) {
        Windows.ApplicationModel.Package.current.installedLocation.getFileAsync("htmlsimple_example.html").then(function (htmlFile) {
            return htmlFile.copyAsync(stateFolder, "simple_example.html", Windows.Storage.CreationCollisionOption.failIfExists);
        });
    });
}

 

This can then be navigated to in the WebView using:

C#

string url = "ms-appdata:///local/NavigateToState/test.html";
WebView1.Navigate(new Uri(url));

JavaScript

function navigateToState() {
    document.getElementById("webview").navigate("ms-appdata:///local/NavigateToState/simple_example.html");
}

Custom URI resolving

The NavigateToString method provides an easy way to navigate to a single HTML document. However it’s common for webpages to reference other content such as css, scripts, images, and fonts that aren’t handled in this way. To solve this problem in Windows 8.1, we’ve added a new capability to WebView to use an UriToStreamResolver object to provide custom URI resolution.

This enables the host app to intercept requests under a specific URI pattern and supply the content as a stream. It can supply the content programmatically for the resources for a webpage, or series of pages, without needing to persist the content to the file system first. A scenario where this may be useful is to present encrypted content – the content can be persisted on disk as encrypted files, or package such as a cab, and then when content is requested it can be decrypted on the fly and supplied to the WebView.

To use this capability, you create an UriToStreamResolver object, and pass it to WebView using the NavigateToLocalStreamUri() method. The UriToStreamResolver object is a WinRT object that needs to implement the IUriToStreamResolver interface, which has one method:

IAsyncOperation<IInputStream> UriToStreamAsync(Uri uri)

 

This method takes the URI and returns the stream. The URI is in the form of “ms-local-stream://appname_KEY/folder/file”.

For example, the following code shows a resolver that serves files from the app package.

/// <summary>
/// Sample URI resolver object for use with NavigateToLocalStreamUri
/// This sample uses the local storage of the package as an example of how to write a resolver.
/// </summary>
public sealed class StreamUriWinRTResolver : IUriToStreamResolver
{
    /// <summary>
    /// The entry point for resolving a Uri to a stream.
    /// </summary>
    /// <param name="uri"></param>
    /// <returns></returns>
    public IAsyncOperation<IInputStream> UriToStreamAsync(Uri uri)
    {
        if (uri == null)
        {
            throw new Exception();
        }
        string path = uri.AbsolutePath;
        // Because of the signature of this method, it can't use await, so we 
        // call into a separate helper method that can use the C# await pattern.
        return getContent(path).AsAsyncOperation();
    }
    /// <summary>
    /// Helper that maps the path to package content and resolves the Uri
    /// Uses the C# await pattern to coordinate async operations
    /// </summary>
    private async Task<IInputStream> getContent(string path)
    {
        // We use a package folder as the source, but the same principle should apply
        // when supplying content from other locations
        try
        {
            Uri localUri= new Uri("ms-appx:///html" + path);
            StorageFile f = await StorageFile.GetFileFromApplicationUriAsync(localUri);
            IRandomAccessStream stream = await f.OpenAsync(FileAccessMode.Read);
            return stream.GetInputStreamAt(0);
        }
        catch (Exception) { throw new Exception("Invalid path"); }
    }
}

 

Multiple resolvers can be created, and handed to WebView, so to map the resolver instance to the URI, it uses a key as part of the hostname field, which is why the uri format is “ms-local-stream://appname_KEY/folder/file”. The best way to create this URI is to use the BuildLocalStreamUri() method passing a key string and a relative URI for the first page. When you call NavigateToStreamURI, you pass the URI and the resolver object, and that instance of the resolver will be associated with the key of the URI.

The resolver will be remembered for the lifetime of the WebView instance. Until the instance of WebView is destroyed, or the key is associated with a new resolver object, it continues to be used to resolve URIs with that key.

In JavaScript apps, it is not possible to code an UriResolver object in JavaScript. However, you can use a resolver that is written in C++, C# or VB. For more details, see Scenario 4 in the WebView SDK Sample.

Capturing a snapshot of the WebView as a bitmap

One of the common requests we’ve had for WebView is the ability to capture a snapshot of the WebView as a Bitmap, which can then be manipulated as required by the app. This can now be done using the CapturePreviewToStreamAsync() or capturePreviewToBlobAsync() methods depending on the platform.

For example, the following code creates a file in the local state folder and save the bitmap of the WebView into the file.

C#

private async void Btn_Click(object sender, RoutedEventArgs e)
{
    StorageFile f = await ApplicationData.Current.LocalFolder.CreateFileAsync("test.png", CreationCollisionOption.ReplaceExisting);
    IRandomAccessStream output = await f.OpenAsync(FileAccessMode.ReadWrite);
    await WebView1.CapturePreviewToStreamAsync(output);
    await output.FlushAsync();
    output.Dispose();
}

JavaScript

function captureBitmap() {
    var webviewControl = document.getElementById("webview");
    Windows.Storage.ApplicationData.current.localFolder.createFileAsync("test.png", Windows.Storage.CreationCollisionOption.replaceExisting).then(function (file) {
        file.openAsync(Windows.Storage.FileAccessMode.readWrite).then(function (stream) {
            var captureOperation = webviewControl.capturePreviewToBlobAsync();
            captureOperation.oncomplete = function (completeEvent) {
                var inputStream = completeEvent.target.result.msDetachStream();
                Windows.Storage.Streams.RandomAccessStream.copyAsync(inputStream, stream).then(function () {
                    stream.flushAsync().done(function () {
                        inputStream.close();
                        stream.close();
                    });
                });
            };
            captureOperation.start();
        });
    });
}

The data can also be captured to an in memory stream and manipulated in memory, for example scaling it using the BitMapTransform object. When capturing a snapshot, the captured image is bounded by the area of the content within the control’s viewport.

Script notify changes in XAML

To improve the security of WebView, we’ve restricted when window.external.notify() can be used from WebView content. These restrictions prevent untrusted content, or content that has been tampered with, from sending messages that are executed without validation to the host. For content to be able to send notifications the following conditions apply:

  • The source of the page should be from the local system via NavigateToString(), NavigateToStream() or ms-appx-web:///

Or

  • The source of the page is delivered via https:// and the site domain name is listed in the app content URI’s section of the package manifest.

As part of this change, AllowedScriptNotifyUris and AnyScriptNotifyUri are deprecated and will return errors in Windows 8.1 apps.

XAML API changes and deprecation

As the XAML and HTML versions of the WebView are based around the same core component, we wanted to move the APIs to be consistent between the controls. This has resulted in a few API changes on the XAML side:

In XAML these APIs are no longer supported, which means that Windows 8.1 apps can still be built using the API, but will receive compiler warnings.

In closing

We have made significant improvements to the WebView control for XAML and have fixed some of the main pain points that developers have felt in Windows 8. Plus as an HTML and JavaScript developer, you can now use WebView in your apps as well. We hope you’ll take time to try out the new version of the control and provide feedback on the XAML and HTML forums. We look forward to seeing the apps you can create using it.

-Sam Spencer, Senior Program Manager, Windows


Now ready for you: Windows 8.1 and the Windows Store

$
0
0

With today’s announcement of Windows 8.1 and Visual Studio 2013 availability, we’re also excited to announce that the Windows Store is now open for submitting apps targeting Windows 8.1.

Publishing your apps to the Windows Store for Windows 8.1

For those of you who started working on your app with our Preview versions, you’ll first need to update your Preview environment to today’s release versions of Windows 8.1 and Visual Studio 2013. Packages built on prerelease versions won’t be accepted into the Store. For apps written in HTML/JavaScript, check out our recent blog post with more specifics to help you target the release build of Windows 8.1.

If you already have an app in the Store for Windows 8 users, you’ll want to check out our info on retargeting your app. You can import your existing project into Visual Studio and make changes as needed to take advantage of the new features in Windows 8.1. After you’ve finished building, it’s easy to add your Windows 8.1 packages to your current app so that customers who’ve upgraded to Windows 8.1 see the latest version of your app. (Of course, you can also continue to update your Windows 8 apps as needed.)

For those new to the platform, take a look around the Windows Dev Center for all the resources you need to get started. You can learn what Windows Store apps are all about and get up to speed on the basics of app development. We even have content that’s specifically written to help you ramp up quickly if you’re already familiar with building apps for iOS or building apps for Android.

Recapping Windows 8.1 platform improvements

We started talking about many of the Windows 8.1 platform features back in late June at our Build conference. Here are just a few of the new platform features and benefits that will help you build better apps and drive deeper engagement with your customers.

  • Overall platform performance improvements to our supported programming languages (C#, C++, JavaScript, or VB) and presentation technologies (XAML, HTML, or DirectX)
  • Improvements to the XAML and HTML controls, and new Hub and WebView controls
  • Tiles on the Start screen now support two additional sizes, bringing the total up to four
  • More powerful multitasking capabilities, with more than two apps onscreen at the same time; a single app can also use multiple windows
  • Improvements to DirectX, as you may have read about earlier this week

We’ve also made improvements to the Windows Store to better connect your apps with customers and drive greater monetization.

  • All new Store layout providing better discovery and richer experience
  • Integration of Bing technologies to make recommendations more relevant
  • App packages can now be up to 8 gigabytes (great for visually rich apps and games)
  • App bundles optimize the distribution of Windows Store app resource packages to global customers
  • Windows Store support for in-app consumables and larger catalogs on in-app offers
  • Windows Store gift cards will launch this holiday to support purchases without credit cards
  • Windows Store apps now auto-update by default, so your customers will always be on the latest and greatest version of your app

As always, we have great free tools for you to work with. The new Visual Studio 2013 Express brings many new benefits to developing Windows Store apps, like improved UI test support, responsiveness testing, improved IntelliSense, new design capabilities including better support for CSS and JavaScript, as well as connecting to our free cloud offerings like Azure Mobile Services.

Windows 8.1 offers developers far more new functionality and opportunities than can be summed up in this blog post. We have lots more information on our Windows Dev Center and in our Windows 8.1 Product Guide for App Builders. We also have some great videos you can watch, like this interview with Joe Stegman, Group Program Manager for the UI platform.

As your customers start installing their free update to Windows 8.1, there’s no better time to update your app. We hope you’re as excited as we are about Windows 8.1 and Visual Studio 2013. Download the tools today and have fun building!

New advertising platform SDKs improve monetization for Windows 8.1 Store developers

$
0
0

With the Windows 8.1 release Microsoft is providing some great advances for app builders – a differentiated and improved platform, functionality that makes it easier to build apps and new monetization opportunities.

Today, we want to talk about new Windows platform advertising capabilities that we believe will deliver better app monetization.

Specifically, in Windows 8.1 we include a unique identifier that can be used to improve the quality and relevance of advertisements displayed within Windows Store apps while providing other services such as analytics and app-discovery. The advertising ID was also created with privacy in mind and consumers can control when it is on or off.

We’re excited to announce the availability of software development kits (SDKs) that leverage the advertising ID from:

  • Microsoft Advertising, with an updated version of Ad SDK (version # 8.1.30909) available in Visual Studio 2013 GA.
  • MediaBrix, for their Breakthrough Moments™ (BTMs) cross-platform technology, which reaches game players at natural, critical points in gameplay where people are most receptive to brand messages.
  • LeadBolt for their mobile app discovery, advertising, and monetization platform, using AppFireworks for actionable analytics and a cross promotion platform.

We expect other advertising platforms to provide solutions in the near future as well.

These SDKs will better enable developers and advertisers to take advantage of the advertising ID feature to improve ad relevance. Over time, experience has shown that displaying ads in apps that relate to the customer’s true interests contributes to higher satisfaction for customers, higher revenues for developers and advertisers, and ultimately the success of the entire ecosystem. With the advertising ID and SDKs, app builders and advertising partners will realize the following benefits:

  • Publishers will have a better understanding of which of their apps a customer installs.
  • Advertising partners can serve more relevant and profitable ads to a customer without accessing any Personally Identifiable Information (PII).
  • Advertising partners can put limits on how many times it serves an ad to the same customer, known as frequency capping.
  • Publishers can track promotions and app incentives to a user to prevent fraud.

Additionally, more flexible onboarding policies allow third party ads for Windows Store apps, enabling SDKs to choose and serve the best paying ads from a broad range of ad networks. This will help to improve the ad fill rate by giving app builders a larger inventory of ads to display. This applies to Windows Store apps running on Windows 8 or updated to Windows 8.1.

Together, these enhancements will not only improve the monetization opportunity for app builders on the Windows platform by providing more options, but it will also benefit customers with more personally relevant ads.

We know customers want to better control their online privacy and enjoy a broad range of apps on their Windows devices. To help achieve these goals, we provide customers the appropriate controls they need to make privacy choices. Customers can easily turn the advertising ID off and on during their Windows 8.1 device setup or anytime afterwards.  For more information, visit the Windows 8.1 privacy statement.

We’ll have additional detail and technical documentation in the coming weeks, but we encourage developers to get started today by downloading the new Windows 8.1 SDKs to unlock new revenue opportunities with more relevant advertising experiences.

Choosing the right sensor

$
0
0

The sensors available to Windows Store apps offer a powerful way to spice up your app’s functionality. Sensors let your app know the relationship between the device and the physical world around it; the direction, orientation, and movement in those realms. These sensors can help make your game, augmented reality app, or utility app more useful and interactive by providing a unique form of input. For example, you can use the motion of the tablet to arrange the characters on the screen or simulate the user being in a cockpit using the device as the steering wheel.

In this blog post I’ll review the supported sensors and offer some suggestions for their best use. While two different sensors may have overlap in the data that they provide, one particular sensor usually triumphs over the other in usefulness and efficiency. For a video overview check out this video on sensors:


Download this video to view it in your favorite media player:
High quality MP4 | Lower quality MP4

For more info about sensors, see the Aligning sensors with your app’s orientation blog post.

Scenarios for different sensors

As a general rule, decide from the outset whether your app will depend exclusively on sensors, or if sensors will just offer an additional control mechanism for your app. For example, a driving game using a tablet as a virtual steering wheel could alternatively be controlled through an on-screen GUI – this way, the app works regardless of the sensors available on the system. A marble tilt maze, on the other hand, could be coded to only work on systems that have the appropriate sensors. You must make the strategic choice of whether to fully rely on sensors or not. Note that a mouse/touch control scheme trades immersion for greater control. Make sure to include in your app’s description if sensors are absolutely required for using your app, otherwise you might get negative reviews from reviewers who purchased your app but were unable to use it.

Accelerometer

Accelerometers measure G-force values along the X, Y, and Z axes of the device and are great for simple motion-based applications. Note that “G-force values” include acceleration due to gravity; if the device is FaceUp (see Simple Orientation) on a table, the accelerometer would read -1 G on the Z axis. Thus, accelerometers don’t necessarily measure “coordinate acceleration” – the rate of change of velocity. When using an accelerometer, make sure to decipher between the Gravitational Vector from gravity and the Linear Acceleration Vector from motion. Note that the Gravitational Vector should normalize to 1 for a stationary tablet.

In this diagram, you can see how an accelerometer can resemble a suspended weight on a spring:

Image of accelerometer resembling a suspended weight on a string

In this diagram, you see that:

  • V1 = Vector 1 = Force due to gravity
  • V2 = Vector 2 = -Z axis of device chassis (points out of back of screen)
  • Θi = Tilt angle (inclination) = angle between –Z axis of device chassis and gravity vector

Image showing vector 1, vector 2, and the tilt angle (inclination)

Example 1: A game where a marble on the screen rolls in the direction you tilt the device (Gravitational Vector). This type of functionality closely mirrors that of the Inclinometer and could be done with that sensor as well by using a combination of pitch and roll. Using the accelerometer’s gravity vector simplifies this somewhat by providing an easily mathematically manipulated vector for device tilt.

A screenshot from the Marble Maze sample

A screenshot from the Marble Maze sample.

Example 2: An app that makes a whip’s cracking sound when the user flicks the device through the air (Linear Acceleration Vector).

Gyrometer

Gyrometers or gyroscopes measure angular velocities along the X, Y, and Z axes. These are very useful in simple motion-based apps that don’t concern themselves with device orientation but do care about the device rotating at different speeds. Gyrometers can suffer from noise in the data and/or a constant bias along one or more of the axes. For best practices, query the accelerometer to verify if the device is moving and determine if the gyro suffers from a bias. Then you can compensate for this in your app.

Image of gyrometer showing the device coordinate relationship

This shows the device coordinate relationship for gyrometer.

Example: App that spins roulette wheel based on a quick rotational jerk of the tablet.

Compass

The Compass sensor returns a 2D heading with respect to magnetic north based on the horizontal plane of the earth. This sensor is ideal for apps that want the direction the user is facing and may want to draw a compass rose or arrow on an app. However, we don’t recommend this be used to determine specific device orientation or for representing anything in 3D space. Geographical features can cause natural declination in the heading, so some systems support both “magnetic north” and “true north.” Think about which one your app prefers, but remember that not all systems report a “true north” value. Gyrometer and magnetometer (a device measuring magnetic strength magnitude) combine their data to produce the compass heading, which has the net effect of stabilizing the data (magnetic field strength is very unstable due to electrical system components).

Image showing the differences between magnetic north and true north

This showcases the difference between magnetic north vs. true north.

Example: App that wants to display a compass rose or map navigator.

Inclinometer

Inclinometers specify the yaw, pitch, and roll values of a device and work best with apps that care about how the device is situated in space given in traditional yaw, pitch, and roll values. We derive this data for pitch and roll by taking the accelerometer’s gravity vector and by integrating the data from the gyrometer. We establish yaw from magnetometer and gyrometer (similar to compass heading). Inclinometers offer advanced orientation data in an easily digestible and understandable way. Use inclinometers when you need device orientation but don’t need to manipulate the sensor data.

Image showing ranges of inclinometer values including yaw, pitch, and roll

This image shows the ranges of inclinometer values.

Example: App that changes the view to match the orientation of device, or draws an airplane with the same yaw, pitch, and roll values as the device.

Orientation

Device orientation is expressed through both quaternion and a rotation matrix. This sensor offers a high degree of precision in determining how the device is situated in space with respect to absolute heading, derived from the accelerometer, gyrometer, and magnetometer.

Graphic representation of quaternion units product as 90 degree rotation in 4D space

As such, both the inclinometer and compass sensors can be derived from the quaternion values. Quaternions and rotation matrices lend themselves well to advanced mathematical manipulation and are often used in graphical programming. Apps using complex manipulation should favor the orientation sensor as many transforms are based off of quaternions and rotation matrices.

Example: Advanced augmented reality app that paints an overlay on your surrounding based on the direction the back of the tablet is pointing.

Simple device orientation

This sensor detects the current quadrant orientation of the specified device or if it’s face-up or face-down, for a total of six possible states (NotRotated, Rotated90, Rotated180, Rotated270, FaceUp, FaceDown).

Example: A reader app that changes its display based on the device being held parallel or perpendicular to the ground.

Using multiple sensors in one app

Keep in mind that you aren’t limited to a single sensor for your app. The simple orientation sensor pairs well with other sensors if you want to have two different types of views or some other change in functionality. Inclinometer pairs extremely well with gyrometer; both use the same coordinate system, with one representing position and the other velocity.

Keep in mind that any time you use a fusion sensor you are technically using multiple sensors – the fusion sensors (Compass, Inclinometer, Orientation) combine and synthesize the data from the physical sensors (Accelerometer, Gyrometer, and Magnetometer). This is why we strongly recommend using one of the fusion sensors rather than using both an accelerometer and gyrometer to create pseudo-fusion sensor or some type of control scheme. We have already done the hard work for you!

Wrapping up

The wide array of sensors supported by Windows Store apps for Windows 8.1 offers you lots of options for making your apps more interactive. Make sure to select your sensor carefully and for the right reasons. By following the guidelines outlined in this blog post, your app will be able to run elegantly and perform as expected.

-Brian Rockwell, Program Manager for Sensors on Windows

Developing apps that use image scanners in Windows 8.1

$
0
0

Windows 8.1 now supports scanning, so your users can capture images directly in Windows Store apps. By choosing to integrate scanners in your apps, your users can interact with their devices to easily get photos and documents straight from physical media. The digitized versions can then be stored or even shared on social media. You can customize how your scanning UI looks and feels to your users. You can even brand your app on the scan experience it provides, setting yourself apart from other apps.

Let’s take a look at how your app can use the new Scan Runtime APIs to scan documents and photos.

Why should your app incorporate image scanning?

Great apps enable your users to be more productive; users can archive, modify, and share content in streamlined experiences when you provide the right tools to transform media from the physical to the digital world.

If your app needs a user’s signature from a printed page, you need to ensure that the page can be scanned in and identified by your app. Users might want to load non digital photos into your app. Without scanning capabilities, they won’t be able to do this.

Supporting document acquisition can help integrate your users’ existing documents and paper-based processes into your service, thereby increasing its value.

Whether you’re building apps that need to quickly acquire sketches for creative projects, bring in high resolution photos to organize and archive, or process documents with text-recognition work, you can easily orchestrate this by using the Windows.Devices.Scanners namespace.

Identifying scanners and drivers for your apps

The majority of consumer scanners connected to Windows are multi-function (or all-in-one) printer devices. These types of devices do more than just print; they scan, copy, and even fax. The scanner components typically consist of a flatbed that contains a glass panel on which images or documents are placed, or a feeder that allows users to scan in multiple pages without manual intervention. There are also standalone scanners that have no printer capabilities.

In order for your users to scan from your app, they must have a WIA (Windows Image Acquisition) compatible scanner that has been installed on their machine and that uses a WIA 2.0 scan driver. (WIA 2.0 has been a logo requirement for all locally-connected scanner devices since June 2010.) The installed device must appear listed in Device Manager, Devices and Printers, Scanners and Cameras, etc. A quick way to check to see if the system is configured properly to use a scanner is to run a test scan with the inbox Scan app.

Windows helps make the vast majority of scanners work by giving driver support. Windows provides a single in-box driver solution for all Wi-Fi and Ethernet connected scanners that implement the Microsoft WSD (Web Services on Devices) scanning protocol, WS-Scan. This allows network-connected scanners to just work with Windows without additional drivers. If a scanner is connected via USB, there’s a good chance that the right WIA driver is available on the user’s system. Their system may use a Windows provided in-box driver, a driver pulled from Windows Update, or manually downloaded driver from the scanner manufacturer’s website. Feel confident that using the Scan Runtime APIs is supported on the top scanners and multi-function devices available in the ecosystem today.

What are the new scan APIs built on?

Apps need not be developed specifically for particular scanner devices. The Windows Image Acquisition (WIA) platform standardizes the interaction between apps and scanner devices. Any app in Windows 8.1 can use a scanner device as long as the device is WIA-compatible and a WIA 2.0 driver is installed on the machine.

WIA provides a framework that allows a device to present its unique capabilities, and for apps to invoke those capabilities. Those familiar with Windows Imaging Acquisition (WIA) can appreciate the muscle this platform brings to table; it’s the stability and power that the new Scan Runtime APIs are built on top of. The WIA platform consists of the WIA COM APIs, WIA services, and kernel-mode drivers. You can learn more about WIA Windows Image Acquisition (WIA).

A Store app can use the Scan Runtime APIs built on the Windows Imaging Acquisition (WIA) platform

Figure 1: Your Store app can use the Scan Runtime APIs built on the Windows Imaging Acquisition platform.

How to implement scanning in your app

Check out the Quickstart: Scanning guide for a jump start on building apps that scan. Watch this video for a quick overview on how to add scanning to your app.


Download this video to view it in your favorite media player:
High quality MP4 | Lower quality MP4

Summary of the steps to add scanning to your app, from getting the scanner object to previewing and scanning

Figure 2: This image summarizes the steps to add scanning to your app- from getting the scanner object, to previewing and scanning using specified scan settings.

The Scan Runtime APIs supports scanning from three sources: Flatbed, Feeder, and Auto-configured. After the scan source is selected, the remaining settings become available for specification, or your app can scan immediately using the defaults.

scanning table

Here are some common settings you may want to expose in your app.

Note: It’s best to keep the scanning experience as simple as possible for your users. You might want to hide more advanced settings so that users can quickly get what they need scanned.

Resolution: A user may want to scan photos at very high resolutions but documents at much lower resolutions providing greater scanning speed. Your app can specify resolution, the fidelity at which an image is scanned, using the DesiredResolution property. A device provides the range of values supported by providing the minimum and maximum resolution, but won’t list all values supported. You can get this information by setting the DesiredResolution property, and this property chooses the closest resolution value, which is ActualResolution property. In this example, a flatbed scanner is set to scan at a resolution of 100 DPI, given that the resolution is supported by the scanner.

ImageScannerResolution resolution = new ImageScannerResolution();
Resolution.DpiX = resolution.DpiY = 100;
myScanner.FlatbedConfiguration.DesiredResoltuion = resolution;

File type: When you use the ImageScannerFormat enumeration, your app can directly scan to the following document and image file types, only if they are supported by your device: Bitmap, JPEG, PNG, XPS, OXPS, PDF, TIFF.

myScanner.FlatbedConfiguration.Format = ImageScannerFormat.jpeg;

If a device fails to provide a certain format, you can supplement the functionality by making it available. Your app can use the file-conversion APIs (see the BitmapEncoder and BitmapDecoder classes in the Windows.Grapics.Imaging namespace) to convert the scanner’s native file type to the desired file type. You can even add text recognition features so that your users can scan papers into reconstructed documents with formatted, selectable text. You can provide filters or other enhancements so that scanned images can be adjusted by a user. Ultimately, you should not feel limited by what your users’ devices can or cannot do.

Suggested guidelines

As you bring new functionality into your app, keep the scan experiences simple and consistent for your users. If a user needs to quickly scan many documents, avoid cluttering the UI with scan settings decisions (like brightness/contrast), in order to let the user get their jobs done. A good example of a simple, yet powerful Windows Store app that scans is the Scan app, which is included in Windows 8.1. You can find it by searching for Scan using the Search charm.

How to handle errors from the device

Your app can capture error cases returned by the Scan Runtime APIs with WIA HRESULTS, which are defined in the WIA Error Codes list. These include errors like device busy, paper jam, and other device-specific situations. Unless an error is actionable, like a paper jam, it’s best to represent errors with a general error message that something went wrong with the scan job. You can get codes based on the Microsoft Platform SDK, file: /Include/WiaDef.h

Apps that scan can do more

Scanning in Windows Store apps is now possible in Windows 8.1. Windows has the hardware ecosystem and you have a great opportunity to create apps that provide the best end-to-end experience. Your apps can bring together user’s documents to the business logic of your app. They can provide users with new capabilities for their data-rich, physical papers, or they can post-process acquired visuals. Scanning technology has the potential to make your apps do more, by acquiring data and images from media directly from the real world.

–Monica Czarny, Program Manager, Windows

Resources

Opportunities for app builders this holiday season

$
0
0

We expect this holiday season to be especially strong for the Windows Store and Windows Phone Store. There’s an amazing selection of great tablets, phones, and PCs on the market from many of our device partners. And with new Microsoft gift cards designed to encourage and enable users to discover and purchase apps on those devices, we’re forecasting over $100M to be available for consumers to buy apps and games this holiday season across 100 retailers in 41 markets.

It’s a great time to publish your apps, so don’t delay – we recommend that you submit your apps as soon as possible so that they’re available for customers during the holiday season. For more info about the new opportunities for Windows and Windows Phone app builders, and some tips on how to make your apps stand out, check out Todd Brix’s post on the Windows Phone Developer Blog.

Windows 10 is empowering developers to dream again

$
0
0

Yesterday Terry showed you how Windows 10 will usher in a new generation of Windows by powering innovation and more personal computing across the largest range of devices, including Microsoft Surface Hub and the world’s first holographic computing platform; Microsoft HoloLens.

Windows 10 will empower people to do some amazing things with a new version of Cortana for the PC, a new web browsing experience (“Project Spartan”), a true Xbox quality gaming experience on Windows, new holographic and group computing devices, and of course a new set of universal apps – People & Messaging, Photo, Video, Music and Maps – that begin to showcase a few of the new developer platform capabilities.

Windows 10 is also designed to be a service that delivers continuous innovation and new possibilities to the 1.5 billion people already using Windows each month. We’ll start by offering Windows 10 as a FREE upgrade to qualified Windows 7, Windows 8, Windows 8.1 and Windows Phone 8 and 8.1 customers – creating the broadest possible customer base*.

Today we’re going to talk about what it all means for you, our Windows developers.

Last April at Build 2014 we talked about the principles behind the design of our Windows development platform

In Windows 10, we are further simplifying how we talk about these goals as follows:

Driving scale through reach across device type. We are working to make Windows 10 a unified, developer platform for ALL of our devices so you can reach the greatest number of customers with your work across phones, tablets, PCs, Xbox, IoT devices and the new Surface Hub and HoloLens opportunities

Delivering unique experiences. Microsoft’s company-wide emphasis on the people using technology rather than simply the platforms themselves means that we are increasing efforts to provide new technologies that improve the way people interact with computers. With Windows 10, developers will be able to build on top of our investments in Cortana and speech recognition, touch, audio, video and holograms to extend their app experiences in ways they used to only dream about but are now possible on Windows 10.

Maximizing developer investments. We remain committed to helping you get the most out of your investments in training, tools, and code to continue and target our new offerings. We also recognize that many of you are looking for more ways to target a range of platforms with the same basic code or toolset with cross platform technologies.

Driving scale

Everyone wants a broader customer base and we believe Windows 10 will continue to increase customer adoption. Another closely related problem facing software developers today is the proliferation of device types and the amount of work it takes to consistently deliver compelling experiences across them all. Windows 10 addresses these fragmentation challenges.

First, as noted earlier Windows 10 will begin a new relationship with customers in which experiences are updated and delivered regularly – like a service, ensuring the vast majority of customers are using the latest version to take full advantage of your latest experiences.  That process begins with a free upgrade for eligible Windows customers. With this new low friction and rapid cadence, Windows will empower developers to take advantage of new features and capabilities faster than ever before because now their customers are always running the latest Windows.

We’re also doing the work necessary to help make sure that apps and games look great across a full range of devices, display surfaces and input models. The Windows 10 platform will build upon the universal Windows app framework released with Windows 8.1 to provide developers the tools to deliver new app experiences across devices with a minimum amount of additional work.

Delivering unique experiences

Windows 10 introduces several new features that open up new avenues for developer innovation. With Windows 10 and HoloLens developers will have access to a platform that bridges the digital and physical world changing the way people interact with devices and applications.  Many of you already tap into Cortana on phones. Soon, you’ll be able to take advantage of Cortana with new capabilities on a wider variety of Windows 10 devices.

We’ve also begun to share more about a new web experience for Windows 10 dubbed “Project Spartan,” which gives people new and better ways to engage the content they love across devices. Spartan introduces a new rendering engine designed for interoperability with the modern web. You can find out more about what Spartan means for web development from the team that built it on the IEBlog.

Maximizing your investments

Microsoft has a long history of protecting the investments of developers. For every release we dedicate an enormous number of resources to make sure the vast majority of existing applications continue to run as expected.

But protecting investments is about more than just ensuring that existing code continues to run; it’s also about safeguarding the skills you’ve spent years perfecting continue to serve you well in building solutions for the Windows 10 platform. With Windows 10 you’ll continue to build apps with the language of your choice in Visual Studio and enjoy a variety of cloud services through Azure, all of which can be developed and deployed in Visual Studio using the tools, languages and frameworks with which you are familiar.

Maximizing investments also speaks to our promise to support cross platform solutions. We know that developers have made investments in order to more easily target multiple platforms and device types. Accordingly, we’ve taken steps to make it easier than ever for developers working across platforms to also bring their solutions to Windows.

Back at Build last year we announced that we were releasing Win JS for use under an open source license across platform. (http://dev.windows.com/en-us/develop/winjs and http://try.winjs.com). We continue to invest in improving these libraries, with the release of Win JS 3.0 last September, a major update.

We then announced plans to help developers use Visual Studio and C# to deliver solutions to iOS and Android (as well as Windows), leveraging tools like Xamarin (http://xamarin.com) and Unity (http://unity3d.com). We also recently announced support for applications built using Apache Cordova in Visual Studio, with a full Android emulator experience (). Finally, for native C++ developers, we recently announced Visual Studio support for building not only shared libraries for Android, but also complete Native Activity applications for Android.

What’s next?

We’re more committed than ever to making sure that you can leverage your work to reach more customers, regardless of where they are, what device type they’re on, or what operating system they’re running. The best way to start preparing for Windows 10 is to start building universal Windows apps today for Windows 8.1.

Here are some great resources to get started:

Official Documentation

Comprehensive Online Training

  • If you are currently a Windows Phone Silverlight developer, there’s never been a better time to investigate moving your development over to Windows XAML, which provides the ability to deliver universal Windows apps. We recently released a comprehensive set of materials detailing how. Check them out here.

We’ll have much more to share about the Windows 10 developer experience over the coming months. Build 2015 will be full of detailed Windows 10 platform information.  Registration opens today, so hurry to secure a seat by visiting buildwindows.com [Update: Build is currently sold out but we encourage you to join the wait list]. You can read more about Build from Steven Guggenheimer here.

We know many of you will participate in the Windows Insider Program , through which you will be able to acquire the latest builds of Windows 10. Keep in mind that this is prerelease software, and you are likely to encounter a variety of issues at this stage. You will likely not want to use this yet as your primary development Operating system.

We’re also working to include our developer tools and SDKs into the Windows Insider Program in the future, so if you want to be one of the first ones to receive early previews of our tools please sign up today.

*Hardware and software requirements apply. No additional charge. Feature availability may vary by device. Some editions excluded. More details at http://www.windows.com.

What is app attribution?

$
0
0

Mobile app attribution, different from traditional online attribution which uses things like cookies or pixel tags, is the method of measuring a user’s activities on an app. These activities could be an app install, making in-app purchases or completing a level within an app. This information is important to understanding the success and performance of marketing campaigns.

Since apps don’t support traditional tracking methods like cookies etc., other means are needed to measure a user clicking an ad through to installing an app, and additional activities within that app.

Currently, there is no industry standard for measuring methodology, but there are some methods of measuring that have become universal.

The two most common methods of measuring are:

  • Device Fingerprinting – This method uses basic information from a device to redirect a user from an ad click to an app install. Fingerprinting works by using a measurement URL that gathers data from the device to create the fingerprint.
  • Unique Identifier Matching – An attribution tool using unique identifiers will match that identifier from installs to clicks with 1:1: accuracy when passed app to app. This process is automated and done in real-time.

So why does app attribution matter? Not only does it provide a greater understanding of how a marketing campaign is performing, but it shows where spending money on campaigns is most effective. Additionally, advertising models such as Cost Per Install (CPI) are only possible if attribution is in place. Using a good attribution tool will help facilitate this process. To learn more about CPI advertising, please see Microsoft partner Vungle by clicking here.

New attribution partner: AppsFlyer

To highlight the integration processes, here is an example from AppsFlyer, the latest partner to support Windows.

AppsFlyer, an advertising attribution and marketing analytics platform, is now available for Windows 10 apps. AppsFlyer measures more than $4 billion in mobile ad spend annually for over 10,000 app marketers, agencies and brands. Their proprietary solutions measure and optimize app marketing performance across over 2,000 integrated ad networks and platforms.

As an official Facebook Mobile Measurement Partner, Google Official Partner and Twitter Official Partner, AppsFlyer provides mobile advertisers with unbiased attribution, smart deep linking, mobile campaign analytics, in-app user engagement tracking, lifetime value analysis, ROI and retargeting attribution for more than 800 million installs each month. As a leader in app attribution, AppsFlyer’s MAMA Library features an array of useful and informative mobile industry studies and marketing guides. Their most recent study, The State of In-App Spending, provides an in-depth look at in-app purchase benchmarks and behavior by vertical and region. This is a great resource, and we are proud to have AppsFlyer onboard.

Windows Phone SDK Download

To download the Windows Phone Universal App SDK, click here.

1. Initial Steps

The Windows Universal SDK is installed via the NuGet Package Manager. To install the Appsflyer Windows SDK via NuGet:

  • Right click the project file
  • Click “Manage NuGet Packages”
  • Click “Browse” and search for “AppsFlyerLib”
  • Click the AppsFlyerLib and click Install

If you choose not to use the NuGet package, you can embed AppsFlyer’s SDK into your app manually:

  • Copy the AppsFlyerLib.winmd into your project.
  • In Visual Studio, click Add Reference on the Windows Phone project.

Attribution m1

  • Locate AppsFlyerLib.winmd and add it.

attribution m2

IMPORTANT:

AppsFlyer uses a Newtonsoft.json package. This is a standard library for parsing Json in Windows. You can add this package using NuGet in Visual Studio. This solves the File Not Found exception in the DLL.

  • In Visual Studio, right-click References and select NuGet Package Newtonsoft.json and add it.
  • Allow Internet access in the app manifest, or use Visual Studio in the Capabilities tab.

2. SDK Initialization & Installation Event (Minimum Requirement for Tracking)

  • Add the following code into your App Launch method.
  • Set your appId & DevKey:
    • Populate tracker.appId and tracker.devKey with your values
    • You can get your AppsFlyer DevKey on our dashboard under SDK Integration

protected override void OnLaunched(LaunchActivatedEventArgs e)
{
this .InitializeComponent();
this .Suspending += this .OnSuspending;
AppsFlyerLib. AppsFlyerTracker tracker =
AppsFlyerLib. AppsFlyerTracker .GetAppsFlyerTracker();
tracker.appId = "YOUR_APP_ID_HERE" ;
tracker.devKey = "YOUR_DEV_KEY_HERE" ;
tracker.trackAppLaunch();
}

3. In-App Events Tracking API (Optional)

This API enables AppsFlyer to track post-install events. These events are defined by the advertiser and include an event name in addition to optional event values.

Add the following code to track post install events:


public void TrackEvent(string eventName, IDictionary<string, Object> eventValues)

  • eventName is any string which defines the event name. You can find a list of recommended event names here.
  • eventValues is a dictionary of event parameters that comprise an event. You can find a list of recommended parameters here.
  • Counting revenue as part of inapp events: Use InAppEventParameterName.REVENUE (“af_revenue”) constant parameter name to count revenue as part of an inapp event. You can populate it with any numeric value, positive or negative.

Example:


AppsFlyerLib.AppsFlyerTracker tracker = AppsFlyerLib.AppsFlyerTracker.GetAppsFlyerTracker();
           IDictionary<string, object> eventValues = new Dictionary<string, object>();
           eventValues.Add(AppsFlyerLib.AFInAppEventParameterName.CONTENT_ID, "id123");
           eventValues.Add(AppsFlyerLib.AFInAppEventParameterName.REVENUE, "10");
           eventValues.Add(AppsFlyerLib.AFInAppEventParameterName.CURRENCY, "USD");
           tracker.TrackEvent(AppsFlyerLib.AFInAppEventType.ADD_TO_CART, eventValues);

For a complete list of AppsFlyer Rich InApp Events, see here.

4. Advanced Integration

The APIs below are optional and are part of the advanced integration with AppsFlyer SDK.

4.1 Set Currency Code (Optional)

You can set a global currency code using the API below in addition to specific currency codes that can be used as part of each inapp event sent to AppsFlyer. USD is the default value. Please find acceptable ISO currency codes here.

Use the following API to set the currency code:


tracker.currencyCode = "GBP";

4.2 GetAppsFlyerUID (Optional)

An AppsFlyer Unique ID is created for every new install of an app.

Use the following API in order to get this ID:


public string getAppsFlyerUID()

4.3 Customer User ID (Optional)

Setting your own customer ID enables you to cross-reference your own unique ID with AppsFlyer’s user ID and all other device IDs. This ID is available in the AppsFlyer CSV reports along with postbacks APIs for cross referencing with your internal IDs.

To set your Customer User ID:


tracker.customerUserId = "YOUR_CUSTOMER_USER_ID";

4.4 GetConversionData (Optional)

You can receive the conversion data for every install through the SDK using this API. Add the following code to track post install events:


Task.Run(async () =>
{
     AppsFlyerLib.AppsFlyerTracker tracker = AppsFlyerLib.AppsFlyerTracker.GetAppsFlyerTracker();
     string conversionData = await tracker.GetConversionDataAsync();
});

For more information regarding this advanced functionality, read here.

Other attribution partners supporting Windows

If you’re interested in learning more about other attribution partners supporting Windows, please check out this list:

Adjust – A mobile attribution and analytics company that provides app marketers with a comprehensive business intelligence platform. For documentation and SDK installation, please click here.

Tune – An enterprise platform providing measurement to mobile marketers and their partners— advertising attribution analytics, app store optimization, and in-app marketing included. For documentation and SDK installation, please click here.

Kochava – An attribution and analytics company for connected devices from mobile and tablet to TVs and bots. For documentation and SDK installation, please click here.

Download Visual Studio to get started!


Battery awareness and background activity

$
0
0

The Windows platform targets all kinds of devices: desktops, laptops, tablets, phones, HoloLens, IoT and Xbox. As a developer you want your users to have a great user experience with your app across the entire breadth of devices it is available on. Each of these devices has unique capabilities that your app should be aware of. Some have large screens, some have small screens. Some have keyboards for input, some have touchscreens. Some are stationary and plugged into a wall for power, while some are portable and use a battery.

For portable devices specifically, all-day battery life is crucial in order for your app to be used to its fullest potential, and it is now an expectation of the modern mobile user. Battery-saving features will ensure your app is providing the best possible experience for users.

Battery Use Settings

How users perceive battery life on Windows is changing because it’s more visible to them than ever. Tools available to any average user in Settings show how much each app is impacting their device’s battery life. The Battery Use view breaks down the energy usage of your app while it is in use in the foreground of a user’s device or running quietly in the background, then ranks your app compared to the other apps on the device. This measured energy usage list is limited to the amount of energy your app uses on battery power and not while the device is plugged in and charging.

IMAGE1

Along with visibility into your app’s battery usage in the background, users are given new options in the Windows 10 Anniversary Update for controlling an app’s background activity.

IMAGE2

Users have three options available for each app’s background activity: Always Allowed in the Background, Managed by Windows and Never Allowed in the Background. These options allow a user to choose which apps’ background activities they consider important and which should be disabled.

Background Access Status

As a developer you have the ability to see which setting is currently applied to your app using the BackgroundAccessStatus enum. The first step in running code in the background is to request background access using BackgroundExecutionManager.RequestAccessAsync(). This returns the BackgroundAccessStatus enum value that details your app’s current ability to run in the background. With the new updates to the Settings available to users, this enum has also changed. There are now four new options:

  • AlwaysAllowed: The user has allowed your app’s background activity to always be able to run.
  • AllowedSubjectToSystemPolicy: Your app’s background activity is managed by Windows and currently is able to run.
  • DeniedSubjectToSystemPolicy: Your app’s background activity is managed by Windows and currently is not able to run.
  • DeniedByUser: The user has denied your app’s ability to run in the background.

These new options are provided on devices with the Windows 10 Anniversary Update. On devices with previous builds of Windows 10 you could receive the previous values defined on MSDN. Below is an example of how to check for both sets of values:


private async Task<String> CheckBackgroundActivitySetting()
{
var accessStatus = await BackgroundExecutionManager.RequestAccessAsync();
string accessStatusString = "Unspecified";

// Use API Information check to determine if Battery Use Settings values are available on this device
bool isBatteryUseSettingAvailable = Windows.Foundation.Metadata.ApiInformation.IsEnumNamedValuePresent("Windows.ApplicationModel.Background.BackgroundAccessStatus", "AlwaysAllowed");

if(!isBatteryUseSettingAvailable)
{
// Subset of values available on Windows 10 devices
switch (accessStatus)
{
case BackgroundAccessStatus.AllowedMayUseActiveRealTimeConnectivity:
accessStatusString = "Allowed";
break;
case BackgroundAccessStatus.AllowedWithAlwaysOnRealTimeConnectivity:
accessStatusString = "Allowed";
break;
case BackgroundAccessStatus.Denied:
accessStatusString = "Denied";
break;
case BackgroundAccessStatus.Unspecified:
accessStatusString = "Unspecified";
break;
}
}
else
{
// Subset of values available on Windows 10 Anniversary Update devices
switch (accessStatus)
{
case BackgroundAccessStatus.AlwaysAllowed:
accessStatusString = "Allowed";
break;
case BackgroundAccessStatus.AllowedSubjectToSystemPolicy:
accessStatusString = "Allowed subject to system policy";
break;
case BackgroundAccessStatus.DeniedBySystemPolicy:
accessStatusString = "Denied due to system policy";
break;
case BackgroundAccessStatus.DeniedByUser:
accessStatusString = "Denied";
break;
}
}
return accessStatusString;
}

Battery Saver

Battery Saver is another tool users have to get the most out of their battery. Users can enable this feature to start automatically when the battery reaches a certain level in the Settings. Like the Battery Use options, Battery Saver manages all types of background activity in order to provide the best foreground experience for the user. When Battery Saver is on all forms of background triggers and extended execution are canceled or revoked. This reduced background activity allows the user to stretch out the last percentages of their battery until they can reach another power source to recharge. As a developer, you can determine its status using the PowerManager.PowerSavingMode property.

If your app is a communication app and requires background activity such as push notifications to function, then you should warn your user that during battery saver mode that they will not receive notifications. Similarly, background transfers will be temporarily stopped while Power Saving Mode is on, so if a user initiates a download while Battery Saver is active you should notify your user that moving away from the app will halt the download.

Best practices

Here are some best practices for effectively performing background activity to ensure good battery life for your users:

  • Test your app in multiple power scenarios, just like you would for multiple screen sizes. If your app is going to run on devices that are plugged into the wall for power as well as on devices that have a battery, test using both of those configurations. Make sure to test your app under battery saver.
  • Move any opportunistic background work to the MaintenanceTrigger. The Maintenance Trigger provides a much longer time for background activity to complete, around ten minutes, and runs only when the device is connected to AC power. This way you can complete your background work in a single shot rather than waking up the system frequently to complete small parts of the work.
  • Use the BackgroundWorkCostNotHigh System Condition when registering your opportunistic background tasks. Background work cost is the cost on the device to do background work. A Low cost work item would run when the device is plugged into AC Power, a Medium cost work item would run when on battery power and the screen is on for active usage, and a High cost work item would run when the device is on battery power and the screen is off in an attempt to reduce power usage. This system condition ensures that your background work will run when resource usage is in the Low or Medium categories. Below is an example of how conditions are added to background task registration.

private void RegisterBackgroundTask()
{
    var builder = new BackgroundTaskBuilder();
    builder.Name = "My Background Trigger";
    builder.SetTrigger(new TimeTrigger(15, true));
    builder.AddCondition(new SystemCondition(SystemConditionType.BackgroundWorkCostNotHigh));
    BackgroundTaskRegistration task = builder.Register();
}

  • All apps start with their background activity set to Managed by Windows. This allows the system to determine the most effective balance of background activity to battery savings depending on how the user interacts with their apps.

Wrapping Up

Battery usage enables portability of your experience. Knowing how to scale your app’s experience based on battery availability will allow your users to enjoy your app for more time, in more environments, and on more devices. Users have new visibility and choice for enabling battery draining background activity per app. Be mindful of your battery use in the background, as users may choose to disable background activity for your app or uninstall it completely. Using the best practices described above will enable a great experience for your users across all of their portable devices.

Get started with Windows App Studio.

Clickteam Fusion 2.5 Adds New UWP Exporter

$
0
0

New developers – bring your app to various devices on Windows 10 with a simple mouse click.

Clickteam has joined the Universal Windows Platform revolution with the release of its new UWP Exporter for Clickteam Fusion 2.5, a game and software creation tool used to write 2D games and apps across different platforms. With this integration, game and app makers can bring their creations to Windows 10 with a simple mouse click.

For those unfamiliar with Clickteam Fusion 2.5, it allows anyone to create 2D games – no programming knowledge necessary. Once they’ve learned the basics (which takes about an hour), aspiring game makers can build side-scrollers, puzzle games, action games and more. Instead of requiring users learn a programming language, Clickteam Fusion 2.5 uses visual programming, allowing developers to drag and drop objects to build a game world. Graphics can be created using the tool’s built-in graphics editor, imported from your collection or selected from Fusion’s library of pre-made graphics.

image 1

The UWP Exporter then allows developers to take an existing Fusion project and export it into Microsoft Visual Studio, from where it can be deployed for testing across Windows 10 devices, including tablets, PCs, Windows phones and even Xbox One. Using the same source file or Multimedia Fusion Application (MFA) – a file format used by Fusion – and minimal event or programming changes, developers can also take existing projects and publish them to Windows Store with ease. That’s why games like Quadle, Concrete Jungle, Disastr Blastr and Room 13 are being actively developed for Xbox One and Windows 10 using the UWP Exporter.

image 2

The UWP Exporter also includes features such as hardware acceleration, joystick-powered virtual mouse support, HTML5 and more. Xbox Gamepad support is also set to be supported in the future.

Developers can download a free limited version of Clickteam Fusion 2.5 here, or the full version here. A special developer version with exclusive features, such as special objects and a run-time licensing agreement, is also available here. The full or developer versions of Clickteam Fusion 2.5 are required to use the new UWP Exporter (available here). Developers will also need Microsoft Visual Studio to compile final files, and an Xbox One developer account is necessary to test or deploy on Xbox One.

Need some ideas for what to build? Visit indiegamecreator.com to get a taste of the creativity coming out of the Fusion user base.

Get started with Windows Visual Studio.

Building a game for Windows 10? Get inspired by Imperia Online.

Customer segmentation and push notifications: a new Windows Dev Center Insider Program feature

$
0
0

We’re excited to announce that we’ve added a new customer segmentation and push notifications feature to the Windows Dev Center Insider Program. To try it out, you’ll need to join the Dev Center Insider Program if you haven’t done so already. Then, get started with an overview video to see detailed steps on how to create segments and push notifications. With this feature, you can quickly create custom notifications to send to your app’s customers—all of them, or to only a selected segment that meets the criteria you define, like demographics and purchase status. Customer segments and notifications can be used to encourage desired actions (like buying something) or for loyalty and retention campaigns, maximizing cross and up-sell opportunities, identifying product differentiation strategies and discovering what each segment finds most valuable.

When defining a customer segment, you first select a specific app. Then you can create AND/OR queries that include or exclude customers based on attributes such as app acquisitions, acquisition source and demographic criteria, with options to refine further. You can also select criteria related to first time purchase status, total Store spend, and total spend within the app you’ve selected. Most of these attributes are calculated using all historical data, although there are some exceptions: App acquisition date, Campaign ID, Store page view date and Referrer URI domain are limited to the last 90 days of data. The segment will only include customers who have acquired your app on Windows 10; if you support older OS versions, downloads on those older OS versions will not be included in any segments you create.  You won’t be able to create customer segments that don’t meet a minimum size threshold, and only adult age groups are included in any customer segment.

To define a segment of your app’s customers:

  1. Click Customer groups from the left navigation pane of your Dev Center dashboard.
  2. Use a segment template or click Create new group.
  3. Choose your app and construct your own filter criteria.
  4. Click Run to apply your filters and see quick results.
  5. Save your segment for later use.

After you save a segment, it will become available to use for notifications after 24 hours. Segment results are refreshed daily, so you may see the total count of customers in a segment change from day to day as customers drop in or out of the segment criteria.

To send a custom notification to a segment of your app’s customers:

  1. Register your app to receive notifications.
  2. From your Dev Center dashboard, select your app.
  3. Click Services from the left navigation pane.
  4. Click Push notifications.
  5. Click New notification to create the notification.
  6. Define your notification and parameters.
  7. If you have not already created your segment as described above, click Create new customer group. If you have already created your segment, it will appear in the drop-down list (after 24 hours from the time you created the segment).
  8. Schedule the time to deliver the notification, and then click Save.

Please try it out and let us know what you think. What additional attributes would you like? What else would help? Please give us your feedback using the Feedback link at the bottom right corner of any page in Dev Center, or take our 2-minute survey.

Introducing the UWP Community Toolkit

$
0
0

Recently, we released the Windows Anniversary Update and a new Windows Software Developer Kit (SDK) for Windows 10 containing tools, app templates, platform controls, Windows Runtime APIs, emulators and much more, to help create innovative and compelling Universal Windows apps.

Today, we are introducing the open-source UWP Community Toolkit, a new project that enables the developer community to collaborate and contribute new capabilities on top of the SDK.

We designed the toolkit with these goals in mind:

1. Simplified app development: The toolkit includes new capabilities (helper functions, custom controls and app services) that simplify or demonstrate common developer tasks. Where possible, our goal is to allow app developers to get started with just one line of code.
2. Open-Source: The toolkit (source code, issues and roadmap) will be developed as an open-source project. We welcome contributions from the .NET developer community.
3. Alignment with SDK: The feedback from the community on this project will be reflected in future versions of the Windows SDK for Windows 10.

For example, the toolkit makes it easy to share content from your app with social providers like Twitter, taking care of all the OAuth authentication steps for you behind the scenes.


            // Initialize service
            TwitterService.Instance.Initialize("ConsumerKey", "ConsumerSecret", "CallbackUri");

            // Login to Twitter
            await TwitterService.Instance.LoginAsync();

            // Post a tweet
            await TwitterService.Instance.TweetStatusAsync("Hello UWP!");

Additionally, the toolkit provides extension methods that allow developers to animate UI elements with just one line of code.


await element.Rotate(30f).Fade(0.5).Offset(5f).StartAsync();

Below you will find more details about the features in the first release, how to get started, the roadmap and how to contribute.

UWP Community Toolkit 1.0

The toolkit can be used by any new or existing UWP application written in C# or VB.NET. Our goal is to support the latest and previous stable release of the SDK and at this time, the toolkit is compatible with apps developed with Windows 10 SDK Build 10586 or above.

The toolkit can be used to build UWP apps for any Windows 10 device, including PC, Mobile, XBOX, IoT and HoloLens. You can also use the toolkit with an existing desktop app converted to UWP using the Desktop Bridge.

Here are just some of the features included in the first release of the toolkit.

image1

We are also releasing the UWP Community Toolkit Sample App in the Windows Store that makes it easy to preview the toolkit capabilities even before installing the tools or downloading the SDK. The app will also allow you to easily copy & paste the code you will need to get started using the toolkit in your project.

image2

Getting Started

It’s easy to get started:

1. Download Visual Studio 2015 with Update 3 and the Windows 10 SDK
2. Create a new UWP project (or open an existing one)
3. Launch Visual Studio 2015
4. Create a new project using the Blank App template under Visual C# Windows Universal

Image 3

5. Add the UWP Community Toolkit to your project
6. In Solution Explorer panel, right click on your project name and select “Manage NuGet Packages”

image4

7. Search for “Microsoft.Toolkit.UWP”
8. Select desired packages and install them

image5

9. Add a reference to the toolkit in your XAML pages or C#

          a. In your XAML page, add a reference at the top of your page


<Page  x:Class="MainPage"
       	xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls"
...

          b. In your C# page, add the namespaces to the toolkit


using Microsoft.Toolkit.Uwp;
namespace MyApp
{
...

10. You can copy & paste code snippets for each feature from the Sample App, or find more details in the documentation.

Roadmap

In the future, we plan to release stable updates through the Visual Studio NuGet package at a regular cadence.

The toolkit is completely open-sourced on GitHub, including the source code of the toolkit, source code of the sample app and even the documentation. The roadmap for the next release is available here.

  • If you need to report a bug or share a feature request, please use this form.
  • If you would like to contribute your code, please start from here.

We are excited about the contributions that several community members already submitted in this first release, including Morten Nielsen, Scott Lovegrove, Pedro Lamas, Oren Novotny, James Croft, Diederik Krols, Hermit Dave, Thomas Nigro, Laurent Bugnion, Samuel Blanchard and Rudy Hyun. We are looking forward to continuing to grow the toolkit with even more community contributions.

So please go browse the sample app and learn about the experiences, then grab the NuGet package yourself and play around. We want developers to give us feedback on the usability and helpfulness of the features that exist in the toolkit. There is much to do in an open source project: we can get some help to improve accessibility and localization, and ensure the current capabilities work for all apps.

And while you are at it, JOIN THE FUN!

Giorgio Sardo, Principal Group Program Manager, Windows/PAX

David Catuhe, Principal Program Manager, Windows/PAX

Helpshift releases Windows SDK

$
0
0

In-app customer service provider Helpshift just announced a Windows version of their SDK. Helpshift has reinvented the customer service industry by deflecting customer service requests away from traditional phone and email channels towards in-app self-service channels. Helpshift’s SDK functionality includes searchable FAQs, in-app chat, CRM ticketing and in-app surveys.

Helpshift customers see a boost in app ratings and higher customer satisfaction, app retention and monetization. The Windows 10 release is one of the first versions of the Helpshift SDK that will operate across both mobile and desktop landscapes.

Helpshift’s Key Features Include:

  • Searchable FAQsIMAGE1
    • Powerful FAQ search algorithms gives faster access to FAQs
    • FAQs are cached on devices so they are fully searchable offline
    • Native FAQs work in over 30 languages
  • Intelligent ticket routing
  • Real time data on device, operating system, browser type
  • Ticket analysis and reporting
  • Users connect with support via web, email, and mobile app

IMAGE2

The Helpshift Dashboard

Helpshift has a powerful analytics dashboard for a high level view of ticketing and resolving issues.

IMAGE3

Helpshift’s agent scoring functionality measures numerous KPIs – displayed on an easy-to-read report. The report allows a high level view of agent performance and shows the rate at which tickets are resolved.

IMAGE4

The individual ticket view allows the agent to use valuable user data to resolve a ticket quickly. It is also a valuable tool to determine the overall satisfaction and performance of an app.

IMAGE5

Building a list of searchable FAQs is both simple and able to support multiple languages.

IMAGE6

Installing Helpshift

  • Download the SDK for Windows 10
  • Install references and add the SDK reference
  • Add localization reference
  • Add theming references

Initializing Helpshift in Your App

Helpshift identifies each unique registered app utilizing a combination of 3 tokens.

  • API Key: Your unique developer API Key
  • Domain Key: Your Helpshift domain name without the “http” prefix or slashes
  • App ID: App’s unique ID

To initialize Helpshift, simply call Helpshift.Windows10.SDK. Helpshift’s install function.

For example:

using hs = Helpshift.Windows10.SDK.Helpshift ;
hs.Install(<apikey>,  <domain>,  <appId>);

IMAGE7

By supporting Windows, Helpshift is able to assist CS teams across the spectrum of both mobile and desktop – allowing users a better experience and CS teams huge savings in time and efficiency. Abinash Tripathy and Baishampayan Ghose started Helpshift in 2012 – not only reinventing the customer service industry, but also collecting user feedback for app enhancements.

The Windows team would love to hear your feedback. Please keep the feedback coming using our Windows Developer UserVoice site. If you have a direct bug, please use the Windows Feedback tool built directly into Windows 10.

Extend your reach with offline licensing in Windows Store for Business

$
0
0

Windows Store for Business was launched in November 2015 to extend opportunities for developers to offer their apps in volume to business and education organizations running Windows 10. Developers can enable organizations to license and distribute their apps with these two licensing and distribution types (also described on MSDN):

  1. Store-managed (online) is your default option, in which the Store service installs your app and issues entitlements for every user in the organization who installs the app.
  1. Organization-managed (offline) is an optional additional choice, in which the organization can download your app binary with proper entitlements, distribute the apps using their own management tools and keep track of the number of licenses used.

The organization-managed (offline) option broadens the distribution flexibility for organizations, and can extend your opportunity to increase usage of your apps and revenue of your paid apps. This option gives organizations more control over distribution of apps within the organization – including preloading apps to Windows 10 devices, distribution to devices never or rarely connected to the internet or distributing via private intranet networks. Typical organizations asking for organization-managed (offline) apps include multinational manufacturers, city departments and the largest school districts with tens of thousands of devices.

Developers have already enabled many apps for organization-managed (offline) licensing and distribution in Store for Business. Examples include many Microsoft apps like Office Mobile, OneDrive, Mail, Calendar and Fresh Paint—plus apps from other developers such as Twitter, TeamViewer, JT2Go from Siemens, Corinth’s Classroom app collection and many others. Thank you, developers!

Enable offline licensing today

Enabling Organization-managed (offline) licensing today can help more organizations acquire your apps and deploy them to their users.

image1

  1. Log in to your Windows Dev Center dashboard.
  2. Open the app you would like to enable for offline licensing and create a new submission.
  3. In Pricing and availability, go to the Organizational licensing.
  4. Make sure the box for Make my app available to organizations with Store-managed (online) volume licensing is checked.
  5. Also check the box for Allow organization-managed (offline) licensing and distribution for organizations.
  6. Make any other desired changes to your submission, then submit the app to the Store.

Frequently asked questions

Does organization-managed (offline) licensing and distribution mean more work for developers? No—all you have to do is select a checkbox during submission in Dev Center, as shown above.

How do app updates work for organization-managed (offline) apps? Apps distributed with offline licensing will work on a user’s device just like any other Store apps, and will be updated by default when the device is connected to the internet with the latest version of your app. Organizations also may choose to manage app updates with management tools if desired.

Are both free and paid organization-managed (offline) apps supported? Yes, organization-managed (offline) licensing and distribution works for both free and paid apps (in developer markets that support paid apps in Windows Store for Business).

How can organizations purchase organization-managed (offline) apps? Organizations wishing to acquire offline paid apps need to pass additional credit validation by Microsoft. All app binaries (both free and paid) distributed for offline licensing are watermarked with the ID of the organization that acquired your app.

Resources

Create a Dev Center account if you don’t have one!

The Windows team would love to hear your feedback.  Please keep the feedback coming using our Windows Developer UserVoice site. If you have a direct bug, please use the Windows Feedback tool built directly into Windows 10.

AdDuplex – your one stop shop for Windows app and game marketing and monetization

$
0
0

From the early days of the Windows Phone 7 Marketplace to the modern days of Windows Store, AdDuplex was and is committed to providing top-notch advertising solutions for app and game developers, publishers and advertisers.

Premier cross-promotion network

Back in 2011, AdDuplex launched the first cross-promotion network for Windows Phone 7 apps and empowered thousands of independent developers to advertise their apps for free by helping fellow app and game creators. Apps that got initial attention in the early days of the ecosystem received an overall boost and enjoyed the early exposure for years to come. AdDuplex helped such apps by utilizing their ad space before they had reached a level of popularity that made monetization efforts worthwhile.

AdDuplex cross-promotion network works as an enabler of advertising exchange between participating apps and games. Developers place a line of code into their apps and start promoting other apps on the network. Those other apps return the favor. The exchange ratio is 10:8, meaning that for every 10 ad impressions your app shows, you are advertised eight times in other apps. The remaining two impressions are used by AdDuplex to help commercial advertisers reach their potential users and support future development of the platform.

Since 2011, more than 10,000 apps joined AdDuplex and use it to accelerate and amend their growth efforts.

User acquisition on Windows

Free cross-promotion is great, but it limits the velocity of your growth to a pretty linear scale. What if you want to grow faster and have a budget for that? AdDuplex provides an opportunity for app and game publishers to reach more users faster via paid advertising campaigns.

Publishers from all over the world use AdDuplex to both jumpstart their new apps and games, and acquire new users for their other apps and games.

Windows 10 era

The day after the initial public Windows 10 launch, AdDuplex was ready with an SDK for UWP apps. It lets developers use the same SDK and even the same ad units across desktop and mobile, and is now ready for your apps on Xbox One.

App developers and advertisers can target various versions of Windows Phone and Windows across all main device families and reach exactly the users they are looking for through either banner or full-screen ads.

Make money with your Windows apps and AdDuplex

The most recent development was a launch of ad monetization part of AdDuplex. While still in invite-only mode, every app and game developer is welcome to apply for and participate in a revenue-sharing scheme in which developers get 70 percent of the money that advertisers pay AdDuplex. And even when there are no paid campaigns to show, your ad space is not wasted – AdDuplex cross-promotion network kicks in and generates free advertising for your app or game.

Getting started with AdDuplex

Whether you are an independent app developer or an advertiser in search of scale, benefitting from AdDuplex services is really easy. Here are the basics you’ll need to get started (plus some nice extras):

The post AdDuplex – your one stop shop for Windows app and game marketing and monetization appeared first on Building Apps for Windows.


Windows 10 is empowering developers to dream again

$
0
0

Yesterday Terry showed you how Windows 10 will usher in a new generation of Windows by powering innovation and more personal computing across the largest range of devices, including Microsoft Surface Hub and the world’s first holographic computing platform; Microsoft HoloLens.

Windows 10 will empower people to do some amazing things with a new version of Cortana for the PC, a new web browsing experience (“Project Spartan”), a true Xbox quality gaming experience on Windows, new holographic and group computing devices, and of course a new set of universal apps – People & Messaging, Photo, Video, Music and Maps – that begin to showcase a few of the new developer platform capabilities.

Windows 10 is also designed to be a service that delivers continuous innovation and new possibilities to the 1.5 billion people already using Windows each month. We’ll start by offering Windows 10 as a FREE upgrade to qualified Windows 7, Windows 8, Windows 8.1 and Windows Phone 8 and 8.1 customers – creating the broadest possible customer base*.

Today we’re going to talk about what it all means for you, our Windows developers.

Last April at Build 2014 we talked about the principles behind the design of our Windows development platform

In Windows 10, we are further simplifying how we talk about these goals as follows:

Driving scale through reach across device type. We are working to make Windows 10 a unified, developer platform for ALL of our devices so you can reach the greatest number of customers with your work across phones, tablets, PCs, Xbox, IoT devices and the new Surface Hub and HoloLens opportunities

Delivering unique experiences. Microsoft’s company-wide emphasis on the people using technology rather than simply the platforms themselves means that we are increasing efforts to provide new technologies that improve the way people interact with computers. With Windows 10, developers will be able to build on top of our investments in Cortana and speech recognition, touch, audio, video and holograms to extend their app experiences in ways they used to only dream about but are now possible on Windows 10.

Maximizing developer investments. We remain committed to helping you get the most out of your investments in training, tools, and code to continue and target our new offerings. We also recognize that many of you are looking for more ways to target a range of platforms with the same basic code or toolset with cross platform technologies.

Driving scale

Everyone wants a broader customer base and we believe Windows 10 will continue to increase customer adoption. Another closely related problem facing software developers today is the proliferation of device types and the amount of work it takes to consistently deliver compelling experiences across them all. Windows 10 addresses these fragmentation challenges.

First, as noted earlier Windows 10 will begin a new relationship with customers in which experiences are updated and delivered regularly – like a service, ensuring the vast majority of customers are using the latest version to take full advantage of your latest experiences.  That process begins with a free upgrade for eligible Windows customers. With this new low friction and rapid cadence, Windows will empower developers to take advantage of new features and capabilities faster than ever before because now their customers are always running the latest Windows.

We’re also doing the work necessary to help make sure that apps and games look great across a full range of devices, display surfaces and input models. The Windows 10 platform will build upon the universal Windows app framework released with Windows 8.1 to provide developers the tools to deliver new app experiences across devices with a minimum amount of additional work.

Delivering unique experiences

Windows 10 introduces several new features that open up new avenues for developer innovation. With Windows 10 and HoloLens developers will have access to a platform that bridges the digital and physical world changing the way people interact with devices and applications.  Many of you already tap into Cortana on phones. Soon, you’ll be able to take advantage of Cortana with new capabilities on a wider variety of Windows 10 devices.

We’ve also begun to share more about a new web experience for Windows 10 dubbed “Project Spartan,” which gives people new and better ways to engage the content they love across devices. Spartan introduces a new rendering engine designed for interoperability with the modern web. You can find out more about what Spartan means for web development from the team that built it on the IEBlog.

Maximizing your investments

Microsoft has a long history of protecting the investments of developers. For every release we dedicate an enormous number of resources to make sure the vast majority of existing applications continue to run as expected.

But protecting investments is about more than just ensuring that existing code continues to run; it’s also about safeguarding the skills you’ve spent years perfecting continue to serve you well in building solutions for the Windows 10 platform. With Windows 10 you’ll continue to build apps with the language of your choice in Visual Studio and enjoy a variety of cloud services through Azure, all of which can be developed and deployed in Visual Studio using the tools, languages and frameworks with which you are familiar.

Maximizing investments also speaks to our promise to support cross platform solutions. We know that developers have made investments in order to more easily target multiple platforms and device types. Accordingly, we’ve taken steps to make it easier than ever for developers working across platforms to also bring their solutions to Windows.

Back at Build last year we announced that we were releasing Win JS for use under an open source license across platform. (http://dev.windows.com/en-us/develop/winjs and http://try.winjs.com). We continue to invest in improving these libraries, with the release of Win JS 3.0 last September, a major update.

We then announced plans to help developers use Visual Studio and C# to deliver solutions to iOS and Android (as well as Windows), leveraging tools like Xamarin (http://xamarin.com) and Unity (http://unity3d.com). We also recently announced support for applications built using Apache Cordova in Visual Studio, with a full Android emulator experience (). Finally, for native C++ developers, we recently announced Visual Studio support for building not only shared libraries for Android, but also complete Native Activity applications for Android.

What’s next?

We’re more committed than ever to making sure that you can leverage your work to reach more customers, regardless of where they are, what device type they’re on, or what operating system they’re running. The best way to start preparing for Windows 10 is to start building universal Windows apps today for Windows 8.1.

Here are some great resources to get started:

Official Documentation

Comprehensive Online Training

  • If you are currently a Windows Phone Silverlight developer, there’s never been a better time to investigate moving your development over to Windows XAML, which provides the ability to deliver universal Windows apps. We recently released a comprehensive set of materials detailing how. Check them out here.

We’ll have much more to share about the Windows 10 developer experience over the coming months. Build 2015 will be full of detailed Windows 10 platform information.  Registration opens today, so hurry to secure a seat by visiting buildwindows.com [Update: Build is currently sold out but we encourage you to join the wait list]. You can read more about Build from Steven Guggenheimer here.

We know many of you will participate in the Windows Insider Program , through which you will be able to acquire the latest builds of Windows 10. Keep in mind that this is prerelease software, and you are likely to encounter a variety of issues at this stage. You will likely not want to use this yet as your primary development Operating system.

We’re also working to include our developer tools and SDKs into the Windows Insider Program in the future, so if you want to be one of the first ones to receive early previews of our tools please sign up today.

*Hardware and software requirements apply. No additional charge. Feature availability may vary by device. Some editions excluded. More details at http://www.windows.com.

The post Windows 10 is empowering developers to dream again appeared first on Building Apps for Windows.

Introducing the UWP Community Toolkit

$
0
0

Recently, we released the Windows Anniversary Update and a new Windows Software Developer Kit (SDK) for Windows 10 containing tools, app templates, platform controls, Windows Runtime APIs, emulators and much more, to help create innovative and compelling Universal Windows apps.

Today, we are introducing the open-source UWP Community Toolkit, a new project that enables the developer community to collaborate and contribute new capabilities on top of the SDK.

We designed the toolkit with these goals in mind:

1. Simplified app development: The toolkit includes new capabilities (helper functions, custom controls and app services) that simplify or demonstrate common developer tasks. Where possible, our goal is to allow app developers to get started with just one line of code.
2. Open-Source: The toolkit (source code, issues and roadmap) will be developed as an open-source project. We welcome contributions from the .NET developer community.
3. Alignment with SDK: The feedback from the community on this project will be reflected in future versions of the Windows SDK for Windows 10.

For example, the toolkit makes it easy to share content from your app with social providers like Twitter, taking care of all the OAuth authentication steps for you behind the scenes.


            // Initialize service
            TwitterService.Instance.Initialize("ConsumerKey", "ConsumerSecret", "CallbackUri");

            // Login to Twitter
            await TwitterService.Instance.LoginAsync();

            // Post a tweet
            await TwitterService.Instance.TweetStatusAsync("Hello UWP!");

Additionally, the toolkit provides extension methods that allow developers to animate UI elements with just one line of code.


await element.Rotate(30f).Fade(0.5).Offset(5f).StartAsync();

Below you will find more details about the features in the first release, how to get started, the roadmap and how to contribute.

UWP Community Toolkit 1.0

The toolkit can be used by any new or existing UWP application written in C# or VB.NET. Our goal is to support the latest and previous stable release of the SDK and at this time, the toolkit is compatible with apps developed with Windows 10 SDK Build 10586 or above.

The toolkit can be used to build UWP apps for any Windows 10 device, including PC, Mobile, XBOX, IoT and HoloLens. You can also use the toolkit with an existing desktop app converted to UWP using the Desktop Bridge.

Here are just some of the features included in the first release of the toolkit.

image1

We are also releasing the UWP Community Toolkit Sample App in the Windows Store that makes it easy to preview the toolkit capabilities even before installing the tools or downloading the SDK. The app will also allow you to easily copy & paste the code you will need to get started using the toolkit in your project.

image2

Getting Started

It’s easy to get started:

1. Download Visual Studio 2015 with Update 3 and the Windows 10 SDK
2. Create a new UWP project (or open an existing one)
3. Launch Visual Studio 2015
4. Create a new project using the Blank App template under Visual C# Windows Universal

Image 3

5. Add the UWP Community Toolkit to your project
6. In Solution Explorer panel, right click on your project name and select “Manage NuGet Packages”

image4

7. Search for “Microsoft.Toolkit.UWP”
8. Select desired packages and install them

image5

9. Add a reference to the toolkit in your XAML pages or C#

          a. In your XAML page, add a reference at the top of your page


<Page  x:Class="MainPage"
       	xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls"
...

          b. In your C# page, add the namespaces to the toolkit


using Microsoft.Toolkit.Uwp;
namespace MyApp
{
...

10. You can copy & paste code snippets for each feature from the Sample App, or find more details in the documentation.

Roadmap

In the future, we plan to release stable updates through the Visual Studio NuGet package at a regular cadence.

The toolkit is completely open-sourced on GitHub, including the source code of the toolkit, source code of the sample app and even the documentation. The roadmap for the next release is available here.

  • If you need to report a bug or share a feature request, please use this form.
  • If you would like to contribute your code, please start from here.

We are excited about the contributions that several community members already submitted in this first release, including Morten Nielsen, Scott Lovegrove, Pedro Lamas, Oren Novotny, James Croft, Diederik Krols, Hermit Dave, Thomas Nigro, Laurent Bugnion, Samuel Blanchard and Rudy Hyun. We are looking forward to continuing to grow the toolkit with even more community contributions.

So please go browse the sample app and learn about the experiences, then grab the NuGet package yourself and play around. We want developers to give us feedback on the usability and helpfulness of the features that exist in the toolkit. There is much to do in an open source project: we can get some help to improve accessibility and localization, and ensure the current capabilities work for all apps.

And while you are at it, JOIN THE FUN!

Giorgio Sardo, Principal Group Program Manager, Windows/PAX

David Catuhe, Principal Program Manager, Windows/PAX

The post Introducing the UWP Community Toolkit appeared first on Building Apps for Windows.

Helpshift releases Windows SDK

$
0
0

In-app customer service provider Helpshift just announced a Windows version of their SDK. Helpshift has reinvented the customer service industry by deflecting customer service requests away from traditional phone and email channels towards in-app self-service channels. Helpshift’s SDK functionality includes searchable FAQs, in-app chat, CRM ticketing and in-app surveys.

Helpshift customers see a boost in app ratings and higher customer satisfaction, app retention and monetization. The Windows 10 release is one of the first versions of the Helpshift SDK that will operate across both mobile and desktop landscapes.

Helpshift’s Key Features Include:

  • Searchable FAQsIMAGE1
    • Powerful FAQ search algorithms gives faster access to FAQs
    • FAQs are cached on devices so they are fully searchable offline
    • Native FAQs work in over 30 languages
  • Intelligent ticket routing
  • Real time data on device, operating system, browser type
  • Ticket analysis and reporting
  • Users connect with support via web, email, and mobile app

IMAGE2

The Helpshift Dashboard

Helpshift has a powerful analytics dashboard for a high level view of ticketing and resolving issues.

IMAGE3

Helpshift’s agent scoring functionality measures numerous KPIs – displayed on an easy-to-read report. The report allows a high level view of agent performance and shows the rate at which tickets are resolved.

IMAGE4

The individual ticket view allows the agent to use valuable user data to resolve a ticket quickly. It is also a valuable tool to determine the overall satisfaction and performance of an app.

IMAGE5

Building a list of searchable FAQs is both simple and able to support multiple languages.

IMAGE6

Installing Helpshift

  • Download the SDK for Windows 10
  • Install references and add the SDK reference
  • Add localization reference
  • Add theming references

Initializing Helpshift in Your App

Helpshift identifies each unique registered app utilizing a combination of 3 tokens.

  • API Key: Your unique developer API Key
  • Domain Key: Your Helpshift domain name without the “http” prefix or slashes
  • App ID: App’s unique ID

To initialize Helpshift, simply call Helpshift.Windows10.SDK. Helpshift’s install function.

For example:

using hs = Helpshift.Windows10.SDK.Helpshift ;
hs.Install(<apikey>,  <domain>,  <appId>);

IMAGE7

By supporting Windows, Helpshift is able to assist CS teams across the spectrum of both mobile and desktop – allowing users a better experience and CS teams huge savings in time and efficiency. Abinash Tripathy and Baishampayan Ghose started Helpshift in 2012 – not only reinventing the customer service industry, but also collecting user feedback for app enhancements.

The Windows team would love to hear your feedback. Please keep the feedback coming using our Windows Developer UserVoice site. If you have a direct bug, please use the Windows Feedback tool built directly into Windows 10.

The post Helpshift releases Windows SDK appeared first on Building Apps for Windows.

Extend your reach with offline licensing in Windows Store for Business

$
0
0

Windows Store for Business was launched in November 2015 to extend opportunities for developers to offer their apps in volume to business and education organizations running Windows 10. Developers can enable organizations to license and distribute their apps with these two licensing and distribution types (also described on MSDN):

  1. Store-managed (online) is your default option, in which the Store service installs your app and issues entitlements for every user in the organization who installs the app.
  1. Organization-managed (offline) is an optional additional choice, in which the organization can download your app binary with proper entitlements, distribute the apps using their own management tools and keep track of the number of licenses used.

The organization-managed (offline) option broadens the distribution flexibility for organizations, and can extend your opportunity to increase usage of your apps and revenue of your paid apps. This option gives organizations more control over distribution of apps within the organization – including preloading apps to Windows 10 devices, distribution to devices never or rarely connected to the internet or distributing via private intranet networks. Typical organizations asking for organization-managed (offline) apps include multinational manufacturers, city departments and the largest school districts with tens of thousands of devices.

Developers have already enabled many apps for organization-managed (offline) licensing and distribution in Store for Business. Examples include many Microsoft apps like Office Mobile, OneDrive, Mail, Calendar and Fresh Paint—plus apps from other developers such as Twitter, TeamViewer, JT2Go from Siemens, Corinth’s Classroom app collection and many others. Thank you, developers!

Enable offline licensing today

Enabling Organization-managed (offline) licensing today can help more organizations acquire your apps and deploy them to their users.

image1

  1. Log in to your Windows Dev Center dashboard.
  2. Open the app you would like to enable for offline licensing and create a new submission.
  3. In Pricing and availability, go to the Organizational licensing.
  4. Make sure the box for Make my app available to organizations with Store-managed (online) volume licensing is checked.
  5. Also check the box for Allow organization-managed (offline) licensing and distribution for organizations.
  6. Make any other desired changes to your submission, then submit the app to the Store.

Frequently asked questions

Does organization-managed (offline) licensing and distribution mean more work for developers? No—all you have to do is select a checkbox during submission in Dev Center, as shown above.

How do app updates work for organization-managed (offline) apps? Apps distributed with offline licensing will work on a user’s device just like any other Store apps, and will be updated by default when the device is connected to the internet with the latest version of your app. Organizations also may choose to manage app updates with management tools if desired.

Are both free and paid organization-managed (offline) apps supported? Yes, organization-managed (offline) licensing and distribution works for both free and paid apps (in developer markets that support paid apps in Windows Store for Business).

How can organizations purchase organization-managed (offline) apps? Organizations wishing to acquire offline paid apps need to pass additional credit validation by Microsoft. All app binaries (both free and paid) distributed for offline licensing are watermarked with the ID of the organization that acquired your app.

Resources

Create a Dev Center account if you don’t have one!

The Windows team would love to hear your feedback.  Please keep the feedback coming using our Windows Developer UserVoice site. If you have a direct bug, please use the Windows Feedback tool built directly into Windows 10.

The post Extend your reach with offline licensing in Windows Store for Business appeared first on Building Apps for Windows.

AdDuplex – your one stop shop for Windows app and game marketing and monetization

$
0
0

From the early days of the Windows Phone 7 Marketplace to the modern days of Windows Store, AdDuplex was and is committed to providing top-notch advertising solutions for app and game developers, publishers and advertisers.

Premier cross-promotion network

Back in 2011, AdDuplex launched the first cross-promotion network for Windows Phone 7 apps and empowered thousands of independent developers to advertise their apps for free by helping fellow app and game creators. Apps that got initial attention in the early days of the ecosystem received an overall boost and enjoyed the early exposure for years to come. AdDuplex helped such apps by utilizing their ad space before they had reached a level of popularity that made monetization efforts worthwhile.

AdDuplex cross-promotion network works as an enabler of advertising exchange between participating apps and games. Developers place a line of code into their apps and start promoting other apps on the network. Those other apps return the favor. The exchange ratio is 10:8, meaning that for every 10 ad impressions your app shows, you are advertised eight times in other apps. The remaining two impressions are used by AdDuplex to help commercial advertisers reach their potential users and support future development of the platform.

Since 2011, more than 10,000 apps joined AdDuplex and use it to accelerate and amend their growth efforts.

User acquisition on Windows

Free cross-promotion is great, but it limits the velocity of your growth to a pretty linear scale. What if you want to grow faster and have a budget for that? AdDuplex provides an opportunity for app and game publishers to reach more users faster via paid advertising campaigns.

Publishers from all over the world use AdDuplex to both jumpstart their new apps and games, and acquire new users for their other apps and games.

Windows 10 era

The day after the initial public Windows 10 launch, AdDuplex was ready with an SDK for UWP apps. It lets developers use the same SDK and even the same ad units across desktop and mobile, and is now ready for your apps on Xbox One.

App developers and advertisers can target various versions of Windows Phone and Windows across all main device families and reach exactly the users they are looking for through either banner or full-screen ads.

Make money with your Windows apps and AdDuplex

The most recent development was a launch of ad monetization part of AdDuplex. While still in invite-only mode, every app and game developer is welcome to apply for and participate in a revenue-sharing scheme in which developers get 70 percent of the money that advertisers pay AdDuplex. And even when there are no paid campaigns to show, your ad space is not wasted – AdDuplex cross-promotion network kicks in and generates free advertising for your app or game.

Getting started with AdDuplex

Whether you are an independent app developer or an advertiser in search of scale, benefitting from AdDuplex services is really easy. Here are the basics you’ll need to get started (plus some nice extras):

The post AdDuplex – your one stop shop for Windows app and game marketing and monetization appeared first on Building Apps for Windows.

Viewing all 65 articles
Browse latest View live