Professional Documents
Culture Documents
U2-A2 Resources
U2-A2 Resources
U2-A2 Resources
“RESOURCES INSTALLATION”
PRESENTA:
1 Resources ......................................................................................... 1
1.1 Programs ............................................................................................ 1
1.1.1 Visual Studio Code ..................................................................... 1
1.1.2 Android Studio .......................................................................... 4
1.1.3 Git .......................................................................................... 13
1.1.4 Java Development Kit .............................................................. 19
1.1.5 Node ...................................................................................... 21
1.1.6 Gradle .................................................................................... 24
1.1.7 Execution Policy ...................................................................... 27
1.2 Frameworks and libraries ................................................................... 28
1.2.1 Cordova .................................................................................. 28
1.2.2 Bootstrap ................................................................................ 30
1.2.3 Jquery .................................................................................... 30
i
3.1.5 Exercise 5 ............................................................................... 34
3.2 JS Operators ..................................................................................... 34
3.2.1 Exercise 1: .............................................................................. 34
3.2.2 Exercise 2: .............................................................................. 34
3.2.3 Exercise 3: .............................................................................. 35
3.2.4 Exercise 4: .............................................................................. 35
3.2.5 Exercise 5: .............................................................................. 35
3.3 JS Data Types ................................................................................... 35
3.3.1 Exercise 1: .............................................................................. 36
3.4 JS Functions ...................................................................................... 36
3.4.1 Exercise 1: .............................................................................. 36
3.4.2 Exercise 2: .............................................................................. 36
3.4.3 Exercise 3: .............................................................................. 37
3.4.4 Exercise 4: .............................................................................. 37
3.5 JS Objects ......................................................................................... 37
3.5.1 Exercise 1: .............................................................................. 37
3.5.2 Exercise 2: .............................................................................. 38
3.5.3 Exercise 3: .............................................................................. 38
ii
Index of Images
Image Page
Image 1 Visual Studio Code ........................................................................... 2
Image 2 Visual Studio Code ........................................................................... 2
Image 3 Visual Studio Code Execution ............................................................ 2
Image 4 Visual Studio Code Terms ................................................................. 3
Image 5 Visual Studio Code Additional Tasks .................................................. 3
Image 6 Visual Studio Code Installation .......................................................... 3
Image 7 Android Studio Execution .................................................................. 4
Image 8 Android Studio Setup ........................................................................ 5
Image 9 Android Studio Components .............................................................. 5
Image 10 Android Studio Configuration Settings .............................................. 6
Image 11 Android Studio Installation .............................................................. 6
Image 12 Android Studio Import .................................................................... 7
Image 13 Android Studio Wizard .................................................................... 7
Image 14 Android Studio Installation Type ...................................................... 7
Image 15 Android Studio SDK Components Setup ........................................... 8
Image 16 Android Studio Emulator Settings .................................................... 8
Image 17 Android Studio Emulator Hypervisor Driver....................................... 9
Image 18 Android Studio SDK components License Agreement ........................ 9
Image 19 Android Studio Downloading Components ........................................ 9
Image 20 Android Studio Interface ............................................................... 10
Image 21 Android Studio SDK Platforms ....................................................... 10
Image 22 Android Studio SDK Tools ............................................................. 11
Image 23 Android Studio SDK Tool ............................................................... 11
Image 24 Android Studio Platforms and Tools Installation .............................. 11
Image 25 Environment Variables Panel 1 ...................................................... 12
Image 26 Android SDK Path ......................................................................... 12
iii
Image 27 Path System Variable 1 ................................................................. 12
Image 28 SDK Platforms and Tools Path ....................................................... 12
Image 29 Git Execution................................................................................ 13
Image 30 Git Installation ............................................................................. 14
Image 31 Git Editor ..................................................................................... 14
Image 32 Git Path ....................................................................................... 15
Image 33 Git SSH ........................................................................................ 15
Image 34 Git OpenSSL Library ..................................................................... 16
Image 35 Git Default Options ....................................................................... 16
Image 36 Git Terminal Emulator ................................................................... 17
Image 37 Git Pull Command ......................................................................... 17
Image 38 Git Credential Helper .................................................................... 18
Image 39 Git Extra Options .......................................................................... 18
Image 40 Git Experimental Options .............................................................. 18
Image 41 JDK Installation ............................................................................ 19
Image 42 JDK Location ................................................................................ 19
Image 43 JDK Installation Finished ............................................................... 20
Image 44 Environment Variables Panel 2 ...................................................... 20
Image 45 Java_Home Path .......................................................................... 20
Image 46 System Variable Path 2 ................................................................. 21
Image 47 JDK Path ...................................................................................... 21
Image 48 Node Execution ............................................................................ 21
Image 49 Node Setup .................................................................................. 22
Image 50 Node License Agreement .............................................................. 22
Image 51 Node Location .............................................................................. 23
Image 52 Node Custom Setup ...................................................................... 23
Image 53 Node Installation .......................................................................... 24
Image 54 Node Installation Completed ......................................................... 24
Image 55 Gradle Extraction .......................................................................... 25
Image 56 Gradle Folder ............................................................................... 25
iv
Image 57 Gradle Movement ......................................................................... 25
Image 58 Environment Variables Panel 3 ...................................................... 26
Image 59 Gradle_Home Path ....................................................................... 26
Image 60 System Variable Path 3 ................................................................. 26
Image 61 Gradle-8.5 Path ............................................................................ 26
Image 62 Get-ExecutionPolicy -List Command ............................................... 27
Image 63 Set-ExecutionPolicyList Command ................................................. 27
Image 64 Type Yes ..................................................................................... 27
Image 65 ExecutionPolicy List Updated ......................................................... 28
Image 66 Cordova Directories ...................................................................... 28
Image 67 Test Folder in VS Code ................................................................. 29
Image 68 Cordova Installation...................................................................... 29
Image 69 Project Directory .......................................................................... 29
Image 70 Platforms Installations .................................................................. 29
Image 71 Bootstrap Installation ................................................................... 30
Image 72 Jquery Installation ........................................................................ 30
Image 73 Comment Content Security Policy .................................................. 31
Image 74 MVC Implementation .................................................................... 31
Image 75 File References Updated ............................................................... 32
Image 76 App Running ................................................................................ 32
v
Index of Tables
Table Page
Table 1 Resources ......................................................................................... 1
vi
1 Resources
Every project needs resources to carry out certain tasks in the project. The
following programs, frameworks and libraries will be part of the initial resources
for the development of an application.
1.1 Programs
1
and Linux. It comes with built-in support for JavaScript, TypeScript and Node.js
and has a rich ecosystem of extensions for other languages and runtimes.
For the installation process of this application, the file must first be downloaded.
On the official Visual Studio Code website, the file should be available for
download.
After the execution, accept the terms and conditions of the program.
2
Image 4 Visual Studio Code Terms
3
1.1.2 Android Studio
For this program, the professor has shared the installation file. To start the
installation first execute the file.
Allow the program to make changes to the device. Now execute it to start the
setup process.
4
Image 8 Android Studio Setup
Click on next. In the next prompt, it’ll ask for a path for installation. Choose a
path and hit next.
5
Image 10 Android Studio Configuration Settings
It will start the installation, and once it is completed, it will be like the image
shown below.
Click on next. Once “Finish” is clicked, it will ask whether the previous settings
need to be imported [if the android studio had been installed earlier], or not. It is
better to choose the ‘Don’t import Settings option’.
6
Image 12 Android Studio Import
Now Android Studio wizard is working, click ‘Next’ to continue with the setup.
7
The SDK components required for the project are shown in the following image.
Do not install the Android virtual device, it is not required for the project.
Set the maximum amount of RAM available for the Intel Hardware Accelerated
Execution Manager (HAXM) to use for all x86 emulator instances.
8
Image 17 Android Studio Emulator Hypervisor Driver
9
Image 20 Android Studio Interface
Install the next SDK Platforms that are shown in the following image. Select:
• Android 14.0 (“UpsideDownCake”)
• Android 13.0 (“Tiramisu”)
• Android 12.0 (“S”)
Install the next SDK Tools that are shown in the following image.
10
Image 22 Android Studio SDK Tools
Disable the "Hide obsolete packages" and select the 'Android SDK Tools' Tool.
11
Image 25 Environment Variables Panel 1
Create two user variables according to the path where the file is located, one
called 'ANDROID_HOME' and the other 'ANDROID_SDK_ROOT'.
Adds two new Environment Variables according to the path where the SDK tools
and platform-tools are located.
12
1.1.3 Git
For this program, the professor has shared the installation file. To start the
installation first execute the file, when the setup starts, click ‘Next.’
13
Image 30 Git Installation
Leave start folder, text editor, and initial branch as Visual Studio Code editor.
Maintain default settings for initial branch name and PATH environment and click
‘Next.’
14
Image 32 Git Path
15
Image 34 Git OpenSSL Library
16
Image 36 Git Terminal Emulator
17
Image 38 Git Credential Helper
18
1.1.4 Java Development Kit
The Java™ Development Kit (JDK) is software for Java developers. The JDK
enables you to write applications that are developed once and run anywhere on
any Java virtual machine. Java applications that are developed with the JDK on
one system can be used on another system without changing or recompiling the
code. (IBM, 2023)
For this program, the professor has shared the installation file. To start the
installation first execute the file. Execute the file, accept it to make changes to
the device, and then click next to setup JDK.
After that, wait until the installation to finish, and click close.
19
Image 43 JDK Installation Finished
Create the user variable according to the path where the file is located.
20
Image 46 System Variable Path 2
Add a new Environment Variable according to the path where the bin of the file
is located.
1.1.5 Node
Node.js is used to build back-end services like APIs like Web App, Mobile App or
Web Server. A Web Server will open a file on the server and return the content
to the client. (Geeks for Geeks, n.d.)
For this program, the professor has shared the installation file. To start the
installation first execute the file.
21
Image 49 Node Setup
Choose a custom location or click “Next” to install. In my case I will click next.
22
Image 51 Node Location
23
Image 53 Node Installation
1.1.6 Gradle
For this program, the teacher has shared a RAR file with the program in it. To
start the installation first extract the file.
24
Image 55 Gradle Extraction
While the extraction finishes, create a folder named 'Gradle' in the location 'C:\'.
Now that the RAR file has been extracted, open the folder, and move the folder
named 'gradle-8.5' to the 'Gradle' folder created.
25
Image 58 Environment Variables Panel 3
Create the user variable according to the path where the ‘gradle-8.5’ folder is
located.
Add a new Environment Variable according to the path where the bin of the folder
is located.
26
1.1.7 Execution Policy
To view the current execution policies for all scopes, type and run the following
command: ‘Get-ExecutionPolicy -List’.
To set the execution policy for the CurrentUser scope to "RemoteSigned," type
and run the following command: ‘Set-ExecutionPolicy RemoteSigned -Scope
CurrentUser’.
Type "y" for yes and press ‘Enter’ to confirm the change.
27
To confirm that the execution policy has been changed, type and run the ‘Get-
ExecutionPolicy -List’ command.
1.2.1 Cordova
To use this framework, first create a folder in the documents directory, the folder
must have a publication folder, and a test folder.
28
Open the Test Folder in Visual Studio Code
Open the terminal and execute the ‘npm install -g cordova’ command.
Create a blank Cordova project using the command-line tool. Navigate to the
directory where you wish to create your project and type ‘cordova create MyApp.’
After creating a Cordova project, navigate to the project directory with ‘cd MyApp’.
Add the browser platform and android platform with ‘cordova platform add
{platform}.’
29
1.2.2 Bootstrap
1.2.3 Jquery
jQuery is a fast, small, and feature-rich JavaScript library. It makes things like
HTML document traversal and manipulation, event handling, animation, and Ajax
much simpler with an easy-to-use API that works across a multitude of browsers.
(Jquery, n.d.)
30
2 Project Setup
Thanks to all the installation and the correct configuration of each of the
resources, the project can begin to structure.
Open the index file in ‘www’ folder and disable the Content Security Policy by
commenting out the corresponding line to prevent exceptions.
Implement the MVC architecture for better organization, ensuring that only files
in the "www" folder are included in the final project. Follow the recommended
folder structure for a clean organization.
31
Update file references in the "index.html" file after moving the "js," "css," and
"img" folders.
Run the Cordova application using the command "cordova run browser" in the
terminal to test the application in the default browser.
32
3 Extra: JavaScript Exercises
3.1 JS Variables
3.1.1 Exercise 1
3.1.2 Exercise 2
let x = 50
3.1.3 Exercise 3
let x = 5;
let y = 10;
document.getElementById("demo").innerHTML = x + y;
33
3.1.4 Exercise 4
Create a variable called z, assign x + y to it, and display the result in an alert box.
let x = 5;
let y = 10;
let z = x + y;
alert(z);
3.1.5 Exercise 5
On one single line, declare three variables with the following names and values:
firstName = "John"
lastName = "Doe"
age = 35
3.2 JS Operators
3.2.1 Exercise 1:
alert(10 * 5);
3.2.2 Exercise 2:
34
Divide 10 by 2, and alert the result:
alert(10 / 2);
3.2.3 Exercise 3:
alert(15 % 9);
3.2.4 Exercise 4:
Use the correct assignment operator that will result in x being 15 (same as x = x
+ y).
x = 10;
y = 5;
x += y;
3.2.5 Exercise 5:
Use the correct assignment operator that will result in x being 50 (same as x = x
* y).
x = 10;
y = 5;
x *= y;
35
3.3.1 Exercise 1:
Use comments to describe the correct data type of the following variables:
3.4 JS Functions
3.4.1 Exercise 1:
function myFunction() {
alert("Hello World!");
}
myFunction;
3.4.2 Exercise 2:
function myFunction {
alert("Hello World!");
}
36
3.4.3 Exercise 3:
function myFunction() {
return "Hello";
}
document.getElementById("demo").innerHTML = myFunction();
3.4.4 Exercise 4:
Make the function display "Hello" in the inner HTML of an element with the ID
"demo".
function myFunction() {
document.getElementById("demo").innerHTML = "Hello";
}
3.5 JS Objects
3.5.1 Exercise 1:
const person = {
firstName: "John",
lastName: "Doe"
};
37
alert(person.firstName);
3.5.2 Exercise 2:
Add the following property and value to the person object: country: Norway.
const person = {
firstName: "John",
lastName: "Doe",
country: "Norway"
};
3.5.3 Exercise 3:
const person = {
name: "John", age: 50
};
alert(person.name + " is " + person.age);
38