At the end of this series of parts, you should be able to successfully install your Hybrid Application Toolkit with minimum effort. In the previous part we have already seen how to install JDK, Android SDK and Apache Ant.

Now I’m going to show you how to install Kapsel, how to configure some environment variables and how to install a bunch of other components like GIT, Node.js, Kapsel CLI, Cordova and Plugman. This is the complete list of the steps we will go through in this part:

First of all, let’s set the JAVA_HOME. The steps listed here for setting the JAVA_HOME variable are the same for all the other 3 variables. For the PATH variable you just need to append a new string to the existing PATH. You will see this later.

9) At the end, you can check if you have done all correctly by typing one by one the following commands

echo %JAVA_HOME%

echo %ANT_HOME%

echo %ANDROID_HOME%

echo %KAPSEL_HOME%

path

You should get something like this

For each variable you receive the related path. Check that they are all correct. All the environment variables have been properly configured.

Install a GIT client

A GIT client is another very important tool for HAT: it’s used to manage source code on the GIT server. There are many GIT clients available on the web, what we really need is a GIT client which works in the Terminal window. You can check if you have such a Git client installed on your machine by opening a Terminal window, typing the word “git” and hitting ENTER. You should get something like this

This means that the Git client is installed. If you don’t have the Git installed you can follow this procedure to install it.

1) Download the Git client from here Git. Feel free to download the latest version

2) Start the installation process by double clicking on the installation file

3) Click on Next at the Welcome screen

4) Click on Next at the License information

5) Choose the path where you want to install it or leave the proposed one and click on Next

6) At the Select Components screen simply click on Next

7) Click again on Next to create a shortcut in the Start Menu

8) You come now to an important step: here you need to choose how you would like to use Git from the command line. Choose the second option and click on Next

9) At next screen you are called to decide how Git client needs to deal with the line ending conversions. Let’s choose the first option and click on Next

10) At the screen named “Configuring the terminal emulator to use with Git Bash” keep the “Use MinTTY” option selected and click on Next

11) At the screen named “Configuring experimental performance tweaks” keep the “Enable file system caching” option unselected and click on Next

12) The installation starts. At the end simply click on Finish

13) Close any open Terminal window and reopen a new one and issue again the “git” command. You should see that the Git client is now installed

14) In case you are behind a proxy firewall and you need to manually configure the proxy settings for Git, you can do it by following the steps listed in the APPENDIX to this part under the chapter How to configure proxy for Git

Install Node.js

Node.js is the main tool for HAT setup: the script which installs HAT uses this tool for executing the installation instructions.

The installation of Node.js brings in bundle a package manager which is called “npm” and can be used from the command line. This package manager is an important tool here for next steps. The “npm” tool is able to connect to some remote repository and install the package specified in the command line. For this reason, since it needs to connect to the internet network, it might be required to configure the proxy settings for it, in case your machine is behind a proxy firewall. The HAT installation will automatically ask you for proxy information and will set the npm configuration for you. In case you need to do it manually you can by following the steps listed in the APPENDIX to this part under the chapter How to configure proxy for npm

NOTE: You MUST NOT install the latest version, but just a specific version which is 10.4x. In this guide I’m going to install the 10.40 – 64bit.

1) Download the application

2) Double click on the download file to launch the installation process

3) Click on Next at the Welcome screen

4) Accept the license agreement and click on Next

5) For the destination folder you can leave the proposed one (the default for 64bit should be C:\Program Files\nodejs\) and click on Next

6) Click on Next again on the screen named Custom Setup

7) Click on Install to start the installation

8) If you get the User Access Control popup, click on Yes to install the “node.js” program

9) Click on Finish when the installation finishes

10) If you close and reopen the terminal window now you should be able to check the versions of the two new commands “npm” and “node”

NOTE: if the npm command is not recognised in the Terminal window at the end of the installation, you might require to reboot your PC.

Install Kapsel CLI

This step will install the Command Line Interface for Kapsel. This is a very short step. All you have to do is just to run the following command in a Terminal window:

npm install -g c:\KapselSDK\cli (of course if you have installed the Kapsel plugin in a different folder you have to adapt this line)

You should get something like this:

NOTE: If you get errors here it’s because most likely you have not properly configured your proxy settings for npm. Please follow the steps listed in the APPENDIX to this part under the chapter How to configure proxy for npm

Install Apache Cordova 5.2.0

Apache Cordova can be even installed during the HAT setup, but for sake of simplicity I’m going to install it here. It’s important to mention that if you want to install Cordova during the HAT setup, you don’t have to take care of the version to install, because the HAT setup will automatically propose you the right version: doing it in this phase requires that you know exactly which is the right version to install. For the HAT version I’m going to install in the 3rd part of this blog, the right Cordova version is 5.2.0 and this is exactly what I’m going to install here.

The installation is pretty simple: it’s done through the “npm” command. You need just to open a Terminal window and run the command:

npm install -g cordova@5.2.0

NOTE: If you get errors here it’s because most likely you have not properly configured your proxy settings for npm. Please follow the steps listed in the APPENDIX to this part under the chapter How to configure proxy for npm

Install Plugman

Plugman is a tool for installing/uninstalling plugins for Apache Cordova.

The installation of Plugman is achieved through an npm command as well:

npm install -g plugman

In case you are behind a proxy firewall and you need to manually configure the proxy settings for Plugman, you can do it by following the steps listed in the APPENDIX to this part under the chapter How to configure proxy for Plugman

16 Comments

i am having issues with the HAT installer. Keeps saying that i have not added the various HOME variables to the Path (which i have done), and cannot seem to recognize the Android SDK is installed (i’ve installed it twice, using different paths – same results).

While i can fix the HOME thing with the installer (option to fix the issue – nothung changes in the Path variable but seems to work) i am still struggling with the Android SDK not being detected.