0% found this document useful (0 votes)
228 views3 pages

Mobile Programming Past Paper 2020

The document provides instructions for a university examination on mobile programming. It contains three sections with multiple questions on topics like XML layouts, intents, activities and more. Students are required to write code snippets and explain concepts.

Uploaded by

Meshack
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
228 views3 pages

Mobile Programming Past Paper 2020

The document provides instructions for a university examination on mobile programming. It contains three sections with multiple questions on topics like XML layouts, intents, activities and more. Students are required to write code snippets and explain concepts.

Uploaded by

Meshack
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

UNIVERSITY EXAMINATIONS: 2019/ 2020

EXAMINATION FOR THE DEGREE OF BACHELOR OF SCIENCE IN


INFORMATION TECHNOLOGY/ BUSINESS INFORMATION
TECHNOLOGY
BIT 3209/ BBIT 311: MOBILE PROGRAMMING
DISTANCE LEARNING
DATE: MAY, 2020 TIME: 6 HOURS

INSTRUCTIONS: Answer ALL Questions

SECTION B:
QUESTION TWO (20 MARKS)

(a) The following figure shows a mobile user interface with one text field for writing a message and a
button for sending a message.

i. Write an XML code that displays the user interface illustrated in the above figure (4 Marks)
ii. Write java code that defines an event handler that prints a Toast message “ Message sent” when
the user press send button (3 Marks)

(b) Describe the meaning of the term intent in the context of mobile programming (2 Marks)

(c) Write a sample java code for creating and sending intent object (2 Marks)

(e) Briefly explain how you understand the following lines of code as used in mobile programming
(4 Marks)
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="welcome"
android:textColor="#000000"
android:background="#fcdd36"
/>
(f). Write an XML that displays the following output when executed in an emulator or real device
(5 Marks)

SECTION C:

QUESTION THREE (20 MARKS)

(a) Write XML or Java code that displays the following output of a mobile application (5Marks)

(b) Describe the process of compiling an android application. draw a well labeled diagram that
illustrates the process. (6 Marks).

(c) Briefly explain the following lines of java code as used in mobile programming (3 Marks)

EditText editTextProgramme;
EditText editDepartment;
editTextProgramme = (EditText) findViewById(R.id.edtprogramme);
editDepartment = (EditText) findViewById(R.id.edtdepartment);
String Prgname = editTextProgramme.getText().toString();
String Dptname = editDepartment.getText().toString();
(d) Explain the meaning of the following lines of code in the context of mobile programming
(6 Marks)
public class Lab2 extends Activity
{
public void onCreate(Bundle savedInstanceState)
{ super.onCreate(savedInstanceState);
TextView view = new TextView(this);
view.setText(“mobile programming \n");
setContentView(view);
}
}

You might also like