Leave a comment

A deeper dive into the Universal Windows Platform

Windows Universal Platform

The Universal Windows Platform is just an evolution of the same modern platform you’ve been using on phones since Windows Phone 8.1 and PCs since Windows 8. This means your code and your apps just WORK. You can continue to write apps for the Windows platform in your language and using the framework of your choice, whether that’s C/C++, C#, Visual Basic, JavaScript, XAML or Silverlight. With the addition of bridges, you now have a starting point on your journey to build a  Windows app that can be submitted to the Windows Store. You can reuse significant portions of your existing code with minimal effort and then focus your time enhancing your app experience with the unique features of Windows 10.

Take a moment here to see a few Universal Windows Platform highlights:

Design
The UX of the Universal Windows Platform is designed to work great across the Microsoft device family. There’s now one design language and one control set across devices. That means predictable, consistent building blocks for you to create your experience, however you choose to adapt and tailor it per device. To learn more about our design principles and how we are applying them to our “in-box apps,” check out our Windows Head of Design, Albert Shum’s blog post on the topic.

We recognize that developers using the native controls and layouts will build complex views and many times those views need to adapt based on device family.  Similar to what developers are accustomed to on the web today, we’ve found that responsive design techniques are a great way to adapt an app to a diverse device family.  Since we expect many developers to use responsive techniques, we’ve added a set of features to the platform to make it easier for developers to build a responsive view (e.g. visual triggers, relative panel).

The one design language and control set make it easier to adapt your app experience for common scenarios. Things every app designer needs to handle – like window size and input type – are often handled by the platform for you. For example, menus appear with mouse-optimized or touch-optimized presentation depending on how they are invoked by the user… but you can write the code just once. Controls work across all screen sizes with mouse, touch, keyboard, pen, and now even a game controller… right out of the box.

In cases where the designer wants even more control over how the UX adapts, we have added two new features – RelativePanel and Adaptive Triggers. Together, these can be used to create simple rules that automatically trigger visual state changes in response to an app event such as a window size change… all in markup.

Adaptive Triggers can also be extended to create Custom Triggers for more complex scenarios. For example, developers can create a control size trigger that could be used to trigger UI changes for the control based on its height and/or width.

Beyond just size, you can tailor based on input, orientation, availability of sensors, app services, or pretty much any other change you can detect. You can even create a totally custom XAML view for each device, all sharing common code.

Develop
Windows 10 makes it easier to develop apps for the Universal Windows Platform with just one API and one package to reach all Windows 10 devices – PC, tablet, phone and more.

We added over 2,500 new classes to the Universal Windows Platform API set for a total of over 8,600 new APIs, a 60% increase from Windows 8.1. With Windows 10 we also increased the .NET API set by 26% and the Win32 and COMs API set by 48%. There are tons of NEW things that the Universal Windows Platform supports, with new capabilities including DirectX12, Holographic, Active Pen and Windows Hello.

Universal Windows App Model
When writing an app for Windows it is easy to concentrate on which APIs you can call or how the app UI should adapt. These are all vital to writing an app but it is important to think about what defines what an app can or cannot do. Historically there has never been a concrete definition of what an app is on Windows. It started with an .exe but you have to consider things like:

  • How do you install it?
  • How do you store state?
  • How long does the app run for?
  • What’s the versioning story?
  • How do you integrate with the OS?
  • How do you integrate with other apps?
  • What can your app do?

The Universal Windows App Model provides a system that answers these question and does so in a way that scales from the smallest IoT device to the highest-end PC.

The Universal Windows App Model begins (and ends) with the deployment system, AppX, which provides a trustworthy installation mechanism that is designed to ensure apps can be deployed and updated seamlessly. In Windows 10 we have enabled AppX to support all of the Windows Platform devices and also extended it to support the increased demands of today’s app ecosystem. Apps on devices such as Xbox and PC are increasingly delivering significant amounts of content and code resulting in very large app downloads. AppX for Windows 10 now supports packages in excess of 150Gb. On the other end of the spectrum, AppX also supports installation onto removable storage (such as SD cards) to enable devices with limited built-in storage to install more apps.

The Universal Windows App Model is designed to provide a scalable execution environment to enable your app to do amazing things across a family of devices. The app model scales to take into account memory size and battery life by providing a resource management system that will allow your app to use the appropriate amount of memory & CPU based on the system that you are running on.

While apps started out in silos, increasingly users want more integrated experiences. We listened and designed a system that allows your apps to integrate not only with the operating system but also with other apps. We looked at what made the web great: URL-based activation. We built on this concept to enable apps to integrate using custom schemes, introducing the ability to get a return result from the app you just called. This enables apps running in the foreground to launch apps that will also run in the foreground. But what about seamless background integration? As I demoed today, we are also introducing app services which allow you to publish a task which other apps can call in the background, so that the calling app can remain in focus.

Universal Windows Platform Bridge for Classic Windows Applications
Windows has a huge ecosystem of Win32, WPF and .NET apps spanning from productivity to the most amazing games. Today we talked about a bridge which will allow an existing Classic Windows application to be converted to a Universal Windows app and made available in the Windows Store, Project Centennial. These apps will not only have the same install and update user experience that the Store provides today, they will also be able to call the vast majority of the Universal Windows Platform APIs and new platform capabilities like Action Center, Actionable Notifications, and enhanced Live Tiles.

Universal Windows Platform

We also want to make sure that customers feel confident installing these apps from the Store and that they will not cause their device to slow down or introduce malware or other issues. If customers don’t like the app, then they can simply uninstall it and Windows ensures that the app is completely cleaned up. We achieve this by isolating registry and app data access for the app. So when your app thinks it is writing to the registry, it’s actually being stored in a per app hive, which can be easily removed.   This is all done without you having to make major changes to your code. Just convert your existing installer into AppX using our tools, available later this year.

Universal Windows Platform Bridge for Web Apps
Finally, I’d like to go into a little depth about hosted web apps, a Universal Windows Platform scenario allowing developers to leverage the power of existing web workflows and continuous deployment in order publish a responsive web app to the Windows Store. Developers may start with a preexisting web site URL, place it in a manifest and create an app targeting the Universal Windows Platform.

Universal Windows Platform

Full access to the platform is possible including calling APIs directly from scripts hosted on a server, leveraging Cortana integration and authentication. Hybrid apps are also supported as developers can include local code to be called from the hosted script in the app package and manage app navigation from remote to local pages. For support of Universal Windows Platform API access from a hosted application, the AppX manifest is required where there are two things that need to be set: the application’s desired start page URL and a set of desired URLs that are part of the app.

Web developers are able to directly call platform APIs through JavaScript hosted on their server when their hosted content is running as an application on Windows. To enable this an attribute (WindowsRuntimeAccess=””) needs to be specified in the ACURs.

Original story appreared on Windows Blog.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: