So, you got a WP8.0 app and looking on WP8.1. This post is about to show how to port existing app to WP8.1 and which options are available.
First of all let’s discuss the options:
1. Keep using Silverlight/Keep WP8.0 app
Pros: No porting work required. Will run on WP8.1 (app compatibility), still runs on earlier Windows Phone devices
Cons: Will not take advantage of new platform capabilities, cannot enable targeting of Windows
2. Use SL for WP8.1:
Pros: Some work required – take care of breaking changes. Enables existing Silverlight app to take advantage of nearly all new APIs and new platform capabilities
Cons: Will not enable targeting of Windows AND will not run on Windows Phone 8 devices
3. Use WinRT XAML platform:
Pros: Enables targeting of Windows and Windows Phone while takes full advantage of new APIs and platform capabilities. App enjoys better performance & reduced memory use
Cons: Most porting work required – can be considered as app re-developed almost from scratch AND will not run on Windows Phone 8 devices
Keeping existing WP8.0
Existing WP8.0 apps will keep working without any change on WP8.1. Existing WP8.0 app that doesn’t need to add any new WP8.1 features do not need to upgrade. Such an app will run on WP8.0 and up.
Porting WP8.0 app to WP8.1 Silverlight app
Probably the easies way to leverage new features. Visual Studio provides upgrade command in project menu:
The wizard adds logos/splash screen images and modern application manifest which should be used for app settings related to “modern” features. With this, the project still has WMAppManifest. After such upgrade (and fixing breaking changes) the app will run in modern Silverlight app host which means that there will be platform behavior changes and the app must be adjusted.
Such an app will have an access to many WP8.1 APIs (for example background tasks, data roaming, share contract, geolocation and geofencing, etc.) while still working as “good old” Silverlight app and using Silverlight’s version of XAML. It will also have access to the APIs not available to WinRT apps (such as background agents, lock screen background provider, lens, alarms and reminders, etc.).
Such an app will run only on WP8.1 and up.
Porting WP8.0 app to WP8.1 WinRT app
This approach requires considerably more efforts than simply running wizard. It requires to re-create the UI, change the APIs used to create the business logic and in some cases even change the app flow/features set as not all features accessible from WinRT apps. The benefit of such approach is that the app have high level of code convergence and slightly lover level of XAML convergence and (with some UI changes) will be able to target both WP8.1 and Win8.1 platforms.
The main differences (and thus work required to port the app) will be in the following areas:
* Application manifest/Tile changes: migrate WMAppManifest data into modern application manifest, create differently sized assets for the tiles and splash screen, update code related to the Tiles and Toasts in the app to use modern Tile/Toast templates.
* UI updates to fit form factor devices: recreate XAML using modern controls and take an advantage of new and updated controls. XAML for simple controls (such as Buttons, TextBlock, ListBox) will be exactly the same and this similarity could be up to 80% of existing XAML UI. New controls (such as DatePicker, TimePicker, ProgressRing, Hub, etc.) will require additional efforts in terms of how and when to use them in ported app. Some outdated controls (such as Panorama, LongListSelector) must be replaced with modern alternatives (Hub, ListView, GridView, etc.) and might require not only XAML changes but also code behind changes.
* Future updates/changes to better serve user on specific platform: some futures from Silverlight platform didn’t made into WinRT and have no alternatives, some didn’t made into WinRT but have alternatives. Such features (for example Silvelright’s ShareLinkTask, ShareStatusTask, PhotoChooserTask) must be replaced with WinRT alternatives (Share Contract, File Pickers) and for sure will require to develop different code than in Silverlight app.
To benefit most from this work, it is recommended to use Universal app template that enables to create the app for WP8.1 and Win8.1 platforms and reuse most of the code.
Note: Universal app project creates two independent AppX packages for submission to the Windows Phone Store and Windows Store.
The app created as WP8.1 WinRT app will run only on WP8.1 and up. If developed as Universal app, it could also compile and run on Windows 8.1 devices.
That’s it for now