Show TOC

Creating a Windows Phone 8.1 ApplicationLocate this document in the navigation structure

Create a Windows Phone 8.1 Cordova application by adding the platform to the project, moving shared code to the shared project, and rebuilding the solution.

Prerequisites

Set up your development environment, and create an Apache Cordova project for Windows 8.1. See:
  • Setting up the Development Environment
  • Creating an Apache Cordova Project

Procedure

Add the Windows Phone 8.1 platform.

  1. Open your project in Visual Studio 2013.
  2. Perform step 3 in Creating a Windows 8.1 Application to retarget the application.
  3. Select the project, right click and select Add Windows Phone 8.1.
  4. Click OK in the dialog.
    You can view three projects in your solution:
    • a Windows 8.1 project
    • a Windows Phone 8.1 project
    • a Shared project (to share common resources between the above projects)
  5. If you added the Offline OData plugin to your project, make the following changes to add the native Windows references.
    1. Select the References node, right click and select Add Reference.
    2. Click Browse, and locate the OfflineOData plugin location on your disk ({OfflineODataPluginDirectory}/windows81/bin/wp).
    3. Select the *.winmd and *.dll file for the appropriate CPU architecture of your project (x86 or x64 or ARM). This file is located in {OfflineODataPluginDirectory}/windows81/bin/wp/[x86 or x64 or ARM].
    4. Select Windows 8.1, Extensions and select Microsoft Visual C++ 2013 Runtime Package for Windows (Version 12.0 or higher).
    5. Click OK to add the references.
  6. If you added the Push plugin to your project, make the following changes to the package manifest to support push notifications.
    1. Open the package.windows.appxmanifest, and change:
      <LockScreen BadgeLogo="images\logo-lockscreen.png" Notification="badge" />

      to:

      <m2:LockScreen BadgeLogo="images\logo-lockscreen.png" Notification="badge" />
    2. Add this code to the place before "</m2:VisualElements>".

      Old code in line 19 & 20 in the file:

      <m2:SplashScreen Image="images\splashscreen.png" /> 
      </m2:VisualElements>

      Code after modifying (line 19-21):

      <m2:SplashScreen Image="images\splashscreen.png" /> 
      <m2:LockScreen BadgeLogo="images\logo-lockscreen.png" Notification="badge" /> 
      </m2:VisualElements>"

    1. Delete or comment out code as required.

Move shared code to the shared project.

  1. Move the entire www folder to the shared project.
  2. Rebuild the solution by clicking Build > Build Solution.
    You can now develop your Windows Phone 8.1 application using the plugin.