Can an application written using the WinRT API work on Windows 8 x86, Windows 8 for ARM and WP8?

AFAIK, only Metro style apps can run on Windows 8 ARM, and Metro style apps can only be written using the WinRT API.

According to this topic Can we access the Windows 8 WinRT API from the desktop application and Windows Phone 8? If so, are they in different namespaces?

Windows Phone 8 also uses the ARM architecture. So, if our application is written using the WinRT API, it can work on both Windows 8 x86 and Windows 8 for ARM and WP8, right?

+4
source share
2 answers

Not really. The situation with WinRT and Windows Phone Runtime is similar to WPF / Silverlight. There is overlap, but not 100% coverage. To solve this problem, Microsoft recommends using Portable Class Libraries to work with several platforms (since each platform has its own runtime). Additional PCL information: http://msdn.microsoft.com/en-us/library/gg597391.aspx

In addition, even if you manage to use most of the classes that work in the portable class library, you still have to write separate user interfaces for each platform (PCL does not support a common interface). Although this may seem frustrating, it is actually more necessary than you think. Here's a link on what Microsoft offers in terms of XAML user interface sharing.

This should not be considered a complete checkpoint for sharing Windows Phone 8 and Windows 8. A clear guide is to design and create your own user interface separately for each platform, embracing the recommendation design for each. It is technically possible to get around these obstacles. You can create your user interface during page initialization from code. You can load the XAML platform on the platform from resources at run time and enter it as a string into the page. However, none of these scaling methods, and they make building your core asset โ€” how your application addresses your user โ€” is a tedious and error-prone task. Your co-investing code will give you a much higher return down your application stack by trying to share application logic, data models, view modes, etc.

Basically, Microsoft says that the design of your user interfaces is specifically designed for the platform, because the application running on the phone (smaller screen) should have a different user interface than the one running on the tablet / desktop (large screens).


As for WinRT applications on different platforms ... Yes, you can. Microsoft said that applications written in WinRT can run on Windows 8 and WOA (Windows on ARM). Here's a link from Microsoft talking about it. But the first part of my answer is still worth it ... if you want to target at different time intervals (WinRT / Windows Phone Runtime) ... then use Portable Class Libraries. Choosing "Windows Store" and "Windows Phone 8" will allow your code to work in Windows 8 x86 / x64 / ARM and Windows Phone 8.

+5
source

Windows Phone implements a subset of the Windows 8 WinRT API called WinPRT (P == Phone). You can find a good overview here with an exact list of supported Win (P) RT APIs.

Caution - XAML on Win8 is similar, but different, to XAML on WP8, so expect that you will have to rewrite a lot of your interface for WP. What you really want to do is read this getting started guide in which you will find many considerations and methods related to application development between these platforms.

+1
source

Source: https://habr.com/ru/post/1487198/


All Articles