Quantcast
Channel: SAPUI5 Developer Center
Viewing all articles
Browse latest Browse all 789

How to install Hybrid Application Toolkit (HAT) on Windows (part 1 of 3)

$
0
0

Introduction

Today I'm gonna show you how to install the Hybrid Application Toolkit (HAT) on a Windows machine. Hybrid Application Toolkit (from now on simply HAT) is the tool which allows you to deploy SAP Hybrid applications on mobile devices. Hybrid application (also known as Kapsel applications) can be created by using SAP Web IDE and then deployed on mobile devices with this tool. In order to get more information on this tool and on SAP Web IDE I suggest you to give a look to this page (SAP Web IDE - Enablement). Here you can find a lot of other useful resources for SAPUI5 application development.

This blog is just for Windows: another one, hopefully, will come soon for Mac platform.

HAT installation is NodeJS based: it guides you through all the steps for a successful result. However in order to avoid the needing to start the installation and then going back and forth installing the missing components, with this blog, I'm giving you a sort of good starting point so that when you start the HAT installation it will be as smooth as possible and you will be no longer required to leave the installation process for installing other mandatory software.

 

This blog has been split in 3 parts:

LinkContent
Part1Install JDK, Android SDK and Apache ANT
Part2Install NodeJS, Cordova, Kapsel, Git, Plugman and configure environment variables
Part3Install HAT and test it

 

 

Prerequisites

In this blog I would like to start with a very blank Windows machine, so I'm gonna show you how to install all the needed tools for SAPUI5 application development. We will go through the installation of the following components:

  • Java JDK 8
  • Android SDK rel. 24.3.3
  • Apache Ant 1.9.5
  • SAP Kapsel Plugin 3.8.2
  • Node.JS v.0.10.38
  • Git client
  • Hybrid Application Toolkit 1.5.2
  • Cordova 4.2.0
  • Plugman

The prerequisites here are nothing more then the following ones:

  • Windows 8.1 64bit
  • Google Chrome browser
  • An account on the SAP HANA Trial Landscape accessible by this link (SAP HANA Cloud Platform)

Further recommendations:

  • UAC must be set as by default

04.jpg

  • All the commands in the Terminal window must be executed WITHOUT administrator's rights, otherwise you won't be able to perform HAT setup.

 

 

 

Getting started

As I said, for your comfort, I will start from the very beginning, so with a very blank machine. I've split the complete how-to-guide over 3 parts. This is the complete list of the steps we will go through:

Part 1:

  • Install Java Development Kit (JDK)
  • Install Android SDK
  • Install Apache Ant

Part 2:

  • Download and install SAP Kapsel Plugin
  • Configure some environment variables (JAVA_HOME, ANT_HOME, KAPSEL_HOME, ANDROID_HOME and PATH)
  • Install a GIT client
  • Install Node.js
  • Install Kapsel CLI
  • Install Cordova 4.2.0
  • Install Plugman

Part 3:

  • Download HAT
  • Setup HAT
  • Run HAT and test its connectivity with SAP Web IDE
  • Deploy your first Kapsel app to local Hybrid App Toolkit


So, let's focus here just on the first part!




Install Java Development Kit (JDK)

Java Development Kit is required by the Android SDK, so as first step we need to install this component. In this guide I'm using JDK 8, but 7 is fine as well.


1) Go to JDK download page "Java SE Development Kit 8 - Downloads", accept the license agreement and download the JDK according to your Windows platform (32 or 64 bit)

2015-06-25_11-28-08.jpg


2) Once the download is finished double click on the downloaded file to start the installation

2015-06-25_11-29-26.jpg


3) Leave all by default and click Next at every step. When you reach the step where you can change the installation path, take note of this path because it will be required later when you are going to configure the JAVA_HOME system variable

2015-07-07_11-51-06.jpg


4) When the installation finishes, you can check that all worked fine by opening a Terminal window and typing the command "java -version". You should get something like this

2015-06-25_11-32-13.jpg

Install Android SDK

For the Android SDK you can go to the following URL: Download Android Studio and SDK Tools | Android DevelopersNow you have two possibilities:

  • download the complete Android Studio suite which contains in bundle the Android SDK
  • download the stand-alone version of SDK without the Android Studio.

