Tags:
With the good news from Microsoft Build2015, the days of Win10 's official release are getting closer, and we are finally delighted to see that a unified Windows platform is attractive to developers, and it's a big game to say ... So let its natural, and began a new round of follow Microsoft's footsteps. 1. What
Universal Windows Platform (UWP) is what it is. First of all, say what is called device Family.
Microsoft's product layout is mainly in the following areas: traditional PC and rookie Tablet PC 2-1 (Sufiva), mobile phone (Trojan Horse captured Nokia now reborn into Microsoft) and tablet equipment, Xbox, IoT IoT equipment (to be honest, it still gives me a mental vibration), Holographic (The glasses are really out of the sky ...) Equipment and so on, each type of equipment can be called a device Family. Then Microsoft's so-called "one development, full platform release," How to achieve it. First, these devices use the same operating system as Windows 10, which is the basis on which applications can be common, and secondly, for different device Family, there must be different APIs, and correspondingly, there will be the same API, in fact, through the efforts of Microsoft developers, This part of the same API is still very large. Well, let's say that I've only used this part of the API to develop an app that publishes this app to the App Store (thanks to Microsoft's App store being a unified one now), so that different devices can be downloaded and run without problems (because of the shared API and the same operating system). Task completed.
The so-called UWP, in fact, is on the Windows core, for each device family provides a unified API interface, it is WINRT repackaged superset, so win8.1/windows Phone 8.1 of the app can easily migrate to Win10, For developers, the cost of RE learning is also low. 2. Why
Do you have to say that? Just think about it . 3. how (1) system Requirements
To develop UWP applications that require WINDOW10 operating systems, developers who participate in the Windows Insider program can upgrade their development computers to the WIN10 preview version, which has a lot of holes in the road ... I've got a problem. Surf the internet and search for a sign that people stood before.
Download the Visual Studio 2015 RC version, which is free of charge, but should be done properly for day-to-day development tasks, and can also be developed for Android and iOS applications ...
Download Visual Studio Tools for Windows to get the Win10 API.
Download the emulator and get the WIN10 simulator. If you do not want to use the simulator, you can use Windows Phone 8.1 registration tools to unlock the mobile phone has been upgraded to WIN10, this method is relatively simple.
OK, we can start.
(2) How to adapt to the characteristics of a particular platform
private void Button_Click (object sender, Windows.UI.Xaml.RoutedEventArgs e)
{
//In here Analog phone back button registration event
//To use Device specific APIs (Extension APIs) require the following steps
//1. Add a reference to the corresponding platform in the reference, such as "Microsoft Mobile Extension SDK for Universal App Pl Atform "
//2. Detect if the namespace exists
var ns =" Windows.Phone.UI.Input.HardwareButtons ";
if (Windows.Foundation.Metadata.ApiInformation.IsTypePresent (ns))
{
//3. Write required specific device platform code
Windows.Phone.UI.Input.HardwareButtons.BackPressed + = hardwarebuttons_backpressed
;
}
private void Hardwarebuttons_backpressed (object sender, Windows.Phone.UI.Input.BackPressedEventArgs e)
{
Tb_reacttobtn.text = "reacted to Button press!!";
}
4. Summary
UWP Development Introductory Series notes (i): UWP first glance