0% found this document useful (0 votes)
19 views2 pages

Mad 2024

The document contains a series of questions related to Android programming, including XML code for a login page, Java code for class inheritance, and a detailed description of Android application architecture. It also covers resource types, XML error correction, content URIs, fragment characteristics, and the Android Manifest. Additionally, it discusses the activity lifecycle, service callback methods, event-based programming, design patterns, user interface terms, security issues, data passing in sub-activities, and user interaction examples.

Uploaded by

gracejamu4
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)
19 views2 pages

Mad 2024

The document contains a series of questions related to Android programming, including XML code for a login page, Java code for class inheritance, and a detailed description of Android application architecture. It also covers resource types, XML error correction, content URIs, fragment characteristics, and the Android Manifest. Additionally, it discusses the activity lifecycle, service callback methods, event-based programming, design patterns, user interface terms, security issues, data passing in sub-activities, and user interaction examples.

Uploaded by

gracejamu4
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/ 2

QUESTION 1

a) Write the XML code to produce a login page with the following elements:

1. textfield - name
2. textfield - password
3. submit button
4. cancel button
[10]

b) Write Java code to show how the following classes are inherited from their main class in
Android programming:
i. Services. [2]
ii. Activity. [2]
iii. Broadcast receiver. [2]
iv. Content providers. [2]
v. Fragments. [2]

c) Describe Android application architecture in detail. [5]

QUESTION 2

a) Provide a brief description of the resource types of the following directories:


i. res/ [2]
ii. drawable/ [2]
iii. layout/ [2]
iv. anim/ [2]

b) Eliminate the errors in the following XML code:

xml
CopyEdit
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="opaque_red">#f00</color>
<string name="hello">Hello!</string>
</resources>

[3]

c) Define a content URI and give its correct format. [2]

d) State any two characteristics of a fragment. [4]

e) Write the Android Hello World program. [3]

f) The Manifest in Android handles essential information that the system needs to run it.
Discuss the various information handled by the AndroidManifest.xml. [5]
QUESTION 3

a) A mobile application activity goes through a life cycle. Using a diagram, explain the
callback methods of an activity life cycle. [10]

b) Provide a brief description for each of the following service callback methods:
i. onStart() [3]
ii. onBind() [3]
iii. onCreate() [3]
iv. onDestroy() [3]

c) Explain what you understand by APK in an Android application. [3]

QUESTION 4

a) Explain event-based programming. [4]

b) Discuss various design patterns for developing a mobile application. [6]

c) Explain the following terms in relation to Android user interfaces:


i. View
ii. Widgets
iii. Layouts
[6]

d) Write a code snippet in Java for a new Android application that has two buttons. The first
button when clicked takes the user to another activity. The second button when clicked takes
you to www.hit.ac.zw
[9]

QUESTION 5

a) Explain the security issues in mobile application development. [7]

b) Demonstrate with Java code, how you pass data in sub-activities. [4]

c) Explain how to interact with UI using a suitable example. [8]

d) Write a Java program that accepts user input from the keyboard and does the following
operations: sum, difference, division, and product. [6]

You might also like