1
votes

I would like to develop applications for iOS, Android and Windows Phone 8 & 8.1. I will build everything locally for Windows Phone. I'm also somewhat familiar with other SDKs but mostly my colleagues will help me to build for other platforms.

My applications are planned to be simple, mostly Web style apps with HTML5/jQuery and adding some of phone capabilities, but nothing fancy. As I understood, PhoneGap wraps native Web Browser view for the platform of my choice and loads everything into that WebView. But when I look at this table: http://docs.phonegap.com/en/3.4.0/guide_support_index.md.html#Platform%20Support I see that no WebView support exists for Windows Phone 8.

Does it mean that on Windows Phone there will be some major differences or PhoneGap/Cordova is good at masking away all the differences?

My IDE of choice is Visual Studio 2013 (I have MSDN subscription). Today I installed Windows Phone SDK and tried to create my first PhoneGap "Hello world" app but failed. The documentation is so confusing - sometimes it asks me to extract something from ZIP files although I have installed everything from node.js npm.

At first I did

npm install -g phonegap
phonegap create helloapp
cd helloapp

Everything OK so far, no errors.

Then I did tried to find instructions how to build and run Windows Phone app. I looked here:

http://docs.phonegap.com/en/3.4.0/guide_platforms_wp8_index.md.html#Windows%20Phone%208%20Platform%20Guide It says:

"Download and extract the latest copy of [PhoneGap. The lib\windows-phone-8\wp8 subdirectory is where you need to do your work. Copy the CordovaWP8_x_x_x.zip file to the \My Documents\Visual Studio 2012\Templates\ProjectTemplates\ directory."

Of course there's no such CordovaWP8_x_x_x.zip and there is no lib\windows-phone-8 on my PC because the download link in this article leads to the instructions about how to install PhoneGap through npm. Ok, I thought, then I'll try building my test app from command line and fix those Visual Studio templates later. How do I build it? The front page says

phonegap run android

Obviously I need Windows Phone platform. Is it called windows-phone-8? Failure with some meaningless message

TypeError: Cannot read property 'human' of undefined

It feels as if PhoneGap called me 'non-human' or something :) Ok, I get it. Looking for the right platform name... No examples for building Windows Phone app, but I could decipher from some other example

cordova platform add wp8

that my platform should be called wp8. Then I did

phonegap run wp8

What? It's asking me for credentials of Build service! No, I want a local build! Why did PhoneGap put a quickstart example on their front page, which does not build straight away... After some search I got it right:

phonegap local run wp8

Anyway, the first impression is that PhoneGap is really inconsistent with its documentation and confusing with mixing PhoneGap/cordova instructions.

I've heard some developers suggest throwing PhoneGap away, especially since I don't need PhoneGap Build services. And also because sometimes something gets broken on PhoneGap and does not match latest versions of Cordova any more. But maye Cordova might have such issues, too...

Is Cordova better for developing on Windows with Visual Studio 2013? Which is more mature and more frequently updated with bugfixes - PhoneGap or Cordova?

1
if you don't want to use phonegap build service, then use cordova, phonegap is cordova+build service. And yes, documentation have a lot of mistakes. About using phonegap/cordova webview on WP8, it's possible but isn't documented, but don't get confused, the cordova/phonegap webview support in that compatibility table is as a component, that means, to use a phonegap webview inside a native app mixing native parts and phonegap webviews.jcesarmobile
Yes, I now look more towards Cordova. Logically thinking, if PhoneGap is Cordova+something, then every change in Cordova (bugfixes, new features) will take time before they reach PhoneGap updates.JustAMartin

1 Answers

1
votes

General steps (at the moment) are:

npm install –g phonegap
npm install –g cordova
phonegap create C:\Path\to\project\destination --name PackageName --id com.some.type.of.package
cordova platform add wp8

Then inside the folder C:\Path\to\project\destination\platforms\wp8 double click the .sln file to open up in Visual Studio.

Remember to set HTTP_PROXY if you're behind a proxy.