In this guide, I'll follow the second approach, but the first one is fine as well: just write down the path where the bundled SDK tool is installed.

 

1) Go to the download URL and click on Other Download Options

2015-06-25_11-38-06.jpg

 

2) Choose the recommended download option (for Windows), which is the one by the installer

2015-06-25_11-38-39.jpg

 

3) Once the download is finished, double click on the downloaded file to start the installation

2015-06-25_11-40-37.jpg

 

4) Accept the UAC request by clicking on Yes

 

5) Click on Next on the Welcome screen

 

6) Click on Next on the screen where the current installed Java version is verified

 

7) Choose if you want to install this just for you or for everyone and click on Next

 

8) Take note of the installation path (it will be required later) and click on Next

2015-06-25_11-42-33.jpg

 

9) Click on Install

 

10) When the installation is completed click on Next

 

11) Choose to Start the SDK Manager and click on Finish

 

12) The SDK manager starts: if you get an error like this, it's because most probably you are behind a firewall and you need to configure your proxy settings; so click on Close and read the APPENDIX to this section named Configure proxy for Android SDK Manager.

If you have no "Failed to fetch" error, you can continue with next step

2015-06-25_11-54-49.jpg

 

13) Now you need to specify the packages you want to install. For this H2G we will choose to install Android 4.4.2 (API19). This because, at moment, this is the highest supported Android version by the latest Kapsel plugin. You can install newer versions of Android, but the installation process will always check and require the presence of API 19 to work. You can skip installing the Glass Development Kit preview because it's not needed for this guide and will probably ask you to accept a separate license in the next step. In my case there are just 11 packages to install. Click on the Install 11 packages button

2015-07-07_12-09-00.jpg

 

14) Select the root Android SDK License, click on Accept License and then on Install

2015-07-07_12-12-53.jpg

 

15) The installation of the required packages starts. It might require some time depending on your network speed, so be patient. If you get an error saying "Stopping ADB server failed (code -1)" at the beginning of the installation process, don't worry, it's normal!

 

16) When the installation finishes, we need to create an Android Virtual Device(AVD) in order to test our Android applications. Of course, this shouldn't be mandatory, because I could test my applications just by using my Android phone, but at moment the HAT setup looks for it, so we need to configure it. In the future probably this won't be a mandatory step.

In order to create your first AVD, select Tools --> Manage AVDs, click on the Device Definitions tab, select a suitable device for your Android emulator (i.e. Nexus 4) and click on Create AVD

2015-06-27_19-58-24.jpg

 

17) Specify the required parameters (this is just an example and click on OK)

2015-07-07_12-28-19.jpg

 

18) When the summary screen appears click on OK

 

19) You should be able to get your emulator in the list

2015-07-07_12-29-17.jpg

 

20) You can close the tool.

 

NOTE: Using the Android Emulator with this kind of ARM processor might result very slow. I suggest you to use (if possible) Virtual Machine Acceleration as explained here. In this way you can have a better emulated device for your development.

 

 

 

Install Apache Ant

For the Apache Ant software installation, you can download it from Apache Ant - Binary Distributions

The latest version at the time I'm writing this guide is 1.9.5.


1) Download this version

2015-06-25_13-05-02.jpg


2) Select the downloaded zip file, right click on it and choose Extract All

2015-06-25_13-05-47.jpg


3) Just put the extracted folder on your C: drive's root. A subfolder will be automatically created

2015-06-25_13-08-42.jpg


4) Rename the new folder simply with "apache-ant"

2015-06-25_13-09-54.jpg

 

Good job so far! Please continue with the part 2 of this H2G!


 

 

APPENDIX

Configure proxy for Android SDK Manager

 

1) Click on Tools --> Options

2015-06-25_11-55-08.jpg

2) Enter your proxy settings (i.e. for SAP Network proxy:8080)

2015-06-25_11-55-39.jpg

3) Close SDK Manager and reload it by double clicking on the SDK Manager executable

03.jpg


Viewing all articles
Browse latest Browse all 789

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>