So, guys time for again another tutorial as I promised. Yes today I am going to show you that how to create a zip file to upload on Phonegap’s account in Adobe or Github and get your things done out there.
Now lets begin our next tutorial on Phonegap build.
Phonegap is a cross platform framework, so the build on Phonegap needs an application to be packaged in a specific way which is a bit peculiar one.
Phonegap uses W3C Widget Packaging specification for the same.
There are two basic leaps for getting this thing done. They are:
1) What you need to upload?
2) How to upload?
What you need to upload?
For a Phonegap build you require only the assets folder of your application to be packaged. Well you might be wondering that what that is actually? It is actually the “www” folder into your project (it lies in the root directory of assets folder) which contain things like HTML, CSS, Js files, etc of your application.
We need to add these files only because phonegap build fails to compile native files like .h, .m, .java,etc of your application.
So as per below figure, copy the things selected in www folder. Now create a new folder on your desktop named “Phonegap” and copy that selected files into it.
Which unnecessary files you need to remove?
Once you are done with integrating the necessary assets of your application, remove the phonegap.js (cordova.js) file as during the Phonegap build the build will automatically include this js file during compilation process.
The below screenshot shows the Cordova file of my application. You’ll also find one in your window of the version of phonegap which you might have downloaded.
Now as per below figure remove/delete the cordova.js file, in my case it is cordova-2.6.0.js.
Well you might be thinking that why to do such stupid thing i.e. if build is already appending that file then what is the point of removing this file and letting the same file to be added into your zip through the Phonegap build?
Note: Make sure that after deleting your phonegap.js file you are still able to access the Phonegap API. To check this ensure the following reference is made into your index.html file.
2) How to upload?
Create a zip file for your folder “Phonegap” which lies on your desktop.
Now to upload the zip file on an Adobe account or a Github account. For this open this link and click on Sign-In from the top right corner into your Adobe Id https://build.phonegap.com/people/sign_in , if you do not hold an Adobe Id password Go and register a new account in Adobe.
After this click on “+ new app” and a window like this will appear where you need to upload a zip file of your “Phonegap” folder which you have created on your desktop in the “Private” section.
Step: Now you’ll get a screen in which you will be able to see the Phonegap build process for your application. Now download the “apk” file by clicking on it and saving on it.
After downloading this “apk” file, transfer this file into your Android device through bluetooth or any other means and can see it running it successfully.
Well, you might be wondering that why there is a red coloured button before the iOS? Well the answer is that Phonegap build for iOS requires a “Key file” which we need to generate on our own manually. Its a long process but don’t worry, my next tutorial is based on the same.
I hope this tutorial helps you out build your apps successfully.
In case you want to eat my head with your queries, you are most welcome for that. 🙂 😛 😉
See you next time with another tutorial. Till then “Happy Phonegap build” times. 🙂