Getting Started with Phone Gap v2.9 for Windows Phone 8.
Prerequisites
If you are totally new to programming and mobile application development, I highly recommend starting with my Beginning Programming Tutorial.
This article assumes the reader:
- Has prior knowledge of the Windows Phone Software Development Kit (SDK).
- Is familiar with the Visual Studio IDE.
Introduction - Build Cross Platform Apps
One of the issues with building native apps for Windows Phone using Silverlight/XNA is that you're are locked into a specific platform (See "Native App vs. Web App" video for more info below). Porting you're apps directly to Android, iPhone and other devices is not possible.
There is a solution however! If you're looking to broaden your market, PhoneGap is a fantastic solution! What a game changer! Now, you can write one codebase, using standard HTML5/CSS/JavaScript and deploy your application to many devices! What's wonderful is you'll be able to utilize JavaScript libraries such as JQuery Mobile, Knockout.js and many more. The same technologies you use to build web pages can now be used to build mobile apps! Great stuff!
Native App vs. Web App
Background Info on PhoneGap
Install Visual Studio Express 2012/2013 for Windows Phone
In order to get up and running with the Windows Phone developer tools, you will need to download the SDK. For complete instructions, visit:
http://docs.phonegap.com/en/2.2.0/guide_getting-started_windows-phone_index.md.html
Note: PhoneGap will work with Visual Studio 2012/2013 Professional or Express Editions (free edition).
Installing PhoneGap
- The first step is to go to the PhoneGap installation web page at: http://phonegap.com/install/
- Follow the instructions for installing NodeJS.
- Once NodeJS is installed, go Start and type cmd in the search box. This will bring up the console window. From there, type npm install -g phonegap as instructed on the website.
- Next, scroll down to the archives and download the latest version of PhoneGap.
Setup PhoneGap Project Template for Visual Studio.
- You should now have downloaded the PhoneGap SDK. The file will be named phonegap-2.9.1.zip (version will vary).
- Extract the file phonegap-2.9.1.zip.
- Now navigate to the lib, windows-phone folder.
- Now run the createTemplates.exe file. This will create the project template in Visual Studio.
Create Project with PhoneGap Template
Now you will be able to create a new PhoneGap template in Visual Studio. Follow these steps to get started.
- Open Visual Studio for Windows Phone
- Go to File, New Project
- Under templates, select Visual C#
- Select the CordovaWP8 template
Creating Your First Phone App
The wonderful thing is that you can now create Windows Phone Apps using HTML, JavaScript, and CSS. For more information on how to design an app using HTML, I highly recommend going through the HTML5 Tutorial: Using PhoneGap to Create Mobile Contacts tutorial on the LearnToProgram.tv YouTube channel (see video below). In this tutorial they are using the iPhone development kit, however, many of the techniques for creating HTML5 apps will be the same.