- Overview
- Create your first app
- Templates for apps
- Platform support
- Android
- Blackberry 10
- iOS
- OS X
- Ubuntu
- Windows
- WP8
- Manage versions and platforms
- Customize icons
- Store data
- Manage privacy
- Manage security
- Whitelisting
- Create a plugin
- Android
- Blackberry 10
- iOS
- Windows
- WP8
- Use Plugman
- Embed Cordova in native apps
- Next Steps
- Config.xml
- Events
- CLI Reference
- Hooks
- Plugin.xml
- Battery Status
- Camera
- Console
- Contacts
- Device
- Device Motion
- Device Orientation
- Dialogs
- File
- File Transfer
- Geolocation
- Globalization
- Inappbrowser
- Media
- Media Capture
- Network Information
- Splashscreen
- Vibration
- Statusbar
- Whitelist
- Legacy Whitelist
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).
-
Navigate to the package's
wp8/framework
directory and buildWPCordovaClassLib.sln
. It creates theBin\Debug[Release]\WPCordovaClassLib.dll
. -
Copy the
WPCordovaClassLib.dll
file into the Windows Phone 8 project's/libs
directory and includeWPCordovaClassLib.dll
to your project viaProject->References->Add Reference
. Alternatively, you can directly reference thewp8/framework/WPCordovaClassLib.csproj
file. -
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" />
-
Copy
common/www/cordova.js
along with the application's HTML and JavaScript files to the Windows Phone 8 project'shtml
directory and include new files to the project. -
Copy the
wp8/template/config.xml
to 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.