compwerks is a collection of computer related articles and practical ITdeas
Saturday, September 13, 2014
Saturday, August 2, 2014
Thursday, July 31, 2014
Tuesday, February 4, 2014
Installing PhoneGap/Cordova from Scratch
If you're going to
develop mobile apps using web technologies such as HTML, CSS and Javascript.
Then this is the right place for you to begin with.
Easy tiger! for some
good reason I feel you are in hurry to start things recklessly (e.g. you're
gonna Google it find phonegap.com and then read all tutorials, hey Sherlock I
just told you, you are already in the right place), but you gotta know what you
need to know first.
OK, what is phonegap and
cordova? both are tools with the same framework that will allow you to use web
technologies in developing platform independent mobile apps, when i say
platform independent it means you don't have to worry about the Operating
System; iOS, android, windows 8 etc. The term Phonegap and Cordova are used
interchangeably and there's a confusion between them that I will totally wreck
right now (yeah the accent, I know!). Despite of so many complex explanation
out there here’s my enlightening idea about it; “Phonegap is also Cordova with
additional features from Adobe”. I don’t think I should explain more on this since
it won’t matter anymore once we start installing Phonegap using nodes (that I’ll
explain later).
Phonegap has richer
features so I’m going to discuss Phonegap in this blog;
Requirements:
I assume you have nothing installed on your computer related to web development you must also know how to use cmd prompt
I assume you have nothing installed on your computer related to web development you must also know how to use cmd prompt
Here's the Steps
1ST MAJOR STEP: Installing a globalize JDK (refere to the corresponding images while following the steps)
1ST MAJOR STEP: Installing a globalize JDK (refere to the corresponding images while following the steps)
- Install the latest JDK from Java JDK
- The file jdk-7<version>-windows-i586-i.exe is the JDK installer for 32-bit systems. The file jdk-7<version>-windows-x64.exe is the JDK installer for 64-bit systems. If you downloaded either file instead of running it directly from the web site, double-click the installer's icon. Then, follow the instructions the installer provides. The installer may ask you to reboot your computer. When finished with the installation, you can delete the downloaded file to recover disk space.
- Set the
PATHvariable permanently, add the full path of thejdk1.7.0\bindirectory to thePATHvariable. Typically, this full path looks something likeC:\Program Files\Java\jdk1.7.0\bin. Set thePATHvariable as follows on Microsoft Windows (take note that there are minor difference of steps if you are using windows 8, now if you're using windows XP, wait, what!?):
- Click Start, then Control Panel, then System.Click Advanced, then Environment Variables.
- From the Desktop, right-click My Computer and click Properties.
- Click Advanced System Settings link in the left column.
- In the System Properties window click the Environment Variables button.
- Select the Path variable from the System variables section.
- Select the Edit button.
- Add the location of the
binfolder of the JDK installation for thePathvariable - in System Variables. The following is a typical (depending on your jdk version) value for the
Pathvariable:C:\Program Files\Java\jdk1.7.0\bin;C:\WINDOWS\system32;C:\WINDOWS; - NOTE: we are refering to "Path" in the System Variables not "PATH" in the User Variables
- NOTE: It is very important that you must insert "C:\Program Files\Java\jdk1.7.0\bin" in the beginning (pinaka umpisang umpisa) of the variable value then terminate it with ";" otherwise it will affect your compilation of phonegap apps and will lead to java not being found refer to this image below

- Click OK, OK and OK
2ND MAJOR STEP: installing globalize SDK
- Download the SDK ADT bundle from SDK ADT Bundle

- Choose between 32 bit or 64 bit leave check "I have read.."
- Unpack upack the ZIP file (named
adt-bundle-<your_platform>.zip) and save it to an appropriate location, such as a "Development" directory in your home directory. - Open the unpacked directory and you should see the contents, something like this;

- Now, open the SDK folder inside the unpacked zip adt bundle and check if the folders "tools" and "platform-tools" are there.
- Copy and take note of their directory path, put it in a notepad or where ever you want to insertit, for example I will insert the following directory path in a notepad
- D:/directory_of_your_unpacked_zip/adt-bundle-<your_platform>/sdk/tools
- D:/directory_of_your_unpacked_zip/adt-bundle<your_platform>/sdk/platform-tools
- Let's add some changes to your system variables again

- From the Desktop, right-click My Computer and click Properties.
- Click Advanced System Settings link in the left column.
- In the System Properties window click the Environment Variables button.
- Select the Path variable from the System variables section.
- Select the Edit button.
- You need to add the path to your Android SDK platform-tools and tools directory. In my example I will use the two directories in step 5 as the directory the SDK is installed in. Append the following text into the text box labeled "Variable value"
- note: in appending variable value ";" sign indicates a terminator of a value therefore put ";" sign then paste your directory path at the end
- Click OK, OK and OK
3RD MAJOR STEP: Installing a globalized Apache Ant (/bin)
- Download Apache ant zip archive binary distribution from Apache-Ant.zip or from Apache Ant
- Extract the file
- Put it in a directory
- Copy the bin directory path, w/c looks like C:/apache-ant-1.9.3/bin
- Just like the other 2 major steps in this tutorial add its directory in the System Variables, this time it's Ok where ever you want to insert it, just make sure it's terminated by ";" sign if it's not in the end of the Variable Value.
4TH MAJOR STEP
- Install node.js from node.js
- Choose if you want 32 or 64 bit windows installer msi (if you're using windows)
- Double Click the installer and just install following your IT instinct
- Open cmd and type npm something must happen when you do it refer to the image below
FINALLY YOU ARE READY TO INSTALL PHONEGAP! YIPPEEE Clap! Clap!
- Warning: You must have an internet connection!
- open cmd prompt and type npm install -g phonegap (no need to worry about directories just type it!)
- Note: -g means 'global' meaning it will install phonegap as a global variable so you can call "phonegap" command anytime anywhere in your cmd prompt

- You will see IP adresess during installation this is an indication that phonegap is installing properly
- When done, type phonegap in your cmd prompt and you should see something like below

- If you have plans on exploring how to use it (since you installed it!) understand how CLI works here's the link CLI for Phonegap
Subscribe to:
Comments (Atom)



