This document discusses Universal Windows Platform (UWP) apps and how they can be developed to run across Windows and Windows Phone platforms. It covers topics such as conditional compilation, shared code and resources, platform-specific APIs, and achieving convergence in the Windows 8.1 and Windows Phone 8.1 versions. UWP apps allow separating user interface from program logic and accessing common WinRT APIs from different languages like C++ and JavaScript.
4. Windows Runtime (WinRT) je dijeljeni
runtime i API koje koriste Windows store
aplikacije na Windows platformi
4
Common
WinRT APIs
Phone-specific
WinRT APIs
Windows-specific
WinRT APIs
Konvergencija u verziji 8.1
• Cilj je 100%-na konvergencija u razvoju
• U verziji 8.0, konvergencija je bila u oko 30% API-ja
• U verziji 8.1, konvergencija je u preko 90% API-ja
5. HTML
Win32
JavaScript Code
WinRT
C++ Code C#/VB Code
HTML XAML XAML
Windows Runtime XAML
WinJS
.NET for Windows
Store
C#/VB Code
Silverlight XAML
Silverlight .NET
Windows Phone
Silverlight XAML
6.
7.
8.
9. Windows Phone 8.1 App Windows 8.1 App
XAML View
Phone UI
XAML View
Windows UI
Shared Code, Images, Files
WinRT
10.
11. Windows Phone 8.1 App Windows 8.1 App
XAML View
XAML UI
XAML View
XAML UI
Logic Logic
Data Data
?
Logic
Data
16. Odvajanje UI od programske logike
+ platform specific API sets (geolocation, media, sensors)
+ neke XAML komponente ako je moguće
17.
18.
19. Windows 8.1 Windows Phone 8.1
neki API-ji de drugačije ponašaju na Windowsima ili Windows Phone-u
Windows Only
WinRT
e.g. search contract
e.g. multiple windows
e.g. resizable windows
e.g. printing support
Phone Only
WinRT
e.g. action center
e.g. status bar
e.g. back key handling
21. //Create the picker object
FileOpenPicker openPicker = new FileOpenPicker();
openPicker.ViewMode = PickerViewMode.Thumbnail;
openPicker.SuggestedStartLocation =
PickerLocationId.PicturesLibrary;
// Users expect to have a filtered view of their folders
openPicker.FileTypeFilter.Add(".jpg");
openPicker.FileTypeFilter.Add(".png");
// Open the picker for the user to pick a file
StorageFile file =
await openPicker.PickSingleFileAsync();
if (file != null)
{
// Do something with the file...
}
//Create the picker object
FileOpenPicker openPicker = new FileOpenPicker();
// On Windows Phone, setting Filtering to image types
// causes Picker to show Camera Roll
openPicker.FileTypeFilter.Add(".jpg");
openPicker.FileTypeFilter.Add(".png");
// Open the picker for the user to pick a file
openPicker.PickSingleFileAndContinue();
32. #if WINDOWS_APP
var result = VisualStateManager.GoToState(this, "Windows", false);
#elif WINDOWS_PHONE_APP
var result = VisualStateManager.GoToState(this, "WindowsPhone", false);
#endif