Getting Started With phoneGap And Windows Phone In VS2010

Hi,
My Previous Post On PhoneGap : Want To Build A Mobile App With The Motto “Write Once Deploy On Any Device??
In my previous post we saw how to create a sample application using Html5,css and JS.
In that post i just mentioned that we can keep html,css and js files in a particular folder and then uploading the same into PhoneGap build to get required output.
Problem Statement:
Why do we need to make use of PhoneGap to create Windows Phone7 apps. In order to access the phones native features then we are supposed to create our app using Xaml and other c# code. Can we access our phones native features using Html and Java script? The answer to this question is no without making use of PhoneGap(may be we can use some other framework too) but the ultimate answer is we are supposed to make use of some kind of framework to access phones native features from html and js.
Required Softwares:
1.Visual Studio 2010
2.Windows Phone SDK (Download Link.From here we can download wp7.5)
Getting Started With PhoneGap and Windows Phone:
1.Download the latest version of PhoneGap from Download PhoneGap
1
2.After downloading the file, unzip it. There we will find number of folders with different mobile os names in the lib folder.
2
3. Now go to Windows Phone -7 Folder present inside lib folder.
4.There we will find two zip folders CordovaWP7_2_4_0_Full.Zip and CordovaWP7_2_4_0_StandAlone
3
5. Copy those 2 Zip files and paste them in the following location
C:\Users\lenovo\Documents\Visual Studio 2010\Templates\ProjectTemplates
6. Now Open visual studio and click on new —> project. There you can select CordovaWP7_2_4_0_Full from the list and create project
4
7. Folder structure of the project created looks as follow
5
8. In the above image we can see www folder where our actual html,css and js files were placed and our core logic related to our app is placed in that folder.
9. Now press F5 and windows phone emulator is loaded with our app. If we see our app doesnt contain any xaml files that contains core logic. everything is placed in html and js files.
6
Now we can have custom code in the www folders related to our app.
How can we deploy the code written for windows phone onto other mobile devices: 
That is a simple task , actually the main purpose of PhoneGap is to help us in creating hybrid apps that can be deployed onto cross platform mobile devices.
In order to achieve that we are supposed to create a zip file for the folder www in our project.
Now go to this url https://build.phonegap.com/people/sign_up
and sign in with abobeid or GitHub id(If you dont have one then you can create it).
8
There we can upload our zip file and click on upload. Then it will create installation files for respective devices.
Now we can download them and istall on respective devices.
Note: It will not give the installation file related to Ios devices because it requires app key to generate the installation file.
In my next post we will see on how to interact with phone’s native features through html and js using PhoneGap

Comments