Software Archive
Read-only legacy content
17061 Discussions

Windows Phone and Windows App Crashes

PaulF_IntelCorp
Employee
296 Views

There is a significant change in the Windows Phone 8.1 webview and apps, compared to the "legacy" Windows Phone 8.0 webview and apps that is the cause of many Windows app crash problems.

  • A "legacy" windows phone app is easily recognized as a XAP file.
  • A "universal" or "modern" Windows app for Windows Phone has an APPX extension.
  • At this time, the XDK Windows Phone 8.1 build tile will build an APPX file using the Cordova "windows" target.
  • Legacy XAP apps are built using the Cordova "wp8" target, which is considered obsolete by the Microsoft Cordova project team, and is not currently supported by the XDK build system.

Microsoft has provided a JavaScript library to help with this issue, although it will not fix ALL problems, it does help with some apps. In addition, many apps include calls to window.alert(), which is not supported in the Windows webviews (which, it turns out, is not a lack of compliance with standard HTML5, because window.alert() is an optional feature). To address these two issues I have combined the Microsoft code with a replacement for window.alert() into a single library that you should include as the first, or one of the first, libraries in your index.html file. There is no harm including this JS lib when building for other platforms, the code in it will only execute on a Windows platform.

Also, see these forum posts for additional details:

And see these articles for more detailed background regarding the changes to the Windows and Windows Cordova platforms:

In essence, the old WP8 platform (XAP package) is a legacy Silverlight based platform. Windows platforms now use the new Windows Store JavaScript app platform – while webview-like, Windows considers this a "Native JavaScript App" since it also gains access to all base WinRT APIs. Cordova apps actually do not have a native wrapper since Windows itself provides this directly. Unfortunately, the Windows 8.0/8.1 platform forces a number of restrictions that can be frustrating for Cordova apps. These mostly have to do with restricting updates to the DOM and the execution of inline JavaScript. Windows 10 and Windows Phone 10 resolves this by introducing an alternate webview model that is designed for Cordova apps.

0 Kudos
0 Replies
Reply