Mobile Programming Ecs 2205
Mobile Programming Ecs 2205
Instructions to Candidates:
You should have the following for this examination
- Answer Booklet
c) Identify at least 3 mobile operating systems available in the market currently. (3 marks)
f) List the stages a midlet goes through in its life cycle. (3 marks)
Question Two
a) Study the following code and answer the questions that follows:
Public class Helloworld extends MIDlet
Form helloForm;
command exitcommand; 2
1 Public Helloworld ( ) {
3 exitcommand = new command (“Exit”, command.EXIT, 1);
helloFORM = new Form (“Hello world”);
hellFORM .append (new string (“Hello world”);
helloFORM. addCommand (exit command);
}
Public void start App ( ) {
Display.get Display (this). set Current (helloform);
}
Public void pauseApp ( ) { }
Public void destroy App ( ) { }
}
(i) What name is given to the section of code marked 1?
What is the main role of this code? (3 marks)
(ii) Define declaration as used in programming giving examples from the code above.
(3 marks)
(iii) Identify the section of code marked 3 giving its role in the above code. (3 marks)
(iv) When this program is run, what is the likely output? (1 mark)
b) Differentiate between low level and high level user interface elements giving examples in each
case. (6 marks)
e) Explain the following classes: (4 marks)
(i) Canvas
© 2014 – Technical University of Mombasa Page 2
(ii) Alert
Question Three
a) Write a simple J2ME program that can be used to display login interface to a user. (10 marks)
b) Differentiate between Textfield and Text Box, given examples when each can be used in a J2ME
program. (4 marks)
c) List THREE Abstract method contained in a MIDlet class that are necessaryfor the MIDlet to
execute, explain the role of each identified method. (6 marks)
Question Four
Explain the following classes, clearly describing the main role in a program. (20 marks)
(i) Screen and Canvas
(ii) Image class
(iii) Date and Ticker class
(iv) Alert and string Item
Question Five
a) Define a database. (2 marks)