Mobile Computing, Past Papers, UOS Main Campus

Mobile Computing Past Paper 2016 (Paper A) – MSc IT 4th Term UOS (IT-4545)

ProgramMSc IT
Term4th
Year2016
Course codeIT-4545
AnswersSolved ✓

University of Sargodha Mobile Computing (IT-4545) paper for MSc IT 4th term, 2016 exam (80 marks, 2:30 hours). This is one of two different 2016 Mobile Computing papers on this site. The full paper is below, followed by solved answers for every question.

University of Sargodha
M. Sc. 4th Term Exam 2016
Subject: I.T
Paper: Mobile Computing (IT-4545)
Maximum Marks: 80
Time Allowed: 2:30 Hour

Objective Part (Compulsory)

Q.No.1. Write short answer of following questions in 2–4 lines only. (16*2)

i. Define JSON, for what it stands?
ii. What is Mock-up Designs?
iii. Name any two application areas of QR codes?
iv. Why is mobile development difficult?
v. What are Android Broadcast Receivers?
vi. Write any two advantages of web services?
vii. What is Announcement Panel?
viii. What are Linear Data Structures?
ix. What is the difference between Static and Dynamic DLLs?
x. In threads what is meant by message passing technique?
xi. Draw a sequence diagram of the sequence of events in between pressing a key on the keyboard to displaying it on display screen?
xii. What is Over-the-Air Blackberry distribution method?
xiii. What is a Linear Layout?
xiv. What is Accelerometer?
xv. Name the tools needed to create mobile applications on blackberry?
xvi. What is ECOM Component Model?

Subjective Part (4*12)

Q.No.2 What are the strategies for allocating variables to memory?

Q.No.3 Discuss all the Web Services Languages and their sub formats?

Q.No.4 Describe in detail model-view-controller (MVC) technique for composing applications?

Q.No.5 Briefly explain Design Patterns for Networking Environment?

Q.No.6 Discuss any four basic android UI elements with code?

Q.No.7 Describe five principles of understanding mobile users with necessary diagrams?

Solved answers

Q1 – Short answers (16 × 2)

i. Define JSON, what does it stand for? JSON stands for JavaScript Object Notation. It is a light-weight text format for storing and exchanging data as name/value pairs, e.g. {"id":5,"city":"Sargodha"}. Mobile apps use it to talk to web services.

ii. What are mock-up designs? Static, realistic pictures of the app’s screens (layout, colours, icons, text) prepared before coding, to show how the app will look and to collect feedback.

iii. Two application areas of QR codes: (1) mobile payments (e.g. scanning a shop’s QR to pay through a wallet app); (2) opening a website or app download link from posters/product packaging. Others: e-tickets and boarding passes, attendance, product tracking.

iv. Why is mobile development difficult? Many platforms and OS versions, many screen sizes, limited memory, CPU and battery, unreliable network, small input methods, frequent OS updates, strict app-store rules and high security/privacy needs.

v. What are Android Broadcast Receivers? A component (BroadcastReceiver) that listens for system-wide or app broadcasts – e.g. battery low, SMS received, boot completed, network changed – and runs onReceive() when such an Intent is broadcast.

vi. Two advantages of web services: (1) Interoperability – apps written in any language on any platform can use them over HTTP; (2) Reusability – one server service can be used by Android, iOS and web clients alike.

vii. What is an annunciator panel? The status bar area at the top of a mobile screen that shows small indicator icons – signal strength, battery, time, Wi-Fi, new message, alarm. It “announces” the device status to the user.

viii. What are linear data structures? Data structures whose elements are arranged one after another in a sequence, each having one predecessor and one successor: arrays, linked lists, stacks and queues.

ix. Static vs dynamic DLLs: A statically linked library is copied into the executable at build time (bigger file, no external dependency). A dynamic link library is loaded at run time and can be shared by several programs (smaller app, can be updated separately, but must be present on the device). Dynamic DLLs can be loaded at start-up (implicit) or on demand (explicit).

x. Message passing in threads: Threads communicate by sending messages to each other’s message queue instead of sharing variables. The receiving thread processes messages one by one (e.g. Android Handler/Looper, Symbian active objects), which avoids race conditions and the need for locks.

xi. Sequence of events from key press to display: User → Keypad hardware (key pressed, interrupt raised) → Keyboard driver (reads scan code) → OS / window server (converts to key event, sends to the focused application) → Application event handler (updates text buffer) → Graphics/display driver (redraws) → Screen shows the character. In a sequence diagram these objects are drawn left to right, with arrows in this order.

xii. Over-the-air (OTA) BlackBerry distribution: Installing a BlackBerry app directly on the phone through a wireless download link: the user opens a URL to the .jad descriptor file in the browser, which then downloads and installs the .cod files – no USB cable or desktop software needed.

xiii. What is a LinearLayout? An Android layout (ViewGroup) that places its child views in a single row (android:orientation="horizontal") or single column (vertical). layout_weight divides remaining space between children.

xiv. What is an accelerometer? A motion sensor that measures acceleration along X, Y and Z axes; used for screen rotation, shake detection, games and step counting.

xv. Tools to create BlackBerry applications: Java Development Environment (BlackBerry JDE) or BlackBerry plug-in for Eclipse, BlackBerry Java SDK, BlackBerry Smartphone Simulator, and BlackBerry Desktop Manager / signing keys for deployment.

xvi. What is the ECOM component model? ECOM (Symbian OS’s plug-in framework, similar to Microsoft COM) lets an application find and load plug-in DLLs at run time through interfaces, using a unique ID (UID) for each implementation. It allows new functionality to be added without changing the main application.

Q2 – Strategies for allocating variables to memory (12)

1. Static allocation: memory reserved when the program is loaded and kept until it ends (globals, static variables, constants). Fast and predictable, no fragmentation, but memory is occupied even when unused and size must be fixed in advance.

2. Stack (automatic) allocation: local variables and parameters are created on the call stack when a function starts and removed when it returns. Very fast and freed automatically, but the stack on mobile devices is small and data cannot outlive the function.

3. Heap (dynamic) allocation: memory requested at run time with new/malloc and released with delete/free or by garbage collection. Flexible size and lifetime, but slower and can cause leaks and fragmentation.

On mobile devices with little RAM the developer should prefer stack/static data for small fixed items, reuse objects instead of creating many short-lived ones, free large objects (images) early, and use cleanup mechanisms (e.g. Symbian cleanup stack) so memory is released even when an error occurs.

Q3 – Web services languages and their sub-formats (12)

  • XML (eXtensible Markup Language) – the base language for data in SOAP web services. Sub-formats: XML Schema (XSD) to define structure and types, XSLT to transform documents, XPath to select nodes.
  • SOAP (Simple Object Access Protocol) – XML-based message format. A SOAP message has an Envelope, optional Header, a Body and a Fault element for errors; it is sent over HTTP/SMTP.
  • WSDL (Web Services Description Language) – XML document that describes a service: types, messages, portType (operations), binding, port and service (address).
  • UDDI (Universal Description, Discovery and Integration) – registry for publishing and finding web services; entries use white pages (business info), yellow pages (categories) and green pages (technical details).
  • REST with JSON – light-weight style using HTTP methods (GET, POST, PUT, DELETE) on URLs; data usually in JSON (objects and arrays) or XML. Preferred for mobile because messages are small.

Q4 – MVC technique for composing applications (12)

MVC splits an application into Model (data and business logic), View (screens that display data) and Controller (handles user input and connects model and view).

Working: the user acts on the View → the Controller receives the event → it updates the Model → the Model notifies of the change → the View redraws with the new data.

Mobile example: in Android the XML layout is the View, the Activity/Fragment acts as Controller and classes such as Student with a database helper form the Model. In iOS: Storyboard (View), UIViewController (Controller), data classes (Model).

Advantages: separation of concerns, easier maintenance and testing, reuse of the same model with different views (phone/tablet), and team members can work in parallel. Limitation: more classes; controllers can become too large, so MVP/MVVM variants are also used.

Q5 – Design patterns for networking environment (12)

  • Asynchronous request / callback: network calls run on a background thread and the result is returned through a callback, so the UI never freezes (Android AsyncTask/Executors, iOS completion handlers).
  • Proxy: a local object stands in for a remote service; the app calls the proxy, which handles connection, retries and data conversion.
  • Observer / publish–subscribe: components register for network events (data arrived, connection lost) and are notified automatically; push notifications follow this idea.
  • Caching (cache-aside): keep recently fetched data locally to reduce traffic, save battery and work offline.
  • Client–server and request–response: the mobile client sends a request, the server processes it and returns a response; keeps heavy work on the server.
  • Batching / queue-and-retry: collect several small requests and send them together, and queue requests when offline to send later.

Q6 – Four basic Android UI elements with code (12)

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:padding="16dp">

    <TextView android:id="@+id/tvTitle"
        android:layout_width="wrap_content" android:layout_height="wrap_content"
        android:text="Login" android:textSize="22sp" />

    <EditText android:id="@+id/etEmail"
        android:layout_width="match_parent" android:layout_height="wrap_content"
        android:hint="Email" android:inputType="textEmailAddress" />

    <CheckBox android:id="@+id/cbRemember"
        android:layout_width="wrap_content" android:layout_height="wrap_content"
        android:text="Remember me" />

    <Button android:id="@+id/btnLogin"
        android:layout_width="match_parent" android:layout_height="wrap_content"
        android:text="Login" />
</LinearLayout>
Button btn = findViewById(R.id.btnLogin);
EditText email = findViewById(R.id.etEmail);
btn.setOnClickListener(v ->
    Toast.makeText(this, "Hello " + email.getText(), Toast.LENGTH_SHORT).show());

TextView shows text; EditText takes input; CheckBox gives an on/off choice; Button performs an action on click.

Q7 – Five principles of understanding mobile users (12)

  1. Users are on the move and distracted – sessions are short, so the main task must be reachable in one or two taps.
  2. Small screen, fingers not mouse – large touch targets, one-column layouts, thumb-friendly placement of buttons.
  3. Context matters – location, time, light and connectivity change; use GPS and sensors to give relevant content and handle poor networks.
  4. Users expect speed and simplicity – fast start-up, minimal typing (auto-fill, pickers), clear feedback for every action.
  5. Personal device, privacy and trust – ask only needed permissions, protect data, and respect battery and data costs.

Diagram idea: draw the user at the centre with five arrows to Mobility, Screen & Touch, Context, Speed, and Privacy.

Save this paper for offline studyDownload the question paper, or save the paper together with all solved answers as a PDF.
↓ Download Paper (JPG)

About Saif R

An educator and technology enthusiast passionate about empowering students through quality education and digital learning. Dedicated to making academic resources and opportunities accessible to everyone.