basquang™ on clouds

September 9, 2015

Best Practices: Upgrade to Windows 10 UWP Universal apps

Filed under: Microsoft Technology,UWP — basquang @ 11:29 AM
Tags: ,
Scenario:
– You have Windows Phone 8.x and Windows 8.x apps and want to upgrade the app to UWP Universal for Windows 10 to take advantage of new API platform?
– You just only want to update the Windows app to UWP but leave the phone app version in 8.x for some reason ex: AdMob SDK has not yet supported for Windows Phone 8.1 or later. Here are some best practices for you:
1. To target your UWP app only for Windows 10 devices without phone version
Open the Package.appxmanifest file then edit the Dependencies as below
<Dependencies>
    <!--<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />-->
    <TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.10240.0" MaxVersionTested="10.0.10240.0" />
  </Dependencies>
For this setting, you cannot deploy your app to Emulator or phone devices. And then when you upload the package to store, you will see the instruction below “Device families: Windows.Destop minverion 10.0.10240.0”
11638797_10204463343656324_1794777682_o
For more detail please visit msdn link here
https://msdn.microsoft.com/en-us/library/windows/apps/dn986903.aspx
2. Your UWP app using some extra features as access user appointments, contacts…but you do not see that capabilities in Package.appxmanifest to declare.
The solution is open Package.appxmanifest file then edit the node Capabilities as below:
<Capabilities>
    <Capability Name="internetClient" />
    <uap:Capability Name="appointments" />
  </Capabilities>
For more detail please visit msdn link here
https://msdn.microsoft.com/en-us/library/windows/apps/mt270968.aspx
https://msdn.microsoft.com/en-us/library/windows/apps/dn934741.aspx
3. You want to create settings page for your UWP looks like Microsoft Mail Universal app, which display the page flyout on the right. With Windows 8.x this will be completed by using SettingFlyout template, but the template is not supported for Windows 10 UWP.
Solution is create a new page or usercontrol then change the page/usercontrol class to inherit to Windows.UI.Xaml.Controls.SettingsFlyout. In UWP app the SettingsFlyout control is not visible in template selection but it still there in code.
public sealed partial class SettingsFlyoutControl : SettingsFlyout
<SettingsFlyout
    x:Class="LichViet.UserControls.SettingsFlyoutControl"...>
....
</SettingsFlyout>

Hope this help!

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

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

Blog at WordPress.com.

%d bloggers like this: