how to build phonegap app for windows phone?

14
How PhoneGap enters in the world of Windows Phone?

Upload: mobilepundits

Post on 15-Jan-2015

325 views

Category:

Technology


1 download

DESCRIPTION

Why PhoneGap for Windows Phone?. Presented BY Mobile Pundits. How PhoneGap for Windows Phone. Outline. Why develop for Windows Phone? How do I get started? How do I submit my awesome app to the Windows Phone Marketplace? Now that I’ve submitted my sweet app, what should I do now? There are no secrets to success. Here are some easy yet fruitful tips which give your app an extra edge to reach out to your potential customer base.

TRANSCRIPT

Page 1: How to build PhoneGap App for Windows Phone?

How PhoneGap enters in the world of Windows Phone?

Page 2: How to build PhoneGap App for Windows Phone?

About PhoneGap

PhoneGap is an open source framework for building mobile apps using web-technologies.

• HTML for layout ( Better yet HTML5 )• JavaScript for accessing device functionality• CSS for look and feel.

It's a collection of tools + a consistent cross-device API. • Use the same JavaScript calls to access device functions.  navigator.notification.vibrate();

• Supports development for the following operating systems:

Android, iOS, Windows Phone, webOS, Windows Mobile, Symbian OS and BlackBerry.

Page 3: How to build PhoneGap App for Windows Phone?

Requirement

Applications built with Apache Cordova/Phonegap for Windows Phone 8 will only run on Windows Phone 8 devices. If you are looking to target both 7.5 and 8 devices, then you should be using Apache Cordova for Windows Phone 7, which does not have all the new shiny features included in IE10, but implements the same APIs.

Since the Android, iOS, and Windows Phone apps use the same codebase, the usage is identical. However, a fun fact is that you can now develop on an OS X machine and preview on a Windows Phone device. Cross-platform, indeed!

Page 4: How to build PhoneGap App for Windows Phone?

Why Windows Phone 8?

On Windows Phone, PhoneGap is incredibly flexible. The API is implemented inside a user-control. This means that you can easily add a little PhoneGap to an existing WP7 app, or if you choose, you can add Silverlight controls to your PhoneGap app.

On the other hand, till the end of 2013, usage of Windows Phone 8 (WP8) has increased everywhere with almost 4% of global market share and 10% of the European market. It's also important to note that Microsoft is listening to developers and has made WP8 a legitimate mobile platform - including making Internet Explorer 10, with its standards compliant and performant engine, the default browser.

Page 5: How to build PhoneGap App for Windows Phone?

How PhoneGap for Windows Phone?

Method 1: Phonegap templates and Visual Studio 2012

• With this method, the provided templates are easy to use and most of the time you can work with the graphical interface of Visual Studio 2012. One little disadvantage is, that these templates are not compatible to Visual Studio 2012.

• This method requires following tools at hand, to start developing your native windows phone 8 web app and to make your app a great one:– Phonegap on Github– Visual Studio 2012 Pro– Visual Studio 2012 Update 4–Windows Phone 8 SDK

Page 6: How to build PhoneGap App for Windows Phone?

How PhoneGap for Windows Phone?

1. Get Phonegap repository with template files Clone Phonegap repository on Github: > git clone https://github.com/phonegap/phonegap.git Go to windows-phone folder: > cd Phonegap\lib\windows-phone2. Create template files “createTemplate.bat” automatically creates template

files for you. CMD: > createTemplates.bat Powershell: > start-process createTemplates.bat

Page 7: How to build PhoneGap App for Windows Phone?

How PhoneGap for Windows Phone?

3. Implementation of Phonegap template files Copy CordovaWP7.zip and CordovaWP8.zip in > lib\windows-phone and paste them into > Documents\Visual Studio 2012\Templates\

ProjectTemplates

That’s the trick, your Phonegap templates for Windows Phone 8 and Windows Phone7 are now installed.

Page 8: How to build PhoneGap App for Windows Phone?

How PhoneGap for Windows Phone?

4. Build and deploy to emulatorMake sure Windows Phone Emulator is selected in the main drop-down menu. Then press the green play button to start debugging, or type F5.

Page 9: How to build PhoneGap App for Windows Phone?

How PhoneGap for Windows Phone?

Method 2: Phonegap-Cli and Visual Studio 2013 (preferred)

• Method 2 is for those who are used to the console and happy with the new Phonegap cli. Another benefit is that this method is compatible with the new Visual Studio 2013.

• For this method, following tools will help you developing your native windows phone 8 web app and make this tutorial a great one:

-Visual Studio 2013 Pro-Phonegap Docs-node.js

Page 10: How to build PhoneGap App for Windows Phone?

How PhoneGap for Windows Phone?

1. PhonegapInstall the newest version of Phonegap: > npm install -g PhonegapGo to your existing project and create a Phonegap project in

an extra folder in your project,here it’s “/native”: > phonegap create nativeGo into the folder > cd nativeCopy your project files into the “native\www” folder. Be sure

you have no empty css orJavaScript files in your project. Build the app within a native

container > Phonegap build wp8

Page 11: How to build PhoneGap App for Windows Phone?

How PhoneGap for Windows Phone?

2. Run the app on the emulatorTo run the app on the emulator Windows Phone

8 SDK has to be installedon your computer and then run the project into

the emulator or device > Phonegap run wp83. Edit and debug projectTo edit and debug the Phonegap app its

recommended to use VisualStudio 2013 Pro go to your project build by

Phonegap: > cd \native\platforms\wp8Open the .sln file with Visual Studio 2013

Page 12: How to build PhoneGap App for Windows Phone?

How PhoneGap for Windows Phone?

4. Build and deploy to emulatorIn Visual Studio 2013 make sure Windows Phone emulator is

selected in the main drop-down menu. Then press the green play button to start

debugging, or type F5.In Cli make sure you are in the phonegap directory, to build

and install it to the emulator. > phonegap run wp8 --emulator > phonegap install wp8 --emulator

Page 13: How to build PhoneGap App for Windows Phone?

What you have learnt so far…

Hopefully this presentation has brought to light how easy it can be to add that third platform to your PhoneGap app. By exploring the Windows Phone 8 platform you are not only broadening the reach of your app, but you are also helping to legitimize PhoneGap itself.

You now know two methods to put your web app, which is written in JavaScript, HTML, CSS into a native Windows phone 8 Phonegap container, so you can access your web app directly on your home screen of the Windows phone. The good news is, that this is just the beginning. If you are motivated and this post has awaken your curiosity, there are plenty things you can learn.