#Hello World

Watch out! This tutorial is over 2 years old. Please keep this in mind as some code snippets provided may no longer work or need modification to work on current systems.

Before you start writing your first example using Android SDK, you have to make sure that you have set-up your Android development environment properly. We also assume that you have a little bit working knowledge with Android Studio from class.

So let us proceed to write a simple Android Application which will print “Hello World!”.

Watch out! This tutorial is over 2 years old. Please keep this in mind as some code snippets provided may no longer work or need modification to work on current systems.

You create a file and put special character sequences called HTML elements into your file. These elements identify the structural parts of your document. When a Web browser displays the file, it will display your file’s content, but not the characters that make up the structure.

Here is an example:

Default

1

2

3

4

5

6

7

8

9

10

11

12

<!DOCTYPE html PUBLIC"-//IETF//DTD HTML 2.0//EN">

<HTML>

<HEAD>

<TITLE>

ASmall Hello

</TITLE>

</HEAD>

<BODY>

<H1>Hi</H1>

<P>Thisisvery minimal"hello world"HTML document.</P>

</BODY>

</HTML>

Only the elements that you place in the BODY element (that is, between <BODY> and </BODY> ) ever get displayed in a Web browser’s window.

In this example, only the contents of the H1 element (between <H1> and </H1> ) and the P element (between <P> and </P> ) are displayed.

Note:PowerShell commands also have the ability to be run in a script with the .ps1 extension but running scripts are disabled by default for security purposes. Firstly, you will need to set the Execution Policy. The cmdlet Get-ExecutionPolicy will show you that the initial policy is set to ‘Restricted’. This will prevent scripts from running. You can change it with the Set-ExecutionPolicy cmdlet. There are four options Restricted, Remote-signed, Signed and Unrestricted. We recommend Remote-Signed as it will allow you to run the scripts that you have created locally and still keep your machine secure.

So, just type

Shell

1

Set-ExecutionPolicy RemoteSigned

Now you can use notepad to create your first script. In Notepad type:

Visual Basic .NET

1

Write-Host"Hello World"

This will need to be saved in a file called something like HelloWorld.ps1.