Windows Phone 8.0 WebViews

This guide shows how to embed a Cordova-enabled WebView component within a larger Windows Phone 8.0 application.

To follow these instructions, make sure you have the latest Cordova distribution. Download it from cordova.apache.org and unzip its Windows Phone 8.0 package (cordova-wp8-*.zip).

  1. Navigate to the package's wp8/framework directory and build WPCordovaClassLib.sln. It creates the Bin\Debug[Release]\WPCordovaClassLib.dll.

  2. Copy the WPCordovaClassLib.dll file into the Windows Phone 8 project's /libs directory and include WPCordovaClassLib.dll to your project via Project->References->Add Reference. Alternatively, you can directly reference the wp8/framework/WPCordovaClassLib.csproj file.

  3. Add CordovaView component to your page (for example, MainPage.xaml).

     xmlns:my="clr-namespace:WPCordovaClassLib;assembly=WPCordovaClassLib">
     ...
     <my:CordovaView HorizontalAlignment="Stretch" Margin="0,0,0,0" 
     StartPageUri="html/index.html" x:Name="CordovaView" VerticalAlignment="Stretch" />
    
  4. Copy common/www/cordova.js along with the application's HTML and JavaScript files to the Windows Phone 8 project's html directory and include new files to the project.

  5. Copy the wp8/template/config.xmlto the project's root directory and

Instructions above will link core Cordova components only, see Using Plugman to Manage Plugins in order to link Cordova plugins.