AD-703-B Mobile Application Development

Mobile Application Development (AD-703-B) Important Questions

RGPV · B.Tech · AI & Data Science · Semester 7 · Current scheme · 0 papers

  1. Read the answers

    Start with the topics that come every year.

  2. Revise unit notes

    Go through each unit once to score more.

Paperwala Imp Topics - Mobile Application Development important questions

Download Paperwala Imp Question & Answer (PDF)

Chosen from the syllabus. No past paper of this subject is on this site yet, so repeats could not be counted.

Mobile Application Development important questions with answers

Each answer starts with the short answer. Then come the points to write, a diagram and an exam tip. The topics are chosen from the syllabus.

Q1. Activity and its life cycle

From the syllabus · Unit 2

From the papers

  • “Unit 2: Activities, Android terminologies, application context.” (Syllabus)

The short answer

An activity is one screen of an app with its own user interface. Android moves it through a life cycle of callbacks such as onCreate, onStart, onResume, onPause, onStop and onDestroy.

Write these points

Callbacks in order

  1. onCreate: called once. Build the screen and set up data.
  2. onStart: the screen becomes visible.
  3. onResume: the screen is in front and the user can touch it.
  4. onPause: another screen is coming forward. Save light data here.
  5. onStop: the screen is hidden.
  6. onDestroy: the activity is removed from memory.
  • Between onStart and onStop the activity is visible. Between onResume and onPause it is in the foreground.
  • If the user comes back to a stopped activity, onRestart runs, then onStart.
  • A screen rotation destroys and recreates the activity unless the app handles it.

Call order for a rotation.

App open on screen A. User rotates the phone.

Calls: onPause, onStop, onDestroy, then onCreate, onStart, onResume.

Total 6 callbacks run. State saved in onSaveInstanceState can be restored in onCreate.

Remember. The callback names are standard Android terms. The code samples in this PDF were not compiled or run.

Real-life example

A shop assistant opens the shop in the morning, serves customers, steps aside when the owner arrives and closes at night. Each step has a fixed routine. An activity follows a fixed routine for each change in its state.

Figure: activity life cycle
Figure: activity life cycle

Same or opposite: onPause and onStop

PointonPauseonStopSame or opposite
Activity isPartly hidden or losing focusFully hiddenOpposite
Work to doQuick saveHeavier release of resourcesOpposite
Is a life cycle callbackYesYesSame
Called firstYesAfter onPauseOpposite

Exam tip. Draw the life cycle diagram with the six callbacks. State what each one is used for.

Back to the topic list

Q2. Intents: explicit, implicit and intent filters

From the syllabus · Unit 2

From the papers

  • “Unit 2: Intents, receiving and broadcasting intents, using intent filter.” (Syllabus)

The short answer

An intent is a message object that asks Android to start an activity or a service or to deliver a broadcast. It can name the target (explicit) or only describe the job (implicit).

Write these points

Two kinds

  • Explicit intent: names the exact class, used inside your own app.
  • Implicit intent: gives an action and data. Android picks an app that can do it.
  • An intent filter in the manifest tells Android which implicit intents a component accepts.
  • Extra data travels in a Bundle as key and value pairs.
Intent i = new Intent(this, SecondActivity.class);   // explicit
i.putExtra("name", "Asha");
startActivity(i);

Intent v = new Intent(Intent.ACTION_VIEW, Uri.parse("https://paperwala.org")); // implicit
startActivity(v);
Filter partMeaning
actionThe job, for example VIEW or SEND
categoryExtra info, for example DEFAULT
dataType or URI the component can handle

Matching an implicit intent.

Intent: action SEND, type text/plain. Two apps declare filters: A accepts SEND with text/plain. B accepts VIEW with image/png.

A matches the action and the type. B matches neither.

Android offers only A.

Remember. The Java code was not compiled or run.

Real-life example

Telling a taxi driver the exact house number is explicit. Saying only that you want to go to a railway station is implicit. The driver, or Android, picks the route.

An implicit intent
An implicit intent

Same or opposite: explicit and implicit intent

PointExplicitImplicitSame or opposite
TargetNamed classChosen by AndroidOpposite
Usual useInside one appAcross appsOpposite
Can carry extrasYesYesSame
Needs intent filterNoYes, on the receiverOpposite

Exam tip. Show both lines of code. Then explain the intent filter in one sentence.

Back to the topic list

Q3. Android platform and software stack

From the syllabus · Unit 1

From the papers

  • “Unit 1: The Android platform.” (Syllabus)

The short answer

The Android platform is an open source software stack for phones. It has a Linux kernel at the bottom and apps at the top.

Write these points

