2022 Summer Finall
2022 Summer Finall
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
_________
SUMMER – 2022 EXAMINATION
Subject Name: Mobile Application Development Model Answer Subject Code: 22617
Important Instructions to examiners:
1) The answers should be examined by key words and not as word-to-word as given in the model answer scheme.
2) The model answer and the answer written by candidate may vary but the examiner may try to assess the
understanding level of the candidate.
3) The language errors such as grammatical, spelling errors should not be given more Importance (Not applicable for
subject English and Communication Skills.
4) While assessing figures, examiner may give credit for principal components indicated in the figure. The figures
drawn by candidate and model answer may vary. The examiner may give credit for any equivalent figure drawn.
5) Credits may be given step wise for numerical problems. In some cases, the assumed constant values may vary and
there may be some difference in the candidate’s answers and model answer.
6) In case of some questions credit may be given by judgement on part of examiner of relevant answer based on
candidate’s understanding.
7) For programming language papers, credit may be given to any other program based on equivalent concept.
8) As per the policy decision of Maharashtra State Government, teaching in English/Marathi and Bilingual (English +
Marathi) medium is introduced at first year of AICTE diploma Programme from academic year 2021-2022. Hence if
the students in first year (first and second semesters) write answers in Marathi or bilingual language (English
+Marathi), the Examiner shall consider the same and assess the answer based on matching of concepts with
model answer.
Page No: 1 | 23
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
_________
Ans Dalvik Virtual Machine is a register-based machine that compiles byte code to get dex (Correct
code and that ensures that a device can run multiple instances efficiently. definition
2 M)
c) List any four folders from directory structure of Android project and 2M
elaborate in one line.
Ans Folders from directory structure: (List of
1) app: The App folder contains three subfolders (manifests, java and res) that make up names of
our application. any four
They are divided so that it should be fairly easy to determine which resources go in which folders : 1 M
folder. and
2) Manifest: This is where we would put our manifest files. Most Android apps have elaboration
single manifest file. But an app may have several manifest files due to application
in one line
versioning, or for supporting specific hardware.
3) Java: This is the folder in our project where we will be storing all of the source code
:1 M)
files written in Java programming language.
4) res: It contains folders that help us to separate and sort the resources of our application.
Resources
basically mean all the needed files except the source code.
5) drawable: The drawable folder contains graphics that can be drawn to the screen.
6) layout: The layout folder contains XML files used for your layouts. These file are used
to set up the layout for your Activity and is used for basic alignment of your layouts,
components, widgets, and similar
resources that are used for the UI of your application.
7) mipmap : The mipmap folder contains the launcher icon files for the app. A launcher
icon is a graphic that
represents your app to users.
8) values: The values folder contains XML files that contain simple values, such as
strings, integers, and colors.
The values folder is used to keep track of the values we will be using in our application.
Page No: 2 | 23
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
_________
Ans (2 M for
correct
diagram)
Page No: 3 | 23
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
_________
ranges from 0 to 21.
OR
3) AudioManager
Page No: 4 | 23
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
_________
Ans Diagram: 2M
Explanation:
2M
This is the topmost layer of the Android architecture. It includes built-in native apps like Contacts,
Email, Gallery, Clock, and Music, as well as third-party apps such as games and tools that users
install. All applications run within the Android Runtime (ART or Dalvik) and use the services and
classes provided by the Application Framework.
2. Application Framework
The Application Framework provides all the essential classes and services needed to build Android
Page No: 5 | 23
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
_________
applications. It manages hardware access, UI elements, and system resources. Core services in this
layer include the Activity Manager (for app lifecycle), View System (for UI components), Location
Manager (for GPS), Notification Manager (for status bar alerts), as well as services like Package
Manager, NFC service, and Telephony Manager.
3. Android Runtime
The Android Runtime layer is crucial and includes two main parts:
(i) Dalvik Virtual Machine (DVM) – It is a register-based virtual machine optimized for low
memory and CPU usage. It allows multiple apps to run efficiently and relies on the Linux Kernel for
memory and threading.
(ii) Core Libraries – These libraries provide Java-like functionalities that allow Android apps to be
written in Java. Android Runtime supports the Application Framework by offering all the core
features needed to run apps.
4. Platform Libraries
This layer contains various C, C++, and Java libraries used by Android apps and the Android
system. These libraries include libc (standard C library), SSL (for secure internet connections),
SQLite (for local database support), and other important libraries like Media, WebKit, OpenGL,
Surface Manager, and Graphics. These libraries help the Android Runtime and Framework to
perform tasks like graphics rendering, web access, media playback, and data storage.
5. Linux Kernel
The Linux Kernel is the bottom layer of the Android architecture and acts as the core of the
operating system. It provides a bridge between the hardware and software layers. The kernel
manages device drivers for display, camera, audio, memory, Bluetooth, and more. It is responsible
for important system functions like power management, memory handling, process control, device
management, and system security.
Page No: 6 | 23
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
_________
b. (Syntax of
State syntax to create Text View and Image button with any two attributes of each. TextView
Ans ..Text View: and
Syntax : ImageButton
<TextView : 1 M each Any
android:id="@+id/textView1" two appropriate
android:layout_width="<width value>” attributes of
android:layout_height="<height_value>" each : 1/2 M
android:text="<text to be displayed>"/> each)
Attributes/Properties of TextView:
● id: Supply an identifier name of this view, to later retrieve it with
View.findViewByID() or Activity.findViewById()
text: text attribute is used to set the text in a text view. We can set the text in xml as
well as in the java class.
● textColor: textColor attribute is used to set the text color of a text view. Color
value is in the form of “#argb”, “#rgb”, “#rrggbb”, or “#aarrggbb”.
● textSize: textSize attribute is used to set the size of text of a text view. We can set
the text size in sp(scale independent pixel) or dp(density pixel).
● textStyle: textStyle attribute is used to set the text style of a text view. The possible
text styles are bold, italic and normal. If we need to use two or more styles for a text
view then “|” operator is used for that.
ImageButton:
Syntax :
<ImageButton
android:id="@+id/imageButton"
android:layout_width="<width value>"
android:layout_height="<height value>"
app:srcCompat="<image source from drawable folder "/>
Attributes/Properties of ImageButton:
Page No: 8 | 23
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
_________
d) State and elaborate the syntax of required class and methods for 4M
Geocoding.
Ans (2 M for
The Geocoder class in Android is used to perform geocoding and reverse geocoding.
explanation
Geocoding is the process of converting a location name or street address into geographic and syntax
coordinates such as latitude and longitude. of class, 2 M
for
Reverse geocoding is the opposite, where coordinates are converted into a readable address. The
explanation
amount of address detail returned may vary; it can include full street information or just city and
and syntax
postal code.
of any two
The Geocoder class requires a backend service which is not always available in all Android methods)
devices. If the backend service is missing, the geocoding methods will return an empty list. To
check if the service is present, the isPresent() method can be used.
Page No: 9 | 23
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
_________
Syntax
1,Geocoder geocoder = new Geocoder(Context context);
a.
Page No: 10 | 23
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
_________
Returns true if there is a geocoder implementation present that may return results. If true,
there is still no guarantee that any individual geocoding attempt will succeed.
Ans AbsoluteLayout is a type of layout in Android that lets you place UI elements at exact x and y (Explanation
positions on the screen. Each view is positioned using fixed coordinates. However, this layout is not 2 M,
recommended because it creates a rigid and hard-to-maintain UI. If we want to add or move any
element, we must manually adjust the position of all other elements. Due to this inflexibility,
Example 2
AbsoluteLayout is now deprecated in Android. M)
activity_main.xml
<AbsoluteLayoutxmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
android:layout_x="10px"
android:layout_y="10px"
android:text="User Name"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<EditText
android:layout_x="50px"
android:layout_y="50px"
android:width="100px"
android:layout_width="200dp"
android:layout_height="wrap_content" />
</AbsoluteLayout>
Page No: 11 | 23
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
_________
✅ activity_main.xml (2 Marks)
xml
CopyEdit
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center"
android:padding="16dp">
<Button
android:id="@+id/btnDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Select Date" />
<Button
android:id="@+id/btnTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Select Time"
android:layout_marginTop="10dp" />
</LinearLayout>
✅ MainActivity.java (3 Marks)
java
CopyEdit
package com.example.datetimepicker;
import android.app.DatePickerDialog;
import android.app.TimePickerDialog;
import android.os.Bundle;
import android.app.Activity;
import android.view.View;
import android.widget.Button;
import java.util.Calendar;
Page No: 12 | 23
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
_________
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
btnDate = findViewById(R.id.btnDate);
btnTime = findViewById(R.id.btnTime);
btnDate.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
Calendar c = Calendar.getInstance();
DatePickerDialog dp = new
DatePickerDialog(MainActivity.this,
null, c.get(Calendar.YEAR), c.get(Calendar.MONTH),
c.get(Calendar.DAY_OF_MONTH));
dp.show();
}
});
btnTime.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
Calendar c = Calendar.getInstance();
TimePickerDialog tp = new
TimePickerDialog(MainActivity.this,
null, c.get(Calendar.HOUR_OF_DAY),
c.get(Calendar.MINUTE), false);
tp.show();
}
});
}
}
Discuss developer console with at least four features (pt2 paper me hai)
● Google Play Developer Console is the platform that Google provides for Google
Play and Android developers to publish their apps.
● The Google Play Developer console allows app developers and marketers to
better understand how their apps are performing in terms of growth, technical
performance such as crashes or display issues, and financials.
● The console offers acquisition reports and detailed analysis which can help app
devs find out how well an app is really performing.
● The platform is important as it provides developers with access to first party data
(trustworthy information collected about an app’s audience that comes straight
from Google Play) that highlights the real performance of an app.
It shows the number of impressions an app listing receives and the number of
Installs an app receives from different sources over time.
Page No: 13 | 23
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
_________
d) 4M
Ans 4M
● (Any 4
relevant
features 1M
each )
Page No: 14 | 23
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
_________
Page No: 15 | 23
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
_________
5. Attempt any TWO of the following: 12 M
a) Write a program to convert temperature from celcius to farenhite and vice versa 6M
using Toggle button. (Design UI as per your choice. Write XML and java file)
(Note: Consider the appropriate XML file. All attributes are not required.
In java file all imports are not expected. Different relevant logic/code can be
considered.)
Ans Java XML file:
package com.example.tempconverter; 2M
import android.os.Bundle;
import android.view.View;
import android.widget.*; Java Code:
import androidx.appcompat.app.AppCompatActivity; 4M
public class MainActivity extends AppCompatActivity {
EditText inputTemp;
ToggleButton toggle;
TextView result;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
inputTemp = findViewById(R.id.inputTemp);
toggle = findViewById(R.id.toggle);
result = findViewById(R.id.result);
toggle.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String value = inputTemp.getText().toString();
if (!value.isEmpty()) {
double temp = Double.parseDouble(value);
if (toggle.isChecked()) {
// Convert Celsius to Fahrenheit
double f = (temp * 9 / 5) + 32;
result.setText("Fahrenheit: " + f);
} else {
// Convert Fahrenheit to Celsius
double c = (temp - 32) * 5 / 9;
result.setText("Celsius: " + c);
}
} else {
result.setText("Enter Temperature");
}
}
});
}
}
Xml
<?xml version="1.0" encoding="utf-8"?>
Page No: 16 | 23
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
_________
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:padding="20dp"
android:layout_width="match_parent"
android:layout_height="match_parent">
<EditText
android:id="@+id/inputTemp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Enter temperature"
android:inputType="numberDecimal" />
<ToggleButton
android:id="@+id/toggle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textOn="C to F"
android:textOff="F to C" />
<TextView
android:id="@+id/result"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="18sp"
android:text="Result here" />
</LinearLayout>
Page No: 17 | 23
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
_________
Page No: 18 | 23
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
_________
import androidx.appcompat.app.AppCompatActivity;
ImageView img;
Button btn;
int code = 1;
img = findViewById(R.id.capturedImage);
btn = findViewById(R.id.btnTakePicture);
btn.setOnClickListener(v -> {
Intent i = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(i, code);
});
}
@Override
protected void onActivityResult(int req, int res, Intent data) {
if (req == code && res == RESULT_OK) {
Bitmap photo = (Bitmap) data.getExtras().get("data");
img.setImageBitmap(photo);
} else if (res == RESULT_CANCELED) {
Toast.makeText(this, "Cancelled", Toast.LENGTH_SHORT).show();
}
}
}
xml
CopyEdit
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="10dp"
Page No: 19 | 23
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
_________
android:paddingRight="10dp">
<Button
android:id="@+id/btnTakePicture"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Take a Photo"
android:textStyle="bold"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true" />
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/capturedImage"
android:layout_above="@+id/btnTakePicture"/>
</RelativeLayout>
Page No: 20 | 23
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
_________
6. Attempt any TWO of the following: 12 M
a) Write a program to implement Android Activity Life Cycle. Use toast messages 6M
to display message through life cycle.
(Note: No XML code is required. In java file all imports are not expected.)
Ans package com.example.p1; Use of any 6
import androidx.appcompat.app.AppCompatActivity; methods of
import android.os.Bundle; Activity life
import android.widget.Toast; cycle : 1 M
public class MainActivity extends AppCompatActivity { each
@Override
@Override
protected void onStart() {
super.onStart();
Toast.makeText(getApplicationContext(),"Activity
Started",Toast.LENGTH_LONG).show();
}
@Override
protected void onStop() {
super.onStop();
Toast.makeText(getApplicationContext(),"Activity
Stop",Toast.LENGTH_LONG).show();
}
@Override
protected void onDestroy() {
super.onDestroy();
Toast.makeText(getApplicationContext(),"Activity
Destroy",Toast.LENGTH_LONG).show();
}
@Override
protected void onPause() {
super.onPause();
Toast.makeText(getApplicationContext(),"Activity
Pause",Toast.LENGTH_LONG).show();
}
@Override
protected void onRestart()
{ super.onRestart ();
Page No: 21 | 23
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
_________
Toast.makeText(getApplicationContext(),"Activity
Restart",Toast.LENGTH_LONG).show();
}
@Override
protected void onResume() {
super.onResume();
Toast.makeText(getApplicationContext(),"Activity
Resume",Toast.LENGTH_LONG).show();
}
}
Design UI using table layout to display buttons with 0 9 numbers on it. Even
display submit and clear button. When user clicks on particular buttons and later
when clicks on submit button, it should display the numbers clicked
package com.example.tableinput;
import android.os.Bundle;
import android.widget.*;
import androidx.appcompat.app.AppCompatActivity;
@Override
protected void onCreate(Bundle b) {
super.onCreate(b);
setContentView(R.layout.activity_main);
// Initialize and set listeners for the number buttons (0-9) in a loop
for (int id : ids) {
Button btn = findViewById(id);
Page No: 22 | 23
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
_________
btn.setOnClickListener(v -> input += btn.getText().toString());
}
}
}
<TableRow>
<Button android:id="@+id/b1" android:text="1" />
<Button android:id="@+id/b2" android:text="2" />
<Button android:id="@+id/b3" android:text="3" />
</TableRow>
<TableRow>
<Button android:id="@+id/b4" android:text="4" />
<Button android:id="@+id/b5" android:text="5" />
<Button android:id="@+id/b6" android:text="6" />
</TableRow>
<TableRow>
<Button android:id="@+id/b7" android:text="7" />
<Button android:id="@+id/b8" android:text="8" />
<Button android:id="@+id/b9" android:text="9" />
</TableRow>
<TableRow>
<Button android:id="@+id/b0" android:text="0" />
<Button android:id="@+id/btnClear" android:text="Clear" />
<Button android:id="@+id/btnSubmit" android:text="Submit" />
</TableRow>
</TableLayout>
Page No: 23 | 23