Saturday, October 24, 2015

Developing HTML in Android using Terminal IDE

Using Terminal IDE
In Android systems, Terminal IDE is installed through Google’s play store. After installation, when you launch the application, there are 6 button; Terminal IDE, Keyboard, Install System, options, shutdown and Help. First get acquitted with the help system. Most of the information you need you will find it here. I recommend reading the vim section since you will be spending much time in the vim editor and being acquitted with vim commands is essential.
STEP 1: Click on Terminal IDE
When you click on the Terminal IDE button, you will see a console or the terminal, which will look likes, the below:

Terminal++@105.54.187:~$

By default, terminal IDE comes with 4 terminals. These can be accessed by swiping through the windows. You will notice a black pop-up showing the terminal you are on, one through four.
Step 2: Creating and running HTML
(a)    Creating the directory
Swipe to terminal 1. After the dollar sign ($), type:

$cd ~/sdcard/

It will simply change from the current directory to the sdcard storage. cd is a command to change the working directory. Next, we create a folder where you will store you html code:

$mkdir /progs/
$cd ~/sdcard/progs/

mkdir is a make directory command. In this case, it creates a folder in your sdcard called progs. cd changes the working directory to progs. Make sure that at this point you are using Terminal IDE’s Keyboard. If not, click the back key, select the Keyboard, and set it to Terminal IDE. To go back simply hit the Terminal IDE button. If the keyboard does not appear in the terminal, tap the screen, it should appear. Your terminal should show as below:

:~/sdcard/progs$

This is your working directory. You can get the full path of the directory by typing:

$pwd

pwd is a simple Linux command to print the working directory.
(b)   Creating the files
The next part is to create 3 files: index.html, style.css, and script.js. To achieve this, we begin with the first file by typing the following command on terminal after the dollar sign ($):

$vim index.html

After you press enter, the screen should clear and you should see the vim editor. Press I key (as in India). The status bar at the bottom should now displays (-- INSERT --) in yellow, if not try going through the steps again.
 Now you are ready to type your html code. Type the code as below:

<!DOCTYPE html>
<html lang=en>
<head>
<link href=”style.css” rel=”stylesheet” >
</head>
<title>Test page</title>
<body>
<h1>This is a simple page</h1>
<script src=”script.js” type=”text/javascript”></script>
</body>
</html>

To save click on the escape button (ESC), then press the colon key (:) then w key, and q key and press enter.
To type the CSS code, on the terminal type:

$vim style.css

It will open a blank file in vim. press I key (the status bar should now show ---INSERT). Type the code below:

body {
                background-color:blue;
}

To save click on the escape button (ESC), then press the colon key (:) then w key, and q key and press enter.
Now we write the final file, on the terminal, type:

$vim script.js

On the vim editor, type:

Function myFunction () {
alert(“Javascript is working”);
}
myFunction();

(c)    Running on a browser
To run the html on a browser, open Google chrome. On the navigation bar, type:

file://sdcard/sdcard/index.html

You should see the output displayed on the browser window.

The above is just a simple version, you can create more complex code with Terminal IDE.

CICT past paper Operating System (practicals)

KASNEB
CICT PART 1 SECTION 2
OPERATING SYSTEMS (PRACTICALS)
Wednesday: 30th May 2012
QUESTION ONE
Create a word document named “Question one”. Use the word processor document to save the screenshots created in question (a), (b) and (c) below:
(a)    Ensure there are two user accounts in the computer you are using and that each user account has two running programs. (4 marks).
(b)   Display the processes from all the users (including the two user created in (a) above) showing the following attributes:
(i)                 Image name. (2marks)
(ii)               Process identifier (PID) (2marks)
(iii)             User name (2marks)
(iv)             Session ID (2marks)
Capture and save a screenshot containing the above details.
(c)    (i) Create a schedule task named “open web page” (2marks)
(ii) Configure the task in (c) (i) above to run the Internet Explorer program file after every 3 days at 8:00 a.m. (2marks)
(iii) Configure the scheduled task in (C) (i) above to run only if the user is logged on (2mks)
(v)               Configure the scheduled task in (c) (i) above to stop if it runs unattended for 60 minutes. (2marks).
Capture and save a framed screenshot of the above settings.
Print “Question One” document
(Total: 20marks)
QUESTION TWO
You have been employed as a system administrator of a company running 100 computers on a local area network. On your initial analysis of the computer systems, you realize that the company does not have a standard policy on power saving, security and registry setting among others.
Required:
Create a word processor document named “Question Two”. Use the word processor document to save screenshots that you would capture as you standardize the settings of the computer system in the above company according to the specification in questions (a), (b), and (c) below:
(a)    Save power by configuring the computer system to:
(i)                 Turn off the monitor after 10 idle minutes (2marks)
(ii)               Turn off the hard disk after 30 minutes (2marks)
(iii)             Standby after 20 idle minutes (2marks)
(iv)             Enable hibernation (2marks)
(b)   (i) To display a list of registry permission that could be granted to users of registry information (2marks)
(ii) To configure the following permissions for the system’s root classes information:
·         Power users: allow access but no modification of the registry information
·         Guest users: deny both access and modification (2marks)
(c)    (i) Change locale to “Uganda”  (2marks)
(ii) Configure the input language for the keyboard to be “English-United Kingdom” (2marks)
(iii) Set the digital grouping of threes, running from the right and separated by a comma (,) (2marks)
(v)               Configure the currency symbol to be “sh”

Resize the screenshots in the word processor document “Question Two”, in order to fir not more than two pages of an A4 size printing paper. Print document 

Friday, October 23, 2015

Programming ANDROID, JAVA, HTML, CSS, JAVASCRIPT, C and C++ in Android with terminal IDE



The introduction of smartphone has revolutionized everything, with every passing day people are relying more and more on apps to organize their lives. The advantage to this is that there is diverse applications that will cater for your every need and if not the case, your needs can be catered with little customization. The other benefit of smartphones is their ability to back-up all you documents, setting, contacts, and application via cloud. Unlike earlier days when losing a phone meant starting from scratch searching for contacts, and downloading application, nowadays, it is much simpler. If you accidentally lose your phone, in case of an Android phone, all your data will be restored as per your original phone thanks to dynamic cloud storage.
I favor android over all the other phone operating systems. The main reason being that Android is open source unlike its counterpart windows and Apple iPhone and iPad operating systems. You can download the source code, tweak it to your preference, and have your personal customized Android OS. There is also the ability get the latest Android release by building Android from source (“The Android Source Code”, 2015).
Since Android is a fully featured OS, it would be incomplete without the inclusion of developer tools. Google app store has hundreds of integrated developing environment (IDE) applications. Most of these apps are for purchase, but also come with free versions that have limited capabilities. For example, most of the free developer apps do not provide the save feature, or do not provide code highlighting features. If one needs these features enabled, they must pay a certain fee.  

TERMINAL IDE
Terminal IDE is an IDE that runs on terminal. Spartacus Rex develops it and according to their website; Terminal IDE is a fully featured java and android development environment. According to Chris Duckett 2012, Terminal IDE is a developer version of the Swiss army knife. As a developing environment, you will notice that Terminal IDE surpasses you normal IDE. It comes integrated with fully collection set of different language support. You can create website in HTML, CSS, and JAVASCRIPT and test it directly with your phone browser. Also you can develop java, Android and C application with minimal difficulties. Terminal IDE also partly supports C++, but your code is unlikely to break apart from large projects.
The downside to Terminal IDE is that it lacks advanced features that one would expect in a normal IDE. Functionality like code highlighting, auto completion, and intelisense features are not included. The IDE runs on terminal, code writing is done by VIM editor, a Linux based editor. Terminal IDE is not designed for people new to programming. Beginners can find the app a little challenging; though Terminal IDE Help section will get you going.


BENEFITS
Terminal IDE comes with command line tools like nano, vim, gcc, javac among others for development. Nano and vim are for editing source code while gcc and javac are for compiling written source code.
Terminal IDE can both be used offline and online thanks to Git, a version control system. The integration of Git in your projects will enable you to download, share, create, branch, and destroy repositories, locally or online over GitHub. 
Terminal IDE comes with its own full keyboard, optimized for programming. The keyboard is accessed by going to android phone setting, language and input under keyboard and input methods. The option of adding external keyboard using Bluetooth is also possible. 

Disadvantages
Terminal IDE runs on user instance, since each Android application gets its own group and user id. This may result in some restrictions and limitations (“GarageLab, 2013).

References
The Android Source Code. (2015, October 23). Retrieved from https://source.android.com/source/initializing.html
Duckett, C. (2012). Programming for Android on Android. Retrieved from http://www.techrepublic.com/blog/australian-technology/programming-for-android-on-android/
GarageLab. (2013). Development Environment for Android. Retrieved from http://thegaragelab.com/development-environment-for-android/

Tuesday, October 20, 2015

Handling IT projects part II


This is a sample version of a cict project proposal. It is aimed at providing the learner with basic knowledge of writing a proposal. This is the second part of the series of handling IT projects. It is important to note that according to kasneb regulations, a project proposal should not exceed 1000 words 

CICT Project proposal Example

MOVIES HELPER RETAIL APPLICATION

1.1  How the current systems works

The current system of movie retail works on use of pictures and list. Movie venders have booklets with pictures of the movies. The customer chooses from the list and requests the order. At times, the customers verbally inquires if a certain movie is in store makes payment.

Inputs and outputs

Inputs

1.      Movie Inquiry

2.      Movie order

Outputs

1.      Processing order

2.      Final product

What the users would want the new system to do

One of the major obstacle in movie retail business is queuing. Customers waste a lot of time waiting for their requested movie to be burned into a dvd disk. Customers want this process to be quickened.

            The other issue is that movies mostly come without description on what the movie is all

about. Customers have to rely on the description given to them by the vender, which at most is

not reliable. Customers want a system that will provide details about the movie, who are the actors

and a list of related movies.

Movie venders do not provide rating for movies. Also, there are no reviews on the movie so that

the customer can make informed decision on which movie to purchase. Creating a system that will

be able to provide rating for movies and reviews from other customers will be a benefit to the

customer.

Frequent customers also need discounts, credit facilities and other incentives.

 

1.2

(i) Parts possible for a computer solution

The new system will reduce this queuing time by allowing customers to process their own orders by sending information. When their order has been processed, customers will receive a notification to come receive their orders. Also, the system will notify users on new movies that are available in the store. It will also provide a brief description of the movie, ratings of the movies and reviews from other customers who have watched the movie. The customer will also be able to write reviews and rate movies. In addition, the new system will automatically give discounts and gift coupons on for customers and provide credit to loyal customers.

(ii) Requirement of computer solution

            For the application to work, it will need access to the internet. This is important, as customers will be able to receive updates and send orders regardless of their location. The application also needs a web server to process user’s orders and provide information.

(iii) Algorithms for the computer solution

            Web application

(i)                 Provide information on movies on the store

(ii)               Process user search query on a movie

(iii)             Return user’s searched query with:

(a)    Movie title, about the movie, genre, and actors

(b)   Reviews from other users

(c)    Other similar movies

(iv)             Process users product request:

(a)    The request is processed using the list of users in the database if the user is new; he/she is requested to provide his/her details.

(b)   Based on the number of orders, the user is liable for a discount

(c)    Based on order frequency the customer is liable for credit, free gift coupon or both.

(v)               The user is alerted when the order request is done.

 

Desktop application

This application will run on the client in the movie store

(i)                 Receive order from client

(ii)               Alert the vender on the customer order

(iii)             Return message to the customer that order is received

(iv)             Alert customer when order is done