Layers

  • Linux kernel: drivers for display, camera and memory, plus security.
  • Hardware abstraction layer and native libraries: SQLite, graphics, media and the C library.
  • Android runtime: runs the app code. Older versions used Dalvik. Newer versions use ART.
  • Application framework: managers for activities, resources, location and notifications.
  • Applications: the phone app, browser and your own apps.
LayerExample
ApplicationsContacts, your app
FrameworkActivity manager
Runtime and librariesART, SQLite
KernelDisplay and camera drivers

Following a tap on a contact.

The Contacts app (layer 1) asks the framework (layer 2) to open a screen.

The framework uses the runtime and libraries (layer 3) to draw it.

The kernel (layer 4) talks to the display driver. Data moves through 4 layers.

Remember. Some books show five layers. They list the hardware layer or the libraries on their own. Follow your textbook figure.

Real-life example

A restaurant has the guests, the waiters, the kitchen and the gas supply. The guests see only the menu. Android works in the same stack. The user sees apps. The kernel does the hard work underneath.

Figure: Android software stack
Figure: Android software stack

Same or opposite: Dalvik and ART

PointDalvikARTSame or opposite
Compile styleJust in timeAhead of timeOpposite
App startSlowerFasterOpposite
Runs Android app codeYesYesSame
Used inOlder AndroidNewer AndroidOpposite

Exam tip. Draw the stack with names on each layer. Mention the runtime, since many students leave it out.

Back to the topic list

Q4. Android manifest file and application anatomy

From the syllabus · Unit 1

From the papers

  • “Unit 1: Anatomy of an Android application, Android manifest file.” (Syllabus)

The short answer

The Android manifest file is AndroidManifest.xml at the root of every app. It tells Android the app name, its components, its permissions and its needs.

Write these points

What it holds

  • The package name that identifies the app.
  • Every activity, service, receiver and provider the app uses.
  • The permissions the app asks for.
  • Intent filters that say what each component can handle.
  • The launcher activity, which opens first. Also the minimum Android version.
<manifest package="com.example.demo">
  <uses-permission android:name="android.permission.INTERNET"/>
  <application android:label="Demo">
    <activity android:name=".MainActivity">
      <intent-filter>
        <action android:name="android.intent.action.MAIN"/>
        <category android:name="android.intent.category.LAUNCHER"/>
      </intent-filter>
    </activity>
  </application>
</manifest>

Project anatomy

  • src or java: your code. res: layouts, images and strings. gen or R.java: ids made by the tools.

Why a screen crashes.

App has MainActivity and SettingsActivity. Only MainActivity is in the manifest.

startActivity to SettingsActivity fails with an error.

Fix: add one activity line. 1 missing line broke the app.

Remember. The XML was not run in a real project. Some books say Eclipse and ADT. New projects use Android Studio.

Real-life example

A new hostel student fills a form with name, room needs and allowed visitors. The warden reads the form before anything else. Android reads the manifest first in the same way.

Figure: contents of the manifest
Figure: contents of the manifest

Same or opposite: manifest and layout file

PointManifestLayoutSame or opposite
DescribesApp components and rightsOne screen designOpposite
Number per appOneManyOpposite
Is an XML fileYesYesSame
Read byAndroid system at installThe UI system at runOpposite

Exam tip. Write a short manifest with a permission and the launcher activity. List the contents as points.

Back to the topic list

Q5. Layouts for user interface design

From the syllabus · Unit 3

From the papers

  • “Unit 3: Designing user interfaces with layouts.” (Syllabus)

The short answer

A layout decides how views are placed on the screen. A layout is a ViewGroup that holds views and other layouts.

Write these points

Common layouts

  • LinearLayout: places views in one row or one column. Weights share the space.
  • RelativeLayout: places views by their position relative to each other.
  • ConstraintLayout: places views by constraints to edges and other views. It keeps the tree flat.
  • FrameLayout: stacks views on top of each other.
  • TableLayout and GridLayout: place views in rows and columns.
<LinearLayout android:orientation="horizontal">
  <Button android:layout_width="0dp" android:layout_weight="1"/>
  <Button android:layout_width="0dp" android:layout_weight="2"/>
</LinearLayout>

Weights on a 360 dp wide screen.

Weights 1 and 2 give a total of 3.

First button: 360 x 1 / 3 = 120 dp. Second button: 360 x 2 / 3 = 240 dp.

On a larger screen the same 1 to 2 ratio holds.

Remember. The XML was not run. Sizes are in dp, so they scale with screen density.

Real-life example

Arranging furniture in a room can be done in a straight line along a wall, or by saying the lamp goes next to the sofa. Linear and relative layouts do the same for buttons and text.

Figure: common layouts
Figure: common layouts

Same or opposite: LinearLayout and RelativeLayout

PointLinearLayoutRelativeLayoutSame or opposite
PlacementOne row or columnBy position to other viewsOpposite
Nesting neededOftenLessOpposite
Is a ViewGroupYesYesSame
Best forSimple lists of viewsComplex positionsOpposite

Exam tip. Name at least four layouts and write a short XML. The weights example shows you can compute sizes.

Back to the topic list

Q6. Managing data with SQLite

From the syllabus · Unit 5

From the papers

  • “Unit 5: Managing data using SQLite.” (Syllabus)

The short answer

SQLite is a small database engine built into Android. An app keeps structured data in tables and reads it with SQL.

Write these points

How an app uses it

  • Extend SQLiteOpenHelper and write onCreate and onUpgrade.
  • onCreate runs the CREATE TABLE statements the first time.
  • Call getWritableDatabase to insert, update or delete. Call getReadableDatabase to read.
  • A Cursor walks through the rows that a query returns.
  • Each app database is private to that app.
db.execSQL("CREATE TABLE student(id INTEGER PRIMARY KEY, name TEXT, marks INT)");
ContentValues v = new ContentValues();
v.put("name", "Asha"); v.put("marks", 72);
db.insert("student", null, v);
Cursor c = db.rawQuery("SELECT name FROM student WHERE marks > 60", null);

A query on three rows.

Table rows: Asha 72, Ravi 58, Meena 81.

SELECT name WHERE marks > 60 ORDER BY marks DESC returns Meena, Asha.

Average marks = (72 + 58 + 81) / 3 = 70.33. After adding 5 to Ravi, his marks are 63.

Remember. The SQL results were run with Python sqlite3 on the same table. The Java lines were not compiled.

Real-life example

A school clerk keeps a register with columns for name and marks. She can add a row, correct a row or look up all students above 60. SQLite gives an app the same kind of register.

Figure: SQLite in an app
Figure: SQLite in an app

Same or opposite: SQLite and shared preferences

PointSQLiteShared preferencesSame or opposite
Data shapeTables of rowsKey and value pairsOpposite
Best forLarge, structured dataSmall settingsOpposite
Private to the appYesYesSame
Query languageSQLNoneOpposite

Exam tip. Write the helper class idea, one insert and one query. Show a tiny table with the result.

Back to the topic list

Q7. Content providers

From the syllabus · Unit 5

From the papers

  • “Unit 5: Sharing data between applications with content providers.” (Syllabus)

The short answer

A content provider is a component that shares an app's data with other apps through a standard interface. Other apps reach it by a content URI.

Write these points

Main points

  • The provider hides how data is stored. It could be SQLite or files.
  • Other apps use a ContentResolver to call query, insert, update and delete.
  • A URI looks like content://authority/path/id.
  • The provider must be declared in the manifest. It can require permissions.
  • Android has built in providers for contacts, calendar and media.
MethodDoes
queryReads rows into a Cursor
insertAdds a row and returns its URI
updateChanges rows
deleteRemoves rows

Reading a URI.

URI: content://com.example.students/student/3.

Authority: com.example.students. Path: student. Row id: 3.

The provider returns the row with id 3 only.

Remember. The authority name is made up for this example.

Real-life example

A library lends books by a counter. Members do not walk into the store room. The counter clerk applies the rules. A content provider is that counter for an app's data.

Figure: content provider
Figure: content provider

Same or opposite: content provider and direct database access

PointContent providerDirect database accessSame or opposite
Who can use the dataOther appsSame app onlyOpposite
ControlPermissions and URIsNone neededOpposite
Can sit on SQLiteYesYesSame
SetupMoreLessOpposite

Exam tip. Explain URI, ContentResolver and the four methods. Give one example URI and break it into parts.

Back to the topic list

Q8. Services

From the syllabus · Unit 2

From the papers

  • “Unit 2: Services.” (Syllabus)

The short answer

A service is a component that runs work in the background without a screen. It can keep running after the user leaves the app.

Write these points

Kinds of service

  • Started service: begins with startService and runs until it stops itself.
  • Bound service: other components connect with bindService and use it like a server.
  • Foreground service: shows a notification so the user knows it is running.

Points to write

  • A service runs on the main thread by default, so heavy work needs its own thread.
  • Callbacks: onCreate, onStartCommand, onBind and onDestroy.
  • A service must be declared in the manifest.

Music player timing.

A song of 3 minutes is playing and the user opens another app.

Without a service the activity may stop and the music ends.

With a started service the song plays for the full 180 seconds. The service calls stopSelf at the end.

Remember. The code is not shown here. Newer Android versions limit background services, so foreground services are used for long tasks.

Real-life example

A cook keeps the pressure cooker on the stove while the family watches television. The family does not look at it, but the work goes on. A service works like the cooker.

Figure: started and bound service
Figure: started and bound service

Same or opposite: started and bound service

PointStartedBoundSame or opposite
Starts withstartServicebindServiceOpposite
Talks to callersNoYesOpposite
Runs without a screenYesYesSame
EndsStops itselfWhen the last client unbindsOpposite

Exam tip. Name the three kinds and the four callbacks. A comparison of started and bound is a common question.

Back to the topic list

Q9. Using Android preferences

From the syllabus · Unit 4

From the papers

  • “Unit 4: Using Android preferences.” (Syllabus)

The short answer

Shared preferences store small amounts of data as key and value pairs in an XML file private to the app. They suit settings such as a theme or a user name.

Write these points

How to use

  1. Get the object with getSharedPreferences(name, mode).
  2. Call edit() to get an Editor.
  3. Use putString, putInt or putBoolean.
  4. Call apply() or commit() to save.
  5. Read with getString or getInt and give a default value.
  • Data stays after the app closes.
  • Do not put large or secret data here.
SharedPreferences sp = getSharedPreferences("app", MODE_PRIVATE);
sp.edit().putString("user", "Asha").apply();
String u = sp.getString("user", "guest");

Default value.

First run: key user not saved. getString returns guest.

After saving Asha, the next run returns Asha.

Two reads, two values.

Remember. The Java lines were not compiled.

Real-life example

A phone remembers your ringtone and font size. It does not store a whole file. It stores one small value for each setting. Shared preferences are the same kind of memory.

Saving a setting
Saving a setting

Same or opposite: apply and commit

PointapplycommitSame or opposite
Writes to diskIn the backgroundAt onceOpposite
Returns a resultNoYes (true or false)Opposite
Saves the editor changesYesYesSame
Blocks the threadNoYesOpposite

Exam tip. Give the five steps in order and the default value idea. Add the three lines of code.

Back to the topic list

Q10. Application resources and the resource hierarchy

From the syllabus · Unit 4

From the papers

  • “Unit 4: Managing application resources in a hierarchy, different types of resources.” (Syllabus)

The short answer

Android keeps resources such as layouts, strings and images outside the code in the res folder. It chooses the best version for each device by the folder name.

Write these points

Resource types

  • layout: screen designs. drawable: images. values: strings, colours and sizes.
  • menu, anim and raw hold menus, animations and raw files.
  • Access in code with R.type.name, for example R.string.app_name.
  • Access in XML with @type/name, for example @string/app_name.

Hierarchy and qualifiers

  • A folder name adds a qualifier: values-hi for Hindi, layout-land for a wide screen, drawable-hdpi for a screen density.
  • Android checks the qualifiers against the device and picks the best match. If none matches, it uses the default folder.

Choosing a string.

Folders: values (English) and values-hi (Hindi). Phone language is Hindi.

Android picks values-hi.

For a French phone neither matches, so values (default) is used.

Remember. Folder names follow the Android documentation as I remember it. Check your book for the full qualifier list.

Real-life example

A bank prints its forms in Hindi and English. The clerk hands you the one in your language. If it has no form in your language, you get the English one. Android picks resources the same way.

Figure: choosing resources
Figure: choosing resources

Same or opposite: default and alternative resources

PointDefault folderQualified folderSame or opposite
Folder namevaluesvalues-hi or layout-landOpposite
Used whenNo other matchDevice matches the qualifierOpposite
Read through RYesYesSame
RequiredYesOptionalOpposite

Exam tip. Always mention folder names with qualifiers. Show how R.string and @string differ in code and XML.

Back to the topic list

Start with the latest papers

Previous year papers will be added soon!

Mobile Application Development (AD-703-B) FAQs

What are the most important topics in Mobile Application Development?

No past paper of this subject is on this site yet, so the topics were chosen from the syllabus. The first five: Activity and its life cycle; Intents: explicit, implicit and intent filters; Android platform and software stack; Android manifest file and application anatomy; Layouts for user interface design.

How were these Mobile Application Development important questions chosen?

Each topic was taken from the syllabus units. No past paper was available to count repeats, and the answers are not teacher-reviewed, so use them together with your syllabus.

Is there a PDF of Mobile Application Development important questions with answers?

Yes. The Paperwala Imp Question & Answer PDF for Mobile Application Development is free to download from this page.

The 10 topics of Mobile Application Development (AD-703-B) for RGPV B.Tech AI & Data Science semester 7, chosen from the syllabus. No past paper of this subject is on this site yet, so repeats could not be counted. Mobile Application Development is also searched for as SD-801 and Mobile Application Design.

Also known as SD-801, Mobile Application Design