Reputation: 917
On iOS and Android, it is relatively straightforward to set Cordova up to run as a WebView within a larger, existing native app.
Is this possible for Windows Phone 8 and does anyone have any guidance on how to go about it?
The Cordova documentation is lacking in this area and I'm struggling to find any examples of how to go about this.
Setting up the Cordova project within Visual Studio and trying to Navigate to the .xaml file doesn't seem to work, as has been suggested in other posts I've found.
Upvotes: 1
Views: 511
Reputation: 59763
I'd suggest you clone the github repo (or just grab the source as a zip), and use the batch file to create the templates:
createTemplates.bat
That will create a template that when copied into your Visual Studio Project Templates folder (for example: \Documents\Visual Studio 2013\Templates\ProjectTemplates
) may used as a template project.
Create a template project using the Cordova template. It has all of the source code necessary to successfully host a Cordova web page/app. The core being a user control called CordovaView
that you can use in any Phone Page
. You'll need the files from the cordovalib
sub-directory to enable proper integration with your host application (just copy the folder into your project and include the files).
<my:CordovaView HorizontalAlignment="Stretch"
Margin="0,0,0,0"
x:Name="CordovaView"
VerticalAlignment="Stretch" />
Upvotes: 2