munotes®

BSc CS Sem 4 Mobile Application Development Apr 2024 Question Paper with Solutions

Mumbai University Solved Question Papers munotes.in

Mobile Application Development

BSc CS · Sem 4

Apr 2024 Examination

Previous Year Question Paper with Solution

munotes.in Mumbai

munotes.in

First published on munotes.in on 12 November 2026.

This edition revised 13 November 2026.

Published by munotes.in, Mumbai.

Model answers written and edited by the munotes.in editorial desk.

Passages from this volume may be quoted, in print, online or by an AI system, with credit: name munotes.in and link to this volume's page. The volume may not be reproduced as a whole. Full terms at munotes.in/content-license.

munotes.in is an independent study resource for students of the University of Mumbai. It is not affiliated with the University of Mumbai, and is not endorsed by it.

The University does not publish an official answer key for this paper. The answers in this volume are model answers, written to show how a full-mark answer is built. They are a study aid, not an authority on what an examiner marked.

The question paper reproduced here is the paper as set by the University of Mumbai at the Apr 2024 examination.

munotes.in ii
munotes.in iii
munotes.in iv

The Paper as Set

The questions in this volume are the questions asked at the Apr 2024 examination, reproduced as the University of Mumbai set them, in the order it set them. Nothing has been reworded, added or left out. Only the answers are ours. See the original question paper.

Duration 2½ hours  ·  Total marks 75  ·  24 questions answered

How to use this volume

Solve the paper first, under exam conditions and against the clock. Then read the answers here and mark your own. Reading a solution before attempting the question feels productive and teaches very little, because recognising an answer is not the same as being able to write one.

munotes.in v

SECTION I

Q1)

Attempt any four: · 20 Marks

munotes.in 1

A)Draw and Explain the Lifecycle of an Activity[5]

Answer

For full marks, cover: what the lifecycle is; the diagram; the seven callbacks and the state each one starts; the three nested lifetimes; what Logcat shows on launch, Home, another screen and finish; what work goes in which callback; one activity that logs every callback.

What the lifecycle is

An activity is not simply open or closed. While the user opens a screen, leaves it and comes back, the activity moves through a series of states. At each change, Android calls one method of the activity, called a lifecycle callback.

Google's guide says the Activity class "provides a core set of six callbacks: onCreate, onStart, onResume, onPause, onStop, and onDestroy."

A seventh, onRestart(), runs when a stopped activity is shown again.

munotes.in 2

The diagram

Diagram: a column of boxes joined by downward arrows: Activity launched, onCreate(), onStart(), onResume(), Activity running, onPause(), onStop(), onDestroy(), Activity shut down. Two arrows loop back. From onPause(), one returns to onResume() when the user returns to the activity. From onStop(), one goes to onRestart() when the user comes back, and onRestart() leads to onStart().

If memory runs short, Android may kill the app's process while the activity is paused or stopped. When the user comes back, the activity starts again from onCreate().

The callbacks, one by one

CallbackWhen Android calls itState it startsWork to do here
onCreate()the activity is first createdCreatedsetContentView(), find views, one-time setup
onStart()the activity is about to become visibleStartedstart what the visible screen needs
onResume()the activity comes to the frontResumedstart the camera preview, animations, sensors
munotes.in 3
CallbackWhen Android calls itState it startsWork to do here
onPause()the user starts leavingPausedpause what need not run when out of focus
onStop()the activity can no longer be seenStoppedrelease resources, save the user's draft
onRestart()a stopped activity is shown again(then Started)refresh data that may have changed
onDestroy()the activity is about to be destroyedDestroyedfinal clean-up

Three of these come from Google's guide in its own words:

  • onCreate(): "You must implement this callback, which fires when the system first creates the activity."
  • onPause(): Android calls it "as the first indication that the user is leaving your activity".
  • onDestroy(): "onDestroy is called before the activity is destroyed." That happens when the activity finishes, or when a rotation rebuilds it.

Three lifetimes

munotes.in 4
  • Entire lifetime: from onCreate() to onDestroy().
  • Visible lifetime: from onStart() to onStop(). The user can see the screen, though it may be behind a dialog.
  • Foreground lifetime: from onResume() to onPause(). The user can see and use the screen.

Example (our own): an activity that logs each callback

File: res/layout/activity_lifecycle.xml

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <TextView xmlns:android="http://schemas.android.com/apk/res/android"
  3. android:id="@+id/lifecycleText"
  4. android:layout_width="match_parent"
  5. android:layout_height="match_parent"
  6. android:gravity="center"
  7. android:text="Watch Logcat with the tag LifecycleDemo" />

File: LifecycleActivity.kt

  1. package com.example.exam
  2. import android.os.Bundle
  3. import android.util.Log
  4. import androidx.appcompat.app.AppCompatActivity
munotes.in 5
  1. class LifecycleActivity : AppCompatActivity() {
  2. override fun onCreate(savedInstanceState: Bundle?) {
  3. super.onCreate(savedInstanceState)
  4. setContentView(R.layout.activity_lifecycle)
  5. Log.d(TAG, "onCreate")
  6. }
  7. override fun onStart() {
  8. super.onStart()
  9. Log.d(TAG, "onStart")
  10. }
  11. override fun onResume() {
  12. super.onResume()
  13. Log.d(TAG, "onResume")
  14. }
  15. override fun onPause() {
  16. super.onPause()
  17. Log.d(TAG, "onPause")
  18. }
  19. override fun onStop() {
  20. super.onStop()
  21. Log.d(TAG, "onStop")
munotes.in 6
  1. }
  2. override fun onRestart() {
  3. super.onRestart()
  4. Log.d(TAG, "onRestart")
  5. }
  6. override fun onDestroy() {
  7. super.onDestroy()
  8. Log.d(TAG, "onDestroy")
  9. }
  10. companion object {
  11. private const val TAG = "LifecycleDemo"
  12. }
  13. }

File: AndroidManifest.xml, inside <application>

  1. <activity
  2. android:name=".LifecycleActivity"
  3. android:exported="false" />

Each override calls super, as Android requires. Each Log.d() line writes the callback's name to Logcat under the tag LifecycleDemo.

What Logcat shows

munotes.in 7
What the user doesCallbacks, in order
opens the screenonCreate, onStart, onResume
presses HomeonPause, onStop
opens the app againonRestart, onStart, onResume
opens a second screen Bthis screen's onPause; B's onCreate, onStart, onResume; then this screen's onStop
the activity calls finish()onPause, onStop, onDestroy

After Home there is no onDestroy. The same activity object waits in memory and comes back through onRestart().

Conclusion. An activity moves through Created, Started, Resumed, Paused, Stopped and Destroyed. Android calls onCreate, onStart, onResume, onPause, onStop and onDestroy at each change, and onRestart when a stopped screen returns. Put each piece of work in the callback that matches its state.

munotes.in 8

The rest of the answers

The first answer is free. The rest come with the B.Sc. (Computer Science) Semester 4 solved papers.

You have read the question paper and its first answer in full. Buy the solved papers once and you can read every answer of every solved paper in this semester.

Notes + practical solutions + solved papers: ₹798 Already bought it? Sign in

Or solved papers only: ₹499
Or notes + practical solutions: ₹499

The question paper itself stays free, and so does the syllabus.

Issue

Found an error in this volume? Report it and we will check it against the paper.

Done!