Publishing natively with PhoneGap

Once you're done making a game, you may want to package your app and sell it natively on an appstore. PhoneGap is a great tool that can help you do just that. AppGyver is another good alternative.

PhoneGap lets you compile and build native apps by giving you a wrapper for your HTML5 apps. You can either install the native SDK of each platform, in which case you'll have full control of everything, but it comes at the cost of having to set up the development environment.

Or you can just upload your HTML files and the cloud will build it into a native app for you automatically. The drawback to this is approach is that it only gives you the first app for free (but you can have unlimited apps if they're open source) but we'll be using this cloud approach for simplicity.

Prerequisites
Before we get started, make sure you have all of the following ready:
 * 1) An Adobe account. Make sure you can sign in here https://build.phonegap.com
 * 2) Install Node.js https://nodejs.org/
 * 3) Install Phonegap http://phonegap.com/install/

Getting started with a sample app
Once you have everything installed correctly, creating and compiling a sample app is very easy. If everything went right, you should have native Android and Windows phone downloads. (For iOS you need to enter a developer certificate key if you have one). Your app is now ready for deployment!
 * 1) Create an app. You can do this by running "
 * 2) The www folder is where the app itself is. Take a look at index.html and make any modifications you like.
 * 3) Create a zip file of everything inside the www folder (such that index.html is in the root of this archive).
 * 4) Go to https://build.phonegap.com/apps and upload your app zip file
 * 5) Sit back, watch the cloud build service compile your app, and download the native file and run it on your phone!

Integrating it with Phaser
Now that's just the default PhoneGap app, what if we wanted to put a project made with Phaser in? It's no different from making any web app. The important thing is to keep the head tag, and replace the body tag with your own code, but make sure to keep these lines:

You can see an example Phaser app in the Github repository provided with this course.

Extending with native code and plugins
At this point, you might be happy with being able to compile native applications. However, during release you might need to connect to various native API's, such as ads, or micro-transactions, or Camera/File API's of the phone.

This is beyond the scope of this course, but PhoneGap does provide a robust system to allow you to do all this with plugins.

Be sure to check out the documentation and community for resources and guidance:

http://docs.build.phonegap.com/en_US/#googtrans(en)

Challenges
(The example app provided is a port of the falling physics boxes example, modified to use touch events instead of mouse)
 * Can you port one of our examples to run on your phone?