Blog
Mobile Computing Past Paper 2015 – MSc IT 4th Term UOS (IT-4545)
University of Sargodha Mobile Computing (IT-4545) paper for MSc IT 4th term, 2015 annual exam (80 marks, 2:30 hours). The full paper is below, followed by solved answers for all 16 short questions and all six long questions.
University of Sargodha
M. Sc. 4th Term Exam 2015
Subject: I.T
Paper: Mobile Computing (IT-4545)
Maximum Marks: 80
Time Allowed: 2:30 Hour
Objective Part (Compulsory)
Q.1 Note: Attempt all questions each question carry equal marks? (16 × 2 = 32)
i. What is JSON?
ii. Write names of software needed for development on window phone.
iii. Write three names of third-party frameworks for mobile development.
iv. What is QR codes?
v. What is a web service?
vi. What is a port?
vii. What is BlackBerry?
viii. What are Emulators?
ix. What are Mock-up Designs?
x. What is xCode?
xi. What is Accelerometer?
xii. What is Event-Based Programming?
xiii. What is Role-based Security?
xiv. What is SMS?
xv. What is Energy Management?
xvi. What are Android Activities?
Subjective Part (12 × 4)
Q.2 What are the benefits of a Mobile App? Write in detail.
Q.3 Discuss any two strategies of allocating variables to memory.
Q.4 Describe in detail model-view-controller (MVC) technique for composing applications.
Q.5 Describe any two mobile platforms with their interface tips and accessibility?
Q.6 Describe any three android UI elements with XML specifics?
Q.7 Write in detail three Apple devices.
Solved answers
Q1 – Short answers (16 × 2)
i. What is JSON? JSON (JavaScript Object Notation) is a light-weight, text-based format for exchanging data. Data is written as name/value pairs inside { } and lists inside [ ], e.g. {"name":"Ali","marks":72}. Mobile apps use it to send and receive data from web services because it is smaller and faster to parse than XML.
ii. Software needed for Windows Phone development: Microsoft Visual Studio (with the Windows Phone SDK), the Windows Phone Emulator, and Expression Blend for designing the XAML user interface. A Windows PC is required.
iii. Three third-party frameworks: PhoneGap / Apache Cordova, Xamarin, and React Native (others: Flutter, Ionic, Titanium Appcelerator).
iv. What are QR codes? A QR (Quick Response) code is a two-dimensional barcode of black squares on a white grid. It can store a URL, text, contact or payment data, and a phone camera can read it instantly.
v. What is a web service? A web service is a software component on a server that other programs call over the internet using standard protocols (HTTP with SOAP/XML or REST/JSON). It lets a mobile app get or save data without knowing how the server is built.
vi. What is a port? A port is a numbered logical endpoint (0–65535) on a device that identifies a specific process or service, e.g. HTTP uses port 80 and HTTPS port 443. (In mobile development, “porting” also means moving an app to another platform.)
vii. What is BlackBerry? BlackBerry is a line of smartphones by Research In Motion (later BlackBerry Ltd.) known for secure push e-mail, a QWERTY keyboard and BlackBerry Messenger. Apps were written in Java ME and later for BlackBerry 10 OS.
viii. What are emulators? An emulator is software that imitates a real mobile device (hardware + OS) on a computer, so developers can run and test apps without the physical phone, e.g. Android Emulator, iOS Simulator.
ix. What are mock-up designs? A mock-up is a static, realistic visual model of the app’s screens (layout, colours, icons, text) made before coding. It shows how the app will look and helps get feedback early.
x. What is Xcode? Xcode is Apple’s integrated development environment (IDE) for macOS, used to build iOS, iPadOS and macOS apps in Swift or Objective-C. It includes an editor, Interface Builder, debugger and iOS Simulator.
xi. What is an accelerometer? A sensor in the phone that measures acceleration along the X, Y and Z axes. Apps use it to detect tilt, shaking, step counting and screen rotation.
xii. What is event-based programming? A style of programming in which the flow of the program is decided by events such as a button tap, key press, touch or incoming message. The program registers event handlers (listeners) that run when the event occurs.
xiii. What is role-based security? Access control in which permissions are given to roles (e.g. admin, user, guest) instead of individual users; a user gets the rights of the role assigned to him.
xiv. What is SMS? Short Message Service – a GSM service for sending text messages of up to 160 characters between mobile phones. Apps can send/receive SMS through the platform’s messaging API.
xv. What is energy management? Designing and running an app so that it uses as little battery as possible – e.g. turning off GPS and sensors when not needed, batching network calls, reducing screen wake-ups and background work.
xvi. What are Android activities? An Activity is a single screen with a user interface in an Android app (a subclass of Activity). An app usually has several activities; each has a lifecycle (onCreate, onStart, onResume, onPause, onStop, onDestroy).
Q2 – Benefits of a mobile app (12)
- Always with the user: the phone is carried everywhere, so the business is reachable 24/7.
- Faster and better user experience than a mobile website; data can be cached locally and the UI follows the platform’s native design.
- Offline use: many features keep working without an internet connection.
- Use of device features: camera, GPS, accelerometer, contacts, NFC, biometrics – e.g. scanning QR codes, location-based offers.
- Push notifications: direct, instant communication with customers (offers, reminders, alerts).
- Brand visibility and loyalty: the app icon on the home screen reminds users; loyalty points and personalisation keep them coming back.
- Personalisation: the app can remember preferences, location and history and show relevant content.
- New revenue: in-app purchases, subscriptions and ads; m-commerce sales.
- Customer data and analytics: usage data helps improve products and marketing.
- Competitive advantage and better customer service (chat, tracking, self-service).
Q3 – Strategies of allocating variables to memory (12)
Mobile devices have limited memory, so it matters where and when variables are allocated. The main strategies are:
1. Static allocation. Memory for the variable is reserved at compile/load time and stays for the whole life of the program (global and static variables, constants). Pros: no allocation cost at run time, address is fixed, no fragmentation. Cons: memory is held even when not needed, size must be known in advance, no recursion for static locals.
2. Stack (automatic) allocation. Local variables and parameters are pushed on the call stack when a function is called and removed automatically when it returns. Pros: very fast, freed automatically, good locality. Cons: small stack size on mobile devices, data lives only during the call, large arrays can cause stack overflow.
3. Heap (dynamic) allocation. Memory is requested at run time (new, malloc) and released explicitly (delete/free) or by a garbage collector (Java, Kotlin, Swift ARC). Pros: size decided at run time, objects can outlive the function. Cons: slower, fragmentation, memory leaks if not freed, GC pauses.
Design tips for mobile: prefer stack/linear data where possible, reuse objects (object pools) instead of repeated allocation, release large objects (bitmaps) early, and avoid keeping references that stop garbage collection.
Q4 – Model-View-Controller (MVC) (12)
MVC is an architectural pattern that divides an application into three connected parts so that data, user interface and control logic are kept separate.
- Model – the data and business rules (e.g. a
Studentclass, database or web-service access). It does not know how the data is displayed and notifies observers when data changes. - View – the user interface that displays model data (Android XML layouts, iOS storyboards). It sends user actions to the controller.
- Controller – receives input from the view, updates the model and selects which view to show (Android Activity/Fragment, iOS UIViewController).
Flow: user taps a button on the View → Controller handles the event → Controller updates the Model → Model changes → View is refreshed with new data.
Advantages: separation of concerns, easier testing and maintenance, parallel development (designer works on views, developer on model), same model can be reused with different views (phone, tablet). Disadvantages: more classes and complexity for small apps; on Android the Activity often becomes a “massive controller”, which is why MVP/MVVM are also used.
Q5 – Two mobile platforms, interface tips and accessibility (12)
1. Android (Google). Open-source, Linux-based OS used by many manufacturers; apps in Java/Kotlin with Android Studio; distributed through Google Play. Interface tips (Material Design): use standard components (app bar, floating action button, navigation drawer, bottom navigation), touch targets of at least 48 dp, support different screen sizes and densities (dp/sp units), use the Back button behaviour correctly. Accessibility: TalkBack screen reader, contentDescription for images, scalable text (sp), high-contrast colours, Switch Access and captions.
2. iOS (Apple). Closed OS for iPhone/iPad; apps in Swift/Objective-C with Xcode; distributed through the App Store. Interface tips (Human Interface Guidelines): clarity, deference and depth; navigation bars and tab bars; touch targets at least 44 × 44 points; respect safe areas and Dynamic Type. Accessibility: VoiceOver screen reader, accessibility labels and traits, Dynamic Type for large text, Reduce Motion, colour-inversion and Zoom.
Q6 – Three Android UI elements with XML (12)
1. TextView – shows read-only text.
<TextView
android:id="@+id/tvTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Welcome"
android:textSize="20sp" />2. EditText – lets the user type input.
<EditText
android:id="@+id/etName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Enter your name"
android:inputType="textPersonName" />3. Button – performs an action when tapped.
<Button
android:id="@+id/btnSubmit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Submit"
android:onClick="submit" />Key attributes: id (to find the view in Java with findViewById), layout_width/height (match_parent or wrap_content), text, hint, inputType and onClick. These elements are placed inside a layout such as LinearLayout or ConstraintLayout.
Q7 – Three Apple devices (12)
1. iPhone – Apple’s smartphone (first released 2007) running iOS. Multi-touch screen, App Store, cameras, Face ID/Touch ID, Siri, Apple Pay. Developers build apps for it with Xcode and Swift.
2. iPad – Apple’s tablet (2010) running iPadOS. Larger screen, Apple Pencil and keyboard support, split-view multitasking; used for education, drawing, reading and business. Apps must adapt to larger layouts.
3. Apple Watch – smartwatch (2015) running watchOS. Fitness and heart-rate tracking, notifications, Apple Pay, health sensors; apps are small and paired with the iPhone. (Other devices: iPod touch, Mac, Apple TV.)
