Msbte Board Question Paper

Download as pdf or txt
Download as pdf or txt
You are on page 1of 162

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION

(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
SUMMER – 2022 EXAMINATION
Subject Name: Mobile Application Development Model Answer Subject Code: 22617
Important Instructions to examiners: XXXXX
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.

Q. Sub Answer Marking


No. Q. N. Scheme
Note: As Android programs contain many of the generated code statements from IDE,
while assessing such answers correct logical steps taken to obtain the required output
can be considered.

1 Attempt any FIVE of the following: 10 M

a) List any four features of Android operating system. 2M

Ans Features of Android Operating System: (Any four, ½


1)Storage M for one
2)Multitasking feature)
3)Web Browser
4)Open Source
5)Accessibility
6)Media Support
7)Streaming Media Support
8)Voice Based Features
9)Multitouch
10)External Storage
11)Video Calling
12)Handset Layout
13)Google cloud Messaging
14)WiFi Direct
b) Define Dalvik Virtual Machine (DVM). 2M

Page No: 1 | 39
for more study material visit www.diplomachakhazana.in
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 any
our application. four folders :
They are divided so that it should be fairly easy to determine which resources go in which 1 M and
folder. elaboration
2)Manifest: This is where we would put our manifest files. Most Android apps have in one line
single manifest file. But an app may have several manifest files due to application
:1 M)
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
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.

d) List any four attributes of check box. 2M

Ans 1)id (Any four


2)checked attribute, ½
3)gravity M for each)
4)text
5)text color
6)text size
7)text style
8)background
9)padding
e) Draw diagram of activity life cycle. 2M

Page No: 2 | 39
www.diplomachakhazana.in
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
Ans (2 M for
correct
diagram)

f) State syntax to display built in zoom control. 2M

Ans a) Built in Zoom control in Google map can be displayed with : Correct
Syntax : 2
UiSettings.setZoomControlsEnabled(true); M)
OR

b) In case, while display Google map by intent, default zoom level can be given in
the form of data as
geo:latitude,longitude?z=zoom
where lat and lag are for location and zoom level is to set initial zoom level which
Page No: 3 | 39
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
ranges from 0 to 21.

OR

c) In any normal activity, ZoomControl can be displayed as component by following


syntax :
ZoomControl zoomControls = (ZoomControls) findViewById(R.id.simpleZoomControl);
zoomControls.show()
g) Name two classes used to play audio and video in Android. 2M

Ans 1) MediaPlayer (Any two


class names
2) MediaController 1 M each)

3) AudioManager

2. Attempt any THREE of the following: 12 M

a) Describe Android architecture with diagram. 4M

www.diplomachakhazana.in

Page No: 4 | 39
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
Ans Diagram: 2M
Explanation:
2M

1. Applications:

• The top layer of android architecture is Applications. The native and third party
applications like Contacts, Email, Music, Gallery, Clock, Games, etc. whatever we will
build those will be installed on this layer only.

• The application layer runs within the Android run time using the classes and services
made available from the application framework.

2. Application Framework:

• The Application Framework provides the classes used to create an Android application.
It also provides a generic abstraction for hardware access and manages the user interface

Page No: 5 | 39
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
and application resources.

• It basically provides the services through which we can create the particular class and
make that class helpful for the Applications creation.

• The application framework includes services like telephony service, location services,
notification. manager, NFC service, view system, etc. which we can use for application
development as per our requirements.

3. Android Runtime:

• Android Runtime environment is an important part of Android rather than an internal


part and it contains a components like core libraries and the Dalvik virtual machine.

• The Android run time is the engine that powers our applications along with the libraries
and it forms the basis for the application framework.

(i) Dalvik Virtual Machine (DVM) is a register-based virtual machine like Java Virtual
Machine (JVM).

It is specially designed and optimized for android to ensure that a device can run multiple

instances efficiently. It relies on the Linux kernel for threading and low-level memory

management.

(ii) The core libraries in android runtime will enable us to implement an android
applications using standard JAVA programming language.

4. Platform Libraries:

• The Platform Libraries includes various C/C++ core libraries and Java based libraries
such as SSL, libc, Graphics, SQLite, Webkit, Media, Surface Manger, OpenGL etc. to
provide a support for android development.

• Following are the summary details of some core android libraries available for android
development.

• Media library for playing and recording an audio and video formats

(i) The Surface manager library to provide a display management

(ii) SGL and OpenGL Graphics libraries for 2D and 3D graphics

(iii) SQLite is for database support and FreeType for font support

(iv) Web-Kit for web browser support and SSL for Internet security.

5. Linux Kernel:

Page No: 6 | 39
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
• Linux Kernel is a bottom layer and heart of the android architecture. It is heart of
Android

architecture that exists at the root of android architecture and contains all the low-level
device

drivers for the various hardware components of an Android device.

• Linux Kernel is responsible fro device drivers, power management, memory


management, device management and resource access. It manage all the drivers such as
display drivers, camera drivers,

Bluetooth drivers, audio drivers, memory drivers, etc. which are mainly required for the
android device during the runtime.

• The Linux Kernel will provides an abstraction layer between the device hardware and
the remainder of the stack. It is responsible for memory management, power
management, device management, resource access, etc.

b) Differentiate between DVM and JVM. 4M

Ans Any 4 points


of
DVM (Dalvik Virtual Machine) JVM (Java Virtual Machine) differences :
It is Register based which is designed to run It is Stack based. 1 M each
on low memory.
DVM uses its own byte code and runs the JVM uses java byte code and runs
“.Dex” file. From Android 2.2 SDK Dalvik “.class” file having JIT (Just In Time).
has got a Just in Time compiler
DVM has been designed so that a device A single instance of JVM is shared
can run multiple instances of the VM with multiple applications.
efficiently. Applications are given their own
instance.
DVM supports the Android operating JVM supports multiple operating
system only. systems.
There is a constant pool for every It has a constant pool for every class.
application.
Here the executable is APK. Here the executable is JAR.

c) List and elaborate steps to deploy an Android application on Google play 4M


store.

Ans Steps to deploy and Android Application on Google Play Store: (List 1 M
and
Step 1: Make a Developer Account Elaboration 3
Step 2: Plan to Sell? Link Your Merchant Account M)
Step 3: Create an App
Step 4: Prepare Store Listing

Page No: 7 | 39
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
Step 5: Upload APK to an App Release
Step 6: Provide an Appropriate Content Rating
Step 7: Set Up Pricing & Distribution
Step 8: Rollout Release to Publish Your App

Step 1: Create a Developer Account


Before you can publish any app on Google Play, you need to create a Developer Account.
You can easily sign up for one using your existing Google Account. You’ll need to pay a
one-time registration fee of $25 using your international credit or debit card. It can take
up to 48 hours for your registration to be fully processed.

Step 2: Plan to Sell? Link Your Merchant Account


If you want to publish a paid app or plan to sell in-app purchases, you need to create a
payments center profile, i.e. a merchant account. A merchant account will let you manage
your app sales and monthly payouts, as well as analyze your sales reports right in your
Play Console.

Step 3: Create an App


Now you have create an application by clicking on 'Create Application'. Here you have
to select your app’s default language from the drop-down menu and then type in a title
for your app. The title of your app will show on Google Play after you’ve published.

Step 4: Prepare Store Listing


Before you can publish your app, you need to prepare its store listing. These are all the
details that will show up to customers on your app’s listing on Google Play. You not
necessarily complete it at once , you can always save a draft and revisit it later when
you’re ready to publish.
The information required for your store listing is divided into several categories such as
Product Details containing title, short and full description of the app, Your app’s title
and description should be written with a great user experience in mind. Use the right
keywords, but don’t overdo it. Make sure your app doesn’t come across as spam-y or
promotional, or it will risk getting suspended on the Play Store.
Graphic Assets where you can add screenshots, images, videos, promotional graphics,
and icons that showcase your app’s features and functionality.
Languages & Translations, Categorization where in category can be selected to which
your app belong to. Contact Details , Privacy Policy for apps that request access to
sensitive user data or permissions, you need to enter a comprehensive privacy policy that
effectively discloses how your app collects, uses, and shares that data.

Step 5: Upload APK to an App Release


Finally upload your app, by uploading APK file. Before you upload APK, you need to
create an app release. You need to select the type of release you want to upload your first
app version to. You can choose between an internal test, a closed test, an open test, and a
production release. The first three releases allow you to test out your app among a select
Page No: 8 | 39
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
group of users before you make it go live for everyone to access.
This is a safer option because you can analyze the test results and optimize or fix your
app accordingly if you need to before rolling it out to all users.
Once you create a production release, your uploaded app version will become accessible
to everyone in the countries you choose to distribute it in and click on ‘Create release.’

Step 6: Provide an Appropriate Content Rating


If you don’t assign a rating to your app, it will be listed as ‘Unrated’. Apps that are
‘Unrated’ may get removed from Google Play.
To rate your app, you need to fill out a content rating questionnaire An appropriate
content rating will also help you get to the right audience, which will eventually improve
your engagement rates.

Step 7: Set Up Pricing & Distribution


Before you can fill out the details required in this step, you need to determine your app’s
monetization strategy. Once you know how your app is going to make money, you can go
ahead and set up your app as free or paid.
You can always change your app from paid to free later, but you cannot change a free app
to paid. For that, you’ll need to create a new app and set its price.

Step 8: Rollout Release to Publish Your App


The final step involves reviewing and rolling out your release after making sure you’ve
taken care of everything else.
Before you review and rollout your release, make sure the store listing, content rating,
and pricing and distribution sections of your app each have a green check mark next to
them.
Once you’re sure about the correctness of the details, select your app and navigate to
‘Release management’ – ‘App releases.’ You can always opt for reviews by clicking on
‘Review’ to be taken to the ‘Review and rollout release’ screen. Here, you can see if there
are any issues or warnings you might have missed out on.
Finally, select ‘Confirm rollout.’ This will also publish your app to all users in your target
countries on Google Play.
d) Describe with example, how to create a simple database in SQLite (Assume 4M
suitable data).
(Note : Any other method such as creating subclass of SQLiteOpenHelper class
and overriding and using required methods with relevant example can also be
considered)
Ans This procedure is by openOrCreateDatabase() Description 1
1. The package imported into the application is android.database.sqlite.SQLiteDatabase. M, 1 M for
2. Here the class used is SQLiteDatabase. XML file , 2
3. The method used to create the database or connect to the database is M for Java
openOrCreateDatabse() method. File)
Program:
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
Page No: 9 | 39
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<Button
android:text="Create SQLite Database"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="46dp"
android:id="@+id/button" />
</RelativeLayout>

MainActivity.java

package in.edu.vpt.insertusingasync;
import android.app.ProgressDialog;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;;

public class MainActivity extends AppCompatActivity {


SQLiteDatabase sqLiteDatabaseObj;
Button EnterData;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

createData = (Button)findViewById(R.id.button);
createData.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
sqLiteDatabaseObj = openOrCreateDatabase("AndroidJSonDataBase",
Context.MODE_PRIVATE, null);
} });
}

3. Attempt any THREE of the following: 12 M

a) Write down the steps to install and configure Android studio. 4M

Ans Step 1: Go to https://developer.android.com/android-studio/download to get the Android (4 M for


Studio executable or zip file. appropriate
Page No: 10 | 39
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
Step 2: steps)
● Click on the Download Android Studio Button.
● Click on the “I have read and agree with the above terms and conditions”
checkbox followed by the download button
● Click on the Save file button in the appeared prompt box and the file will start
downloading.
Step 3: After the downloading has finished, open the file from downloads and will
prompt the following dialog box. Click on next. In the next prompt, it’ll ask for a path for
installation. Choose a path and hit next.
Step 4: It will start the installation, and once it is completed, it will be like the image
shown below.
Step 5: Once “Finish” is clicked, it will ask whether the previous settings need to be
imported [if the android studio had been installed earlier], or not. It is better to choose the
‘Don’t import Settings option’. Click the OK button.
Step 6: This will start the Android Studio. Meanwhile, it will be finding the available
SDK components.
Step 7: After it has found the SDK components, it will redirect to the Welcome dialog
box.
Choose Standard and click on Next. Now choose the theme, whether the Light theme or
the Dark one. The light one is called the IntelliJ theme whereas the dark theme is
called Darcula. Choose as required. Click on the Next button.
Step 8: Now it is time to download the SDK components. Click on Finish. Components
begin to download let it complete. The Android Studio has been successfully
configured. Now it’s time to launch and build apps. Click on the Finish button to launch
it.
Step 9: Click on Start a new Android Studio project to build a new app.

b) State syntax to create Text View and Image button with any two attributes of each. 4M

Ans Text View: (Syntax of


Syntax : TextView
<TextView and
android:id="@+id/textView1" ImageButton
android:layout_width="<width value>” : 1 M each
android:layout_height="<height_value>" Any two
android:text="<text to be displayed>"/> appropriate
Attributes/Properties of TextView: attributes of
● id: Supply an identifier name of this view, to later retrieve it with each : 1/2 M
View.findViewByID() or Activity.findViewById() each)
● alpha: alpha property of the view as a value between 0 (entirely transparent) and
1(Completely Opaque). [flag]
● auto link: Controls whether links such as urls and email addresses are
automatically found and converted to clickable links.[flag]
● gravity: The gravity attribute is an optional attribute which is used to control the
alignment of the text like left, right, center, top, bottom, center_vertical,
center_horizontal etc
● text: text attribute is used to set the text in a text view. We can set the text in xml as
Page No: 11 | 39
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
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.
● background: background attribute is used to set the background of a text view. We
can set a color or a drawable in the background of a text view.
● padding: padding attribute is used to set the padding from left, right, top or bottom.
In above example code of background we also set the 10dp padding from all the
sides of text view.

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:

● id: id is an attribute used to uniquely identify a image button. Below is the


example code in which we set the id of a image button.
● src: src is an attribute used to set a source file of image or you can say image in
your image button to make your layout look attractive.
● background: background attribute is used to set the background of an image
button. We can set a color or a drawable in the background of a Button.
● padding: padding attribute is used to set the padding from left, right, top or
bottom of the ImageButton.

c) Describe Android service life cycle along with diagram. 4M

Ans ● A service is an application component which runs without direst interaction with (Explanation
the user in the background. 2 M,
● Services are used for repetitive and potentially long running operations, i.e., Diagram
Internet downloads, checking for new data, data processing, updating content 2M)
providers and the like.
● Service can either be started or bound we just need to call either startService() or
bindService() from any of our android components. Based on how our service
was started it will either be “started” or “bound”

Page No: 12 | 39
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________

Service Lifecycle
1. Started
a. A service is started when an application component, such as an activity,
starts it by calling startService().
b. Now the service can run in the background indefinitely, even if the
component that started it is destroyed.
2. Bound
a. A service is bound when an application component binds to it by calling
bindService().
b. A bound service offers a client-server interface that allows components to
interact with the service, send requests, get results, and even do so across
processes with InterProcess Communication (IPC).
c. Like any other components service also has callback methods. These will
be invoked while the service is running to inform the application of its
state. Implementing these in our custom service would help you in
performing the right operation in the right state. •
d. There is always only a single instance of service running in the app. If you
are calling startService() for a single service multiple times in our

Page No: 13 | 39
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
application it just invokes the onStartCommand() on that service. Neither
is the service restarted multiple times nor are its multiple instances created
1. onCreate():
This is the first callback which will be invoked when any component starts the
service. If the same service is called again while it is still running this method
wont be invoked. Ideally one time setup and intializing should be done in this
callback.
2. onStartCommand() /startSetvice()
This callback is invoked when service is started by any component by calling
startService(). It basically indicates that the service has started and can now run
indefinetly.
3. onBind()
To provide binding for a service, you must implement the onBind() callback
method. This method returns an IBinder object that defines the programming
interface that clients can use to interact with the service.
4. onUnbind()
This is invoked when all the clients are disconnected from the service.
5. onRebind()
This is invoked when new clients are connected to the service. It is called after
onRebind
6. onDestroy()
This is a final clean up call from the system. This is invoked just before the
service is being destroyed.

d) State and elaborate the syntax of required class and methods for 4M
Geocoding.
Ans Geocoder: (2 M for
explanation
A class for handling geocoding and reverse geocoding.
and syntax of
Geocoding is the process of transforming a street address or other description of a class, 2 M
location into a (latitude, longitude) coordinate. for
explanation
Reverse geocoding is the process of transforming a (latitude, longitude) coordinate into a and syntax of
(partial) address. The amount of detail in a reverse geocoded location description may any two
vary, for example one might contain the full street address of the closest building, while methods)
another might contain only a city name and postal code.

The Geocoder class requires a backend service that is not included in the core android
framework.

The Geocoder query methods will return an empty list if there no backend service in the
platform. Use the isPresent() method to determine whether a Geocoder implementation
exists.

Page No: 14 | 39
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
Syntax
Geocoder (Context context)

Constructs a Geocoder localized for the default locale.

Geocoder(Context context, Locale locale)

Constructs a Geocoder localized for the given locale.

Methods with Syntax


a. getFromLocation

Syntax

public List<Address> getFromLocation (double latitude, double longitude, int


maxResults)

public void getFromLocation (double latitude, double longitude, int maxResults,


Geocoder.GeocodeListener listener)

This method returns an array of Addresses that attempt to describe the area immediately
surrounding the given latitude and longitude. The returned addresses should be localized
for the locale provided to this class's constructor.

b. getFromLocationName
Syntax :

● public List<Address> getFromLocationName (String locationName, int


maxResults, double lowerLeftLatitude, double lowerLeftLongitude, double
upperRightLatitude, double upperRightLongitude)
● public void getFromLocationName (String locationName, int maxResults,
double lowerLeftLatitude, double lowerLeftLongitude, double
upperRightLatitude, double upperRightLongitude, Geocoder.GeocodeListener
listener)
● public void getFromLocationName (String locationName, int maxResults,
Geocoder.GeocodeListener listener)
● public List<Address> getFromLocationName (String locationName, int
maxResults)

Returns an array of Addresses that attempt to describe the named location, which may be
a place name such as "Dalvik, Iceland", an address such as "1600 Amphitheatre Parkway,
Mountain View, CA", an airport code such as "SFO", and so forth. The returned
addresses should be localized for the locale provided to this class's constructor.

c. isPresent

Syntax

Page No: 15 | 39
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________

public static boolean isPresent ()

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.

4. Attempt any THREE of the following: 12 M

a) Explain with example, code to create GUI using absolute layout (Assume 4M
suitable data).

Ans ● AbsoluteLayout is based on the simple idea of placing each control at an absolute (Explanation
position. We specify the exact x and y coordinates on the screen for each control. 2 M,
This is not recommended for most UI development (in fact AbsoluteLayout is Example 2
currently deprecated) since absolutely positioning every element on the screen makes M)
an inflexible UI that is much more difficult to maintain.

Absolute Layout
● An Absolute Layout lets you specify exact locations (x/y coordinates) of its children.
Absolute layouts are less flexible and harder to maintain than other types of layouts
without absolute positioning. AbsoluteLayout is based on the simple idea of placing
each control at an absolute position.
● We specify for the exact x and y corodinates on the screen for every control. So this
recommended for most UI development (in fact Absolute Layout is currentaly
deprecated)since absolute positioning of every element on the screen makes an
inflexible UI that is much more difficult to maintain.
● Consider what happens if a control needs to be added to the user interface UI, we
would have to change the position of every single element that is shifted by the new
control. This allows child views to be positioned at specified X and Y coordinates
within the containing layout view.

Example
(Note :Any other relevant example using absoluteLayout can be considered, No java
code is expected)

Page No: 16 | 39
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
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="110px"
android:layout_y="110px"
android:text="User Name"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<EditText
android:layout_x="250px"
android:layout_y="80px"
android:width="100px"
android:layout_width="200dp"
android:layout_height="wrap_content" />
<TextView
android:layout_x="110px"
android:layout_y="200px"
android:text="Password"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<EditText
android:layout_x="250px"
android:layout_y="150px"
android:width="100px"
android:layout_width="200dp"
android:layout_height="wrap_content" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Log In"
android:layout_x="300px"
android:layout_y="300px"/>
</AbsoluteLayout>

b) Write a program to demonstrate Date and Time picker. 4M


(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 activity_main.xml (2M for
<?xml version="1.0" encoding="utf-8"?> correct use
<androidx.constraintlayout.widget.ConstraintLayout of Date
xmlns:android="http://schemas.android.com/apk/res/android" picker
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" 2M for
android:layout_width="match_parent"
Page No: 17 | 39
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
android:layout_height="match_parent" correct use
tools:context=".MainActivity"> of
TimePicker)
<TextView
android:id="@+id/tvDate"
android:layout_width="149dp"
android:layout_height="46dp"
android:layout_marginEnd="224dp"
android:layout_marginBottom="312dp"
android:textSize="20dp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />

<Button
android:id="@+id/btnDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="96dp"
android:layout_marginBottom="312dp"
android:text="Set Date"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
tools:ignore="DuplicateClickableBoundsCheck" />

<DatePicker
android:id="@+id/dtpcker"
android:layout_width="314dp"
android:layout_height="293dp"
android:layout_marginBottom="368dp"
android:datePickerMode="spinner"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.36"
app:layout_constraintStart_toStartOf="parent" />

<TimePicker
android:id="@+id/timepcker"
android:layout_width="184dp"
android:layout_height="195dp"
android:layout_marginEnd="132dp"
android:layout_marginBottom="108dp"
android:timePickerMode="spinner"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />

<TextView
android:id="@+id/tvTime"
android:layout_width="130dp"
Page No: 18 | 39
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
android:layout_height="56dp"
android:layout_marginEnd="232dp"
android:layout_marginBottom="40dp"
android:textSize="20dp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />

<Button
android:id="@+id/btnTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="104dp"
android:layout_marginBottom="48dp"
android:text="Set Time"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

MainActivity.java
package com.example.datepickereg;
import androidx.appcompat.app.AppCompatActivity;
import android.app.DatePickerDialog;
import android.app.TimePickerDialog;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.DatePicker;
import android.widget.TextView;
import android.widget.TimePicker;
import java.util.Calendar;

public class MainActivity extends AppCompatActivity {


TextView tvDate,tvTime;
DatePicker dtpcker;
TimePicker timepcker;
Button b1,b2;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
tvDate=findViewById(R.id.tvDate);
tvTime=findViewById(R.id.tvTime);
b1=findViewById(R.id.btnDate);
b2=findViewById(R.id.btnTime);
dtpcker=findViewById(R.id.dtpcker);
timepcker=findViewById(R.id.timepcker);
b1.setOnClickListener(new View.OnClickListener() {
@Override
Page No: 19 | 39
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
public void onClick(View view) {
tvDate.setText("Date : "+dtpcker.getDayOfMonth()+"-
"+dtpcker.getMonth()+"-"+dtpcker.getYear());
}
});
b2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {

tvTime.setText(timepcker.getCurrentHour()+":"+timepcker.getCurrentMinute());
}
});
}
}
c) Describe multimedia framework of Android with diagram. 4M

Ans ● The android multimedia system includes multimedia applications, multimedia (Explanation
frameworks, OpenCore engine and hardware abstract for audio/video input/output 2M,
devices. And the goal of the android multimedia framework is to provide a
reliable interface for java services. The multimedia framework consists of several Diagram 2
core dynamic libraries such as libmediajni, libmedia, libmediaplayservice and so M)
on.
● Java classes call the Native C library Libmedia through Java JNI(Java Native
Interface). Libmedia library communications with Media Server guard process
through Android’s Binder IPc (inter process communication) mechanism.
● Media Server process creates the corresponding multimedia service according to
the Java multimedia applications.
● The whole communication between Libmedia and Media Server forms a
Client/Server model

Android Multimedia Framework Architecture

Page No: 20 | 39
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
● Typical video/audio data stream works in Android as follows. Particularly, Java
applications first set the URI of the media (from file or network) to PVPlayer
through Java framework, JNI and Native C. In this process, there are no data
stream flows.
● Then PVPlayer processes the media data stream with the steps: demux the media
data to separate video/audio data stream, decode video/audio data, sync
video.audio time, send the decoded data out.
● The below is the description of media codec/format, container and network
protocol supported by the Android platform.
1. Container: The audio file format is a file for storing digital audio data on
a system. This data can be manipulated to reduce the size or change the
quality of the audio. It is a kind of container to store audio information.
2. Audio Format: Any format or codec can be used including the ones
provided by Android or those which are specific devices. However it is
recommended to use the specified file formats as per devices.
3. Network Protocol: Protocols such as RTSP, HTTP,HTTPS are supported
in audio and video playback.

d) Discuss developer console with at least four features 4M

Ans ● Google Play Developer Console is the platform that Google provides for Google (Any 4
Play and Android developers to publish their apps. relevant
● The Google Play Developer console allows app developers and marketers to features 1M
better understand how their apps are performing in terms of growth, technical each )
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.

e) Write a program to demonstrate declaring and using permissions with any 4M


relevant example.
Ans Permission declaring : 4 M for any
correct
The permissions are declared in AndroidManifest.xml file under Manifest folder. program
Permission can be set by <uses-permission> tag in AndroidManifest.xml.
demonstratin
Example:
Following example is to send SMS. g declaration
(Note: Any other relevant example which uses permissions can be considered) and use of
permissions
AndroidManifest.xml

Page No: 21 | 39
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
<uses-permission android:name="android.permission.SEND_SMS"/>

activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">

<TextView
android:id="@+id/textView"
android:layout_width="81dp"
android:layout_height="41dp"
android:layout_marginEnd="268dp"
android:layout_marginBottom="576dp"
android:text="To :"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"/>

<TextView
android:id="@+id/textView2"
android:layout_width="70dp"
android:layout_height="43dp"
android:layout_marginEnd="276dp"
android:layout_marginBottom="512dp"
android:text="Sms Text"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />

<EditText
android:id="@+id/etPhno"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="40dp"
android:layout_marginBottom="572dp"
android:ems="10"
android:inputType="textPersonName"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />

<EditText
android:id="@+id/etmsg"
android:layout_width="193dp"
android:layout_height="51dp"
android:layout_marginEnd="56dp"
android:layout_marginBottom="504dp"
Page No: 22 | 39
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
android:inputType="textPersonName"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
tools:ignore="SpeakableTextPresentCheck" />

<Button
android:id="@+id/btnSms"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="156dp"
android:layout_marginBottom="400dp"
android:text="SEND SMS"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

MainActivity.java
package com.example.testreceivesms;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import android.Manifest;
import android.content.IntentFilter;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.telephony.SmsManager;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity {


EditText et1,et2;
Button b1;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
et1=findViewById(R.id.etPhno);
et2=findViewById(R.id.etmsg);
b1=findViewById(R.id.btnSms);
if(ContextCompat.checkSelfPermission(MainActivity.this,Manifest.permission.SEN
D_SMS)!=
PackageManager.PERMISSION_GRANTED)
{
ActivityCompat.requestPermissions(MainActivity.this,new
String[]{Manifest.permission.SEND_SMS},100);
}
b1.setOnClickListener(new View.OnClickListener() {
Page No: 23 | 39
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
@Override
public void onClick(View v) {
try {
String phno= et1.getText().toString();
String msg=et2.getText().toString();
SmsManager smsManager= SmsManager.getDefault();
smsManager.sendTextMessage(phno,null,msg,null,null);
Toast.makeText(MainActivity.this,"Sms sent successfully",
Toast.LENGTH_LONG).show();
}
catch(Exception e)
{
Toast.makeText(MainActivity.this,"Sms failed to send... try again",
Toast.LENGTH_LONG).show();
}
}
});
}
}
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 activity_main.xml XML file:
<?xml version="1.0" encoding="utf-8"?> 2M
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
Java Code:
android:layout_width="match_parent"
4M
android:layout_height="match_parent"
tools:context=".MainActivity">

<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/edittext"
android:hint="Enter the temp"/>

<ToggleButton
android:id="@+id/togglebutton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/edittext"
android:layout_marginTop="35dp"
android:textOff="F to C"
android:textOn="C to F" />
Page No: 24 | 39
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________

<Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/togglebutton"
android:layout_marginTop="56dp" />
</RelativeLayout>
MainActivity.java
package com.example.p1;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import android.widget.ToggleButton;

public class MainActivity extends AppCompatActivity {


Button b1;
EditText et;
ToggleButton tb;
Double a;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
et=findViewById(R.id.edittext);
b1=findViewById(R.id.button);
tb=findViewById(R.id.togglebutton);
b1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(tb.isChecked())
{
a=Double.parseDouble(String.valueOf(et.getText()));
Double b=a*9/5+32;
String r=String.valueOf(b);
Toast.makeText(MainActivity.this,r+"°F",Toast.LENGTH_SHORT).show();
}
else
{
a=Double.parseDouble(String.valueOf(et.getText()));
Double b=a-32;
Double c=b*5/9;
String r=String.valueOf(c);

Toast.makeText(MainActivity.this,r+"°C",Toast.LENGTH_SHORT).show();
}
Page No: 25 | 39
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
}
});
}
}

b) Write a program to capture an image using camera and display it. 6M


(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 activity_main.xml XML file:
2M
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" Java Code:
android:layout_width="match_parent" 4M
android:layout_height="match_parent"
android:padding="40dp"
android:orientation="horizontal"
tools:context=".MainActivity">

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="CAMERA"
android:id="@+id/text"
android:textSize="20dp"
android:gravity="center"/>

<ImageView
android:id="@+id/image"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/text"
android:layout_marginTop="81dp"
android:src="@drawable/rose"/>

<Button
android:id="@+id/photo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/image"
android:layout_centerHorizontal="true"
android:layout_marginTop="30dp"
android:text="TAKE PHOTO" />

</RelativeLayout>

Page No: 26 | 39
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________

MainActivity.java

package com.example.ifcdiv;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.provider.MediaStore;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;

public class MainActivity extends AppCompatActivity {


Button b1;
ImageView imageView;
int CAMERA_REQUEST=1;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

b1=findViewById(R.id.photo);
imageView=findViewById(R.id.image);

b1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {

Intent i=new Intent(MediaStore.ACTION_IMAGE_CAPTURE);


startActivityForResult(i,CAMERA_REQUEST);
}
});
}

@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent
data) {
super.onActivityResult(requestCode, resultCode, data);

if (requestCode==CAMERA_REQUEST)
{
Bitmap image= (Bitmap) data.getExtras().get("data");
imageView.setImageBitmap(image);
}
}
}

Page No: 27 | 39
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
c) Develop and application to send and receive SMS (Design minimal UI as per 6M
your choice. Write XML, java and manifest file)
(Note: Consider appropriate XML file. All attributes are not required. In java
file all imports are not expected. Different relevant login/code can be considered.
Statements showing permissions can be written under AndroidManifest.xml)
Ans Permissions and <receiver> tag required in AndroidManifest.xml XML file:
<uses-permission android:name="android.permission.RECEIVE_SMS" /> 1M
<uses-permission android:name="android.permission.SEND_SMS"/>
<uses-permission android:name="android.permission.READ_SMS"/> Manifest
<uses-permission android:name="android.permission.WRITE_SMS"/> File:1M
Java Code:
<receiver
4M
android:name=".SmsReceiver"
android:enabled="true"
android:exported="true">
<intent-filter>
<action android:name="android.provider.Telephony.SMS_RECEIVED" />
</intent-filter>
</receiver>

activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">

<TextView
android:id="@+id/textView"
android:layout_width="81dp"
android:layout_height="41dp"
android:layout_marginEnd="268dp"
android:layout_marginBottom="576dp"
android:text="To :"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"/>

<TextView
android:id="@+id/textView2"
android:layout_width="70dp"
android:layout_height="43dp"
android:layout_marginEnd="276dp"
android:layout_marginBottom="512dp"
android:text="Sms Text"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
Page No: 28 | 39
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________

<EditText
android:id="@+id/etPhno"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="40dp"
android:layout_marginBottom="572dp"
android:ems="10"
android:inputType="textPersonName"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />

<EditText
android:id="@+id/etmsg"
android:layout_width="193dp"
android:layout_height="51dp"
android:layout_marginEnd="56dp"
android:layout_marginBottom="504dp"
android:inputType="textPersonName"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
tools:ignore="SpeakableTextPresentCheck" />

<Button
android:id="@+id/btnSms"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="156dp"
android:layout_marginBottom="400dp"
android:text="SEND SMS"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

MainActivity.java
package com.example.testreceivesms;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import android.Manifest;
import android.content.IntentFilter;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.telephony.SmsManager;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

Page No: 29 | 39
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
public class MainActivity extends AppCompatActivity {
SmsReceiver sms= new SmsReceiver();
EditText et1,et2;
Button b1;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
et1=findViewById(R.id.etPhno);
et2=findViewById(R.id.etmsg);
b1=findViewById(R.id.btnSms);
if(ContextCompat.checkSelfPermission(MainActivity.this,Manifest.permission.SEN
D_SMS)!=
PackageManager.PERMISSION_GRANTED)
{
ActivityCompat.requestPermissions(MainActivity.this,new
String[]{Manifest.permission.SEND_SMS},100);
}
b1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
try {
String phno= et1.getText().toString();
String msg=et2.getText().toString();
SmsManager smsManager= SmsManager.getDefault();
smsManager.sendTextMessage(phno,null,msg,null,null);
Toast.makeText(MainActivity.this,"Sms sent successfully",
Toast.LENGTH_LONG).show();
}
catch(Exception e)
{
Toast.makeText(MainActivity.this,"Sms failed to send... try again",
Toast.LENGTH_LONG).show();
}
}
});
}
@Override
protected void onStart() {
super.onStart();
IntentFilter filter=new
IntentFilter("android.provider.Telephony.SMS_RECEIVED");
registerReceiver(sms,filter);
}

@Override
protected void onStop() {
super.onStop();
unregisterReceiver(sms);
Page No: 30 | 39
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
}
}

SmsReceiver.java
package com.example.testreceivesms;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.telephony.SmsMessage;
import android.widget.Toast;

public class SmsReceiver extends BroadcastReceiver {


SmsReceiver(){}
@Override
public void onReceive(Context context, Intent intent) {
Bundle bundle = intent.getExtras();

if (bundle != null) {
// Retrieve the SMS Messages received
Object[] sms = (Object[]) bundle.get("pdus");

// For every SMS message received


for (int i=0; i < sms.length; i++) {
// Convert Object array
SmsMessage smsMessage = SmsMessage.createFromPdu((byte[]) sms[i]);

String phone = smsMessage.getOriginatingAddress();


String message = smsMessage.getMessageBody().toString();

Toast.makeText(context, “Received from “+ phone + ": " + message,


Toast.LENGTH_SHORT).show();
}
}
}
}

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
Page No: 31 | 39
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);
Toast.makeText(getApplicationContext(),"Activity
created",Toast.LENGTH_LONG).show();
}

@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.onResume();
Toast.makeText(getApplicationContext(),"Activity
Restart",Toast.LENGTH_LONG).show();

@Override
protected void onResume() {
super.onResume();
Toast.makeText(getApplicationContext(),"Activity
Resume",Toast.LENGTH_LONG).show();
}
}
b) Develop an application to display Google map with user's current location. 6M
(Note : Consider the appropriate XML file. All attributes are not required.
Page No: 32 | 39
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
In java file all imports are not expected. Different relevant logic/code can be
considered.)
Ans act ivity_main.xml XML file:
<?xml version="1.0" encoding="utf-8"?> 1M
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" Java Code:
android:layout_width="match_parent" 5M
android:layout_height="match_parent"
tools:context=".MainActivity">
<fragment
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/google_map"
android:name="com.google.android.gms.maps.SupportMapFragment" />
</RelativeLayout>

MainActivity.Java

package com.example.location;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;
import androidx.fragment.app.FragmentActivity;
import android.Manifest;
import android.content.pm.PackageManager;
import android.location.Location;
import android.os.Bundle;
import android.widget.Toast;
import com.google.android.gms.location.FusedLocationProviderClient;
import com.google.android.gms.location.LocationServices;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.MarkerOptions;
import com.google.android.gms.tasks.OnSuccessListener;
import com.google.android.gms.tasks.Task;

public class MainActivity extends FragmentActivity implements OnMapReadyCallback


{
Location currentlocation;
Page No: 33 | 39
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
FusedLocationProviderClient fusedLocationProviderClient;
private static final int REQUEST_CODE = 101;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

fusedLocationProviderClient =
LocationServices.getFusedLocationProviderClient(this);
fetchLastLocation();
}

private void fetchLastLocation() {

if (ActivityCompat.checkSelfPermission(this,
Manifest.permission.ACCESS_FINE_LOCATION) !=
PackageManager.PERMISSION_GRANTED &&
ActivityCompat.checkSelfPermission(this,
Manifest.permission.ACCESS_COARSE_LOCATION) !=
PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(this,new
String[]{Manifest.permission.ACCESS_FINE_LOCATION},REQUEST_CODE);
return;
}
Task<Location> task = fusedLocationProviderClient.getLastLocation();
task.addOnSuccessListener(new OnSuccessListener<Location>() {
@Override
public void onSuccess(Location location) {
if(location!=null)
{
currentlocation=location;

Toast.makeText(getApplicationContext(),currentlocation.getLatitude()+""+current
location.getLongitude(), Toast.LENGTH_SHORT).show();
SupportMapFragment supportMapFragment =
(SupportMapFragment)getSupportFragmentManager().findFragmentById(R.id.go
ogle_map);
supportMapFragment.getMapAsync(MainActivity.this);
}
}
});
}
Page No: 34 | 39
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
@Override
public void onMapReady(@NonNull GoogleMap googleMap) {
LatLng latLng=new
LatLng(currentlocation.getLatitude(),currentlocation.getLongitude());
MarkerOptions markerOptions=new MarkerOptions().position(latLng)
.title("I am Here");
googleMap.animateCamera(CameraUpdateFactory.newLatLng(latLng));
googleMap.animateCamera(CameraUpdateFactory.newLatLngZoom(latLng,5));
googleMap.addMarker(markerOptions);

}
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[]
permissions, @NonNull int[] grantResults) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
switch (requestCode) {
case REQUEST_CODE:
if (grantResults.length > 0 && grantResults[0] ==
PackageManager.PERMISSION_GRANTED) {
fetchLastLocation();
}
break;
}
}
}
c) Design UI using table layout to display buttons with 0 9 numbers on it. Even display 6M
submit and clear button. When user clicks on particular buttons and later when
clicks on submit button, it should display the numbers clicked.
(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 activity_main.xml XML file:
<?xml version="1.0" encoding="utf-8"?> 3M
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
Java Code:
android:layout_width="match_parent"
3M
android:layout_height="match_parent"
android:stretchColumns="*"
tools:context=".MainActivity">
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content">

<Button
Page No: 35 | 39
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:id="@+id/button0"
android:text="0"/>
<Button
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:id="@+id/button1"
android:text="1"/>

<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/button2"
android:text="2" />
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content">

<Button
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:id="@+id/button3"
android:text="3"/>
<Button
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:id="@+id/button4"
android:text="4"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="5"
android:id="@+id/button5"/>
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content">

<Button
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="6"
android:id="@+id/button6"/>
<Button
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="7"
Page No: 36 | 39
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
android:id="@+id/button7"/>

<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="8"
android:id="@+id/button8"/>

</TableRow>

<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content">
<Button
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="9"
android:id="@+id/button9"/>
<Button
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="Submit"
android:id="@+id/submit"/>
<Button
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="Clear"
android:id="@+id/clear"/>
</TableRow>
</TableLayout>
(Java File)
package com.example.p1;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity {


Button button0, button1, button2, button3, button4, button5, button6,button7,
button8, button9,submit,clear;
String a=null;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
button0 = (Button) findViewById(R.id.button0);
button1 = (Button) findViewById(R.id.button1);
button2 = (Button) findViewById(R.id.button2);
Page No: 37 | 39
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
button3 = (Button) findViewById(R.id.button3);
button4 = (Button) findViewById(R.id.button4);
button5 = (Button) findViewById(R.id.button5);
button6 = (Button) findViewById(R.id.button6);
button7 = (Button) findViewById(R.id.button7);
button8 = (Button) findViewById(R.id.button8);
button9 = (Button) findViewById(R.id.button9);
submit=(Button) findViewById(R.id.submit);
clear=(Button) findViewById(R.id.clear);
button0.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {

a=button0.getText().toString();
}
});
button1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {

a=button1.getText().toString();
}
});
button2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {

a=button2.getText().toString();
}
});
button3.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {

a=button3.getText().toString();
}
});
button4.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {

a=button4.getText().toString();
}
});
button5.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {

a=button5.getText().toString();
Page No: 38 | 39
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
}
});
button6.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {

a=button6.getText().toString();
}
});
button7.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
a=button7.getText().toString();
}
});
button8.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {

a=button8.getText().toString();
}
});
button9.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {

a=button9.getText().toString();
}
});
submit.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {

Toast.makeText(getApplicationContext(),a,Toast.LENGTH_LONG).show(); }
});
}
}

Page No: 39 | 39
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
WINTER – 2022 EXAMINATION
Subject Name Mobile Application Development Model Answer Subject Code: 22617
Important Instructions to examiners: XXXXX
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.

Q. Sub Note: As Android programs contain many of the auto generated code statements from IDE, Marking
No. Q. while assessing such answers correct logical steps taken to obtain the required output can be Scheme
N. considered.
Answer

1 Attempt any FIVE of the following: 10 M

a) Define OHA and state goal of OHA. 2M

Ans The OHA is the group that is in charge of the Android smartphones operating system. It was (Define : 1
created by Google. The Open Handset Alliance (OHA) is consortium of multiple companies M, Stating
like Samsung, Sony, Intel and many more to provide services and deploy handsets using goal 1 M)
android platform.
The Open Handset Alliance (OHA) is an association whose goal is to develop open standards
for mobile devices, promote innovation in mobile phones and provide a better experience for
consumers at a lower cost.

b) Define Android Virtual Devices (AVD). 2M

Ans An Android Virtual Device (AVD) is a configuration that defines the characteristics of an (Define : 2
Android phone, tablet, Wear OS, Android TV, or Automotive OS device that you want to M ,any valid
simulate in the Android Emulator. The AVD Manager is an interface you can launch from definition
Android Studio that helps you create and manage AVDs. should be
considered)

Page No: 1 | 41
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
c) State how the APK files are built? 2M

Ans  The javac compiler compiles the java source file into the class file. (For each
 The dx tool takes all the class files of your application and generates a single .dex file which step 1/2 M)
is a platform specific tool.
 Then Android Assets Packaging Tool (aapt) handles the packaging process and finally
creates an executable file with extension .apk.
 An APK file contains all of a program's code (such as .dex files), resources, assets,
certificates, and manifest file.

d) Enlist the elements of UI. 2M

Ans Elements of UI. (1/2 mark


for each UI
 EditText element,
 TextView any 4 UI
elements
 ListView
expected)
 GridView
 ScrollView
 ImageView
 ToggleButton
 CheckBox
 RadioButton

OR
Components of UI
 Menu Bar
 Toolbar
 Navigation Bar
 Editor Tabs
 Editor
 Project Explorer
 Status Bar
 Tool Buttons
e) State the uses of Intent in Android. 2M

Ans An Intent is a messaging object you can use to request an action from another app component. (1 M for
Intents are used for facilitating communication between components like Activities, Services each use, 2
and Broadcast Receivers. uses
expected)

f) Name any four methods to get location data in android. 2M

Ans •float distanceTo(Location dest) (1/2 M for


•float getAccuracy() each
•float getBearing() method,
Page No: 2 | 41
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
•double getAltitude() any 4
•double getLatitude() methods
•float getSpeed() expected)
•boolean hasAccuracy()
•boolean hasAltitude()
•boolean hasBearing()
•boolean hasBearing()
•boolean hasSpeed()
•void reset()
•void setAccuracy(float accuracy)
•void setAltitude(double altitude)
g) Explain significance of content provider. 2M

Ans Content Providers are used to share data between two applications. This can be implemented (1 M for
in two ways: each
1. When you want to implement the existing content provider in another application. significance
2. When you want to create a new content provider that can share its data with other ,
Applications

2. Attempt any THREE of the following: 12 M

a) Describe the different features of Android. 4M

Ans User Interface: The user interface of the Android operating system is straight forward, and (1 M for
these features make it very user friendly. each
feature, 4
Multiple Language Support: Android supports multiple languages in its operating system and features
one can change the language very easily based on one’s requirement, the International expected)
languages supported are English, Germany, Chinese, Dutch, French, German, Japanese,
Korean, Russian, and many more also some native language of India is also Supported Like
Hindi, Marathi, Gujarati, Punjabi and many more.
Multi-tasking: Android provides support to run apps and services in the background with ease
which allows the users to use multiple apps at the same time.
Connectivity: Android has extensive support to the connectivity and it supports connectivity
such as WiFi, Bluetooth, Hotspot, CDMA, GSM, NFC, VOLTE, UBB, VPN, 3G network
band, and 4G Network Band.
Extensive Application Support: Android have Play store which is used as the major tool to
download and update applications on the operating system, however, one can download the
installer(often called as APK file) and install it manually, but it is not much recommended as
third party applications could be prone to some security breach in the smartphones.

b) Explain features of Android SDK. 4M

Ans Android SDK is a collection of libraries and Software Development tools that are essential for (1 M for
Developing Android Applications. Whenever Google releases a new version or update of each

Page No: 3 | 41
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
Android Software, a corresponding SDK also releases with it. In the updated or new version of feature, any
SDK, some more features are included which are not present in the previous version. Android 4 features
SDK consists of some tools which are very essential for the development of Android expected)
Application. These tools provide a smooth flow of the development process from developing
and debugging. Android SDK is compatible with all operating systems such as Windows,
Linux, macOS, etc.
1. Android Tool: This tool helps in managing the Android Virtual Device projects as well as
the installed components of the software development kit.
2. Emulator Tool: It helps us in testing the applications without the need of using the
application on an actual device.
3. Dalvik Debug Monitor Server(DDMS): DDMS is very useful for debugging the Android
Application.
4. Android Debug Bridge (ADB): It is a very versatile command-line tool and is helpful for
the communication between the developer and the Emulator or the Android device that is
connected.

c) Explain the Android security model. 4M

Ans The Android security model is primarily based on a sandbox and permission mechanism. Each 2 M for
application is running in a specific Dalvik virtual machine with a unique user ID assigned to it, explanation
which means the application code runs in isolation from the code of all other applications. , 2 M for
Therefore, one application has not granted access to other applications’ files. explaining
permissions
Android application has been signed with a certificate with a private key Know the owner of , any 2
the application is unique. This allows the author of the application will be identified if needed. permissions
When an application is installed in the phone is assigned a user ID, thus avoiding it from expected)
affecting it other applications by creating a sandbox for it. This user ID is permanent on which
devices and applications with the same user ID are allowed to run in a single process. This is a
way to ensure that a malicious application has Cannot access / compromise the data of the
genuine application. It is mandatory for an application to list all the resources it will Access
during installation. Terms are required of an application, in the installation process should be
user-based or interactive Check with the signature of the application.
Declaring and Using Permissions
The purpose of a permission is to protect the privacy of an Android user. Android apps must
request permission to access sensitive user data (such as contacts and SMS), as well as certain
system features (such as camera and internet). Depending on the feature, the system might grant
the permission automatically or might prompt the user to approve the request.
Permissions are divided into several protection levels. The protection level affects whether
runtime permission requests are required. There are three protection levels that affect third-
party apps: normal, signature, and dangerous permissions.
Normal permissions: Normal permissions cover areas where your app needs to access data or
resources outside the app’s sandbox, but where there’s very little risk to the user’s privacy or

Page No: 4 | 41
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
the operation of other apps. For example, permission to set the time zone is a normal
permission. If an app declares in its manifest that it needs a normal permission, the system
automatically grants the app that permission at install time. The system doesn’t prompt the user
to grant normal permissions, and users cannot revoke these permissions.
Signature permissions: The system grants these app permissions at install time, but only when
the app that attempts to use permission is signed by the same certificate as the app that defines
the permission.
Dangerous permissions: Dangerous permissions cover areas where the app wants data or
resources that involve the user’s private information, or could potentially affect the user’s
stored data or the operation of other apps. For example, the ability to read the user’s contacts is
a dangerous permission. If an app declares that it needs a dangerous permission, the user must
explicitly grant the permission to the app. Until the user approves the permission, your app
cannot provide functionality that depends on that permission. To use a dangerous permission,
your app must prompt the user to grant permission at runtime. For more details about how the
user is prompted, see Request prompt for dangerous permission.
d) Elaborate the need of permissions in Android. Explain the permissions to set 4M
system functionalitics like SEND-SMS, bluetooth.

Ans The purpose of a permission is to protect the privacy of an Android user. Android apps must(2 M for
request permission to access sensitive user data (such as contacts and SMS), as well as certain
explanation
system features (such as camera and internet). Depending on the feature, the system might grant
of need, 1
the permission automatically or might prompt the user to approve the request. M each for
explaining
 android. permission. SEND_SMS permissions
Allows the app to send SMS messages. This may result in unexpected charges. of Sms and
Malicious apps may cost you money by sending messages without your confirmation. bluetooth)

Following is the code snippet to set SEND_SMS permissions in manifest file.


<uses-permission android: name="android.permission.SEND_SMS"/>

 android. permission. BLUETOOTH


You need to provide following permissions in AndroidManifest.xml file.
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />

3. Attempt any THREE of the following: 12 M

a) Explain data and time picker with its method. 4M

Ans Date Picker: Date picker


In Android, DatePicker is a widget used to select a date. It allows to select date by day, month (any two
and year in our custom UI (user interface). If we need to show this view as a dialog then we methods) 2
have to use a DatePickerDialog class. M and time
Methods of DatePicker:
picker (any
Page No: 5 | 41
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
1. setSpinnersShown(boolean shown): This method is used to set whether the spinner of the two
date picker in shown or not. In this method you have to set a Boolean value either true or false. methods) 2
True indicates spinner is shown, false value indicates spinner is not shown. Default value for M
this function is true.
Syntax:
DatePicker simpleDatePicker = (DatePicker)findViewById(R.id.simpleDatePicker);
simpleDatePicker.setSpinnersShown(false);
2. getDayOfMonth(): This method is used to get the selected day of the month from a date
picker.
This method returns an integer value.
DatePicker simpleDatePicker = (DatePicker) findViewById(R.id.simpleDatePicker);
int day = simpleDatePicker.getDayOfMonth();
3. getMonth(): This method is used to get the selected month from a date picker. This method
returns an integer value.
DatePicker simpleDatePicker = (DatePicker)findViewById(R.id.simpleDatePicker);
int month = simpleDatePicker.getMonth();
4. getYear(): This method is used to get the selected year from a date picker. This method
returns an integer value.
DatePicker simpleDatePicker = (DatePicker)findViewById(R.id.simpleDatePicker);
int year = simpleDatePicker.getYear();
5. getFirstDayOfWeek(): This method is used to get the first day of the week. This method
returns an integer value.
DatePicker simpleDatePicker = (DatePicker)findViewById(R.id.simpleDatePicker);
int firstDay=simpleDatePicker.getFirstDayOfWeek();
TimePicker:
In Android, TimePicker is a widget used for selecting the time of the day in either AM/PM
mode or 24 hours mode. The displayed time consist of hours, minutes and clock format. If we
need to show this view as a Dialog then we have to use a TimePickerDialog class.
Methods of TimePicker:
1. setCurrentHour(Integer currentHour): This method is used to set the current hours in a
time picker.
setHour(Integer hour): setCurrentHour() method was deprecated in API level 23. From api
level 23 we have to use setHour(Integer hour). In this method there is only one parameter of
integer type which is used to set the value for hours.
TimePicker simpleTimePicker=(TimePicker)findViewById(R.id.simpleTimePicker);
simpleTimePicker.setCurrentHour(5);
simpleTimePicker.setHour(5);
2. setCurrentMinute(Integer currentMinute): This method is used to set the current minutes
in a time picker. setMinute(Integer minute): setCurrentMinute() method was deprecated in API
level 23. From api level 23 we have to use setMinute(Integer minute). In this method there is
only one parameter of integer type which set the value for minutes.
TimePicker simpleTimePicker=(TimePicker)findViewById(R.id.simpleTimePicker);
simpleTimePicker.setCurrentMinute(35);
simpleTimePicker.setMinute(35);
4. getCurrentMinute(): This method is used to get the current minutes from a time picker.

Page No: 6 | 41
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
getMinute(): getCurrentMinute() method was deprecated in API level 23. From api level 23
we have to use getMinute(). This method returns an integer value.
TimePicker simpleTimePicker = (TimePicker)findViewById(R.id.simpleTimePicker);
int minutes = simpleTimePicker.getCurrentMinute();
int minutes = simpleTimePicker.getMinute();
5. setIs24HourView(Boolean is24HourView): This method is used to set the mode of the
Time picker either 24 hour mode or AM/PM mode. In this method we set a Boolean value
either true or false. True value indicate 24 hour mode and false value indicate AM/PM mode.
TimePicker simpleTimePicker = (TimePicker)findViewById(R.id.simpleTimePicker);
simpleTimePicker.setIs24HourView(true);
6. is24HourView(): This method is used to check the current mode of the time picker. This
method returns true if its 24 hour mode or false if AM/PM mode is set.
TimePicker simpleTimePicker = (TimePicker)findViewById(R.id.simpleTimePicker);
Boolean mode=simpleTimePicker.is24HourView();
7.setOnTimeChangedListener(TimePicker.OnTimeChangedListener
onTimeChanged(): This method is used to set the callback that indicates the time has been
adjusted by the user.
onTimeChanged(TimePicker view, int hourOfDay, int minute) is an override function of this
listener in which we have three parameters first is for TimePicker, second for getting hour of
the day and last is for getting the minutes after changing the time of the time picker.
TimePicker simpleTimePicker = (TimePicker)findViewById(R.id.simpleTimePicker);
simpleTimePicker.setOnTimeChangedListener(new TimePicker.OnTimeChangedListener() {
@Override
public void onTimeChanged(TimePicker view, int hourOfDay, int minute) {
}
});
b) Explain the steps to install and configure Android studio and SDK. 4M

Ans  Download the latest version of Android Studio from above URL and launch Android 4 M for
Studio.exe file by double clicking on it. steps
 The initial android studio setup screen will open in that click Next to continue for further
steps of environment setup
 Now we need to select a required components to setup an android environment. Here
we selected all three components (Android Studio, Android SDK and Android Virtual
Device) and click Next.
 Now we need to agree the License agreements to proceed further, click on I Agree
button
 Now we need to specify the local machine drive location to install Android Studio and
Android SDK.
 After selecting the location path to install required components, click Next.
 Now select the start menu folder to create a shortcut for android studio and click Install
 Once we click Install button the installation process will start and click Next after
completion of Installation.
 After that it will show installation completion wizard in that click Finish to launch
android studio While launching Android Studio it will give you an option to import

Page No: 7 | 41
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
settings from previous version of studio. In case if you don’t have any previous version,
select second option and click OK
 Now android studio will open a welcome wizard window in that click Next to validate
our current Android SDK and development environment setup
 Now select a Standard installation type and click Next to install a common settings and
options
 Now verify settings and click Finish to complete android studio setup process
 After completion of required components installation click on Finish
 After completion of all required components installation, we will be able to see Android
Studio welcome window
c) Explain the activity life cycle. 4M

Ans Diagram 2
M
explanation
2M

Activities have a predefined life-cycle methods as follows:

Page No: 8 | 41
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
onCreate (): Called then the activity is created. Used to initialize the activity, for
example create the user interface.

onStart ():called when activity is becoming visible to the user.

onResume (): Called if the activity get visible again and the user starts interacting
with the activity again. Used to initialize fields, register listeners, bind
to services, etc.

onPause (): Called once another activity gets into the foreground. Always called
before the activity is not visible anymore. Used to release resources or
save application data. For example you unregister listeners, intent
receivers, unbind from services or remove system service listeners.

onStop (): Called once the activity is no longer visible. Time or CPU intensive shutdown
operations, such as writing information to a database should be down in the onStop() method.
This method is guaranteed to be called as
of API 11.

onDestroy (): called before the activity is destroyed.

d) Explain the steps to deploy app on Google Play Store. 4M

Ans Step 1: Create a Developer Account 4 M for all


Before you can publish any app on Google Play, you need to create a Developer Account. You steps
can easily sign up for one using your existing Google Account. You’ll need to pay a one-time
registration fee of $25 using your international credit or debit card. It can take up to 48 hours
for your registration to be fully processed.

Step 2: Plan to Sell? Link Your Merchant Account


If you want to publish a paid app or plan to sell in-app purchases, you need to create a payments
center profile, i.e. a merchant account. A merchant account will let you manage your app sales
and monthly payouts, as well as analyze your sales reports right in your Play Console.

Step 3: Create an App


After creating application by clicking on ‘Create Application'. Here you have to select your
app’s default language from the drop-down menu and then type in a title for your app. The title
of your app will show on Google Play after you’ve published.

Step 4: Prepare Store Listing


Before you can publish your app, you need to prepare its store listing. These are all the details
that will show up to customers on your app’s listing on Google Play. You not necessarily
complete it at once, you can always save a draft and revisit it later when you’re ready to publish.
The information required for your store listing is divided into several categories such as
Product Details containing title, short and full description of the app, your app’s title and
description should be written with a great user experience in mind. Use the right keywords, but
don’t overdo it. Make sure your app doesn’t come across as spam-y or promotional, or it will
risk getting suspended on the Play Store.
Page No: 9 | 41
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
Graphic Assets where you can add screenshots, images, videos, promotional graphics, and
icons that showcase your app’s features and functionality.
Languages & Translations, Categorization where in category can be selected to which your
app belong to. Contact Details, Privacy Policy for apps that request access to sensitive user
data or permissions, you need to enter a comprehensive privacy policy that effectively discloses
how your app collects, uses, and shares that data.

Step 5: Upload APK to an App Release


Finally upload your app, by uploading APK file. Before you upload APK, you need to create
an app release. You need to select the type of release you want to upload your first app version
to. You can choose between an internal test, a closed test, an open test, and a production release.
The first three releases allow you to test out your app among a select group of users before you
make it go live for everyone to access.
This is a safer option because you can analyze the test results and optimize or fix your app
accordingly if you need to before rolling it out to all users.
Once you create a production release, your uploaded app version will become accessible to
everyone in the countries you choose to distribute it in and click on ‘Create release.’

Step 6: Provide an Appropriate Content Rating


If you don’t assign a rating to your app, it will be listed as ‘Unrated’. Apps that are ‘Unrated’
may get removed from Google Play.
To rate your app, you need to fill out a content rating questionnaire An appropriate content
rating will also help you get to the right audience, which will eventually improve your
engagement rates.

Step 7: Set Up Pricing & Distribution


Before you can fill out the details required in this step, you need to determine your app’s
monetization strategy. Once you know how your app is going to make money, you can go ahead
and set up your app as free or paid.
You can always change your app from paid to free later, but you cannot change a free app to
paid. For that, you’ll need to create a new app and set its price.

Step 8: Rollout Release to Publish Your App


The final step involves reviewing and rolling out your release after making sure you’ve taken
care of everything else.
Before you review and rollout your release, make sure the store listing, content rating, and
pricing and distribution sections of your app each have a green check mark next to them.
Once you’re sure about the correctness of the details, select your app and navigate to ‘Release
management’ – ‘App releases.’ You can always opt for reviews by clicking on ‘Review’ to be
taken to the ‘Review and rollout release’ screen. Here, you can see if there are any issues or
warnings you might have missed out on.
Finally, select ‘Confirm rollout.’ This will also publish your app to all users in your target
countries on Google Play.

Page No: 10 | 41
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________

4. Attempt any THREE of the following: 12 M

a) Explain the fundamentals of Ul design in detail. 4M

Ans 1. Views: 1 M for


• The basic building block for user interface in Android is a View, which is created from the each
View class and occupies a rectangular area on the screen and is responsible for drawing and
event handling.
• Views are the base class for all visual interface elements (commonly known as controls or
widgets). All user interface UI controls, including the layout classes, are derived from View.
• A View is an object/widget that draws something on the sreen by the help of user interact.
• Examples of widgets are buttons, text boxes, labels etc.
2. View Groups:
• The ViewGroup is a subclass of View and provides invisible container that hold other Views
or other ViewGroups and define their layout properties.
• View groups are extensions of the View class that can contain multiple child Views. In order
to Extend the ViewGroup class to create compound controls made up of interconnected child
views.
• A ViewGroup provides the layout in which we can order the appearance and sequence of
views.
Examples of ViewGroup are FrmaeLayout, LineourLayout etc.
3. Fragments:
• Fragments represents a portion of user interface in an Activity. Fragments, introduced in
Android 3.0 which uses API level 11, are used to encapsulate portions of your UI. This
encapsulation makes fragments particularly useful when optimizing our UI layouts for different
screen sizes and creating reusable user interface (UI) elements.
• Each Fragment includes its own user interface (UI) layout and receives the related input events
but is tightly bound to the activity into which each must be embedded. Fragments are similar
to UI view controller in iPhone development.
4. Activities:
• Activities dictate the UI and handle the user interaction to the smart phone screen. Activities
represent a single screen that user interact.
• Activities are the Android equivalent of Forms in traditional windows desktop development.
To display a UI we assign a View (Usually a layout or Fragment) to an Activity
b) Write a program to display a rectangular progress bar. 4M

Ans Xml File: xml file


<?xml version="1.0" encoding="utf-8"?> 2M,
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" java file 2
android:layout_width="match_parent" M
android:layout_height="match_parent"
tools:context=".MainActivity">
Page No: 11 | 41
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________

<ProgressBar
android:id="@+id/progressBar"
style="@android:style/Widget.ProgressBar.Horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="20dp"
android:indeterminate="false"
android:max="100"
android:minHeight="50dp"
android:minWidth="200dp"
android:progress="1" />
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/progressBar"
android:layout_below="@+id/progressBar"/>
</RelativeLayout>
Java file:
package in.edu.vpt.progressbar;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.widget.ProgressBar;
import android.widget.TextView;
public class MainActivity extends AppCompatActivity {
private ProgressBar progressBar;
private int progressStatus = 0;
private TextView textView;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
progressBar = (ProgressBar) findViewById(R.id.progressBar);
textView = (TextView) findViewById(R.id.textView);
// Start long running operation in a background thread
new Thread(new Runnable() {
public void run() {

Page No: 12 | 41
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
while (progressStatus < 100) {
progressStatus += 1;
new Handler(Looper.getMainLooper()).post(new Runnable() {
public void run() {
progressBar.setProgress(progressStatus);
textView.setText(progressStatus+"/"+progressBar.getMax());
}
});
try {
// Sleep for 200 milliseconds.
Thread.sleep(200);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}).start();
}
}
c) Explain Android system architecture in detail. 4M

Ans Diagram

2 M,

Explanation
2M

1. Applications:
• The top layer of android architecture is Applications. The native and third party applications
like Contacts, Email, Music, Gallery, Clock, Games, etc. whatever we will build those will be
installed on this layer only.
Page No: 13 | 41
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
• The application layer runs within the Android run time using the classes and services made
available from the application framework.
2. Application Framework:
• The Application Framework provides the classes used to create an Android application. It also
provides a generic abstraction for hardware access and manages the user interface and
application resources.
• It basically provides the services through which we can create the particular class and make
that class helpful for the Applications creation.
• The application framework includes services like telephony service, location services,
notification manager, NFC service, view system, etc. which we can use for application
development as per our requirements.
3. Android Runtime:
• Android Runtime environment is an important part of Android rather than an internal part and
it contains a components like core libraries and the Dalvik virtual machine.
• The Android run time is the engine that powers our applications along with the libraries and
it forms the basis for the application framework.
(i) Dalvik Virtual Machine (DVM) is a register-based virtual machine like Java Virtual
Machine (JVM).
It is specially designed and optimized for android to ensure that a device can run multiple
instances efficiently. It relies on the Linux kernel for threading and low-level memory
management.
(ii) The core libraries in android runtime will enable us to implement an android applications
using standard JAVA programming language.
4. Platform Libraries:
• The Platform Libraries includes various C/C++ core libraries and Java based libraries such as
SSL, libc, Graphics, SQLite, Webkit, Media, Surface Manger, OpenGL etc. to provide a
support for android development.
5. Linux Kernel:
• Linux Kernel is a bottom layer and heart of the android architecture. It is heart of Android
architecture that exists at the root of android architecture and contains all the low-level device
drivers for the various hardware components of an Android device.
• Linux Kernel is responsible for device drivers, power management, memory management,
device management and resource access. It manage all the drivers such as display drivers,
camera drivers, Bluetooth drivers, audio drivers, memory drivers, etc. which are mainly
required for the android device during the runtime.
• The Linux Kernel will provide an abstraction layer between the device hardware and the
remainder of the stack. It is responsible for memory management, power management, device
management, resource access, etc.
d) Explain the procedure of Geo-coding and reverse Geo-coding. 4M

Ans Geo-Coding: geocoding 2


• If we know the latitude and longitude of a location, we can find out its address using a process M
known as Geocoding. Google Maps in Android supports this via the Geocoder class.

Page No: 14 | 41
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
• The following code shows how we can find out the address of a location we have just touched and
using the getFromLocation() method: reverse
classMapOverlay extends com.google.android.maps.Overlay geocoding 2
M
{
@Override
publicboolean draw(Canvas canvas, MapViewmapView,
boolean shadow, long when)
{
//...
}
@Override
publicbooleanonTouchEvent(MotionEvent event, MapViewmapView)
{
//---when user lifts his finger---
if (event.getAction() == 1) {
GeoPoint p = mapView.getProjection().fromPixels(
(int) event.getX(),
(int) event.getY());
Geocoder geoCoder = new Geocoder(
getBaseContext(), Locale.getDefault());
try {
List<Address> addresses = geoCoder.getFromLocation(
p.getLatitudeE6() / 1E6,
p.getLongitudeE6() / 1E6, 1);
String add = "";
if (addresses.size() > 0)
{
for (inti=0; i<addresses.get(0).getMaxAddressLineIndex();
i++)
add += addresses.get(0).getAddressLine(i) + "n";
}
Toast.makeText(getBaseContext(), add, Toast.LENGTH_SHORT).show();
}
catch (IOException e) {
e.printStackTrace();
}
return true;
}
else
return false;
}
}

Page No: 15 | 41
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
Reverse-geocoding:
If we know the address of a location but want to know its latitude and longitude, we can do so
via reverse-Geocoding. Again, we can use the Geocoder class for this purpose.
• The following code shows how we can find the exact location of the Empire State Building
by using the getFromLocationName() method:
Geocoder geoCoder = new Geocoder(this, Locale.getDefault());
try {
List<Address> addresses = geoCoder.getFromLocationName(
"empire state building", 5);
String add = "";
if (addresses.size() > 0) {
p = new GeoPoint(
(int) (addresses.get(0).getLatitude() * 1E6),
(int) (addresses.get(0).getLongitude() * 1E6));
mc.animateTo(p);
mapView.invalidate();
}
} catch (IOException e) {
e.printStackTrace();
}
Once. the location is found, the above code navigates the map to the location.
e) Develop an application to send and receive SMS (Write only Java and 4M
permission tag in manifest file).
Ans Permissions and <receiver> tag required in AndroidManifest.xml Manifest
<uses-permission android:name="android.permission.RECEIVE_SMS" /> File:1M
<uses-permission android:name="android.permission.SEND_SMS"/>
<uses-permission android:name="android.permission.READ_SMS"/> Java Code:
<uses-permission android:name="android.permission.WRITE_SMS"/> 3M

<receiver
android:name=".SmsReceiver"
android:enabled="true"
android:exported="true">
<intent-filter>
<action android:name="android.provider.Telephony.SMS_RECEIVED" />
</intent-filter>
</receiver>

MainActivity.java
(Cosidering appropriate layout file with 2 edit text boxes namely for phone number,
message and a button for sending sms)

package com.example.testreceivesms;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;

Page No: 16 | 41
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
import androidx.core.content.ContextCompat;
import android.Manifest;
import android.content.IntentFilter;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.telephony.SmsManager;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity {


SmsReceiver sms= new SmsReceiver();
EditText et1,et2;
Button b1;
@Override
protected void onCreate (Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
et1=findViewById(R.id.etPhno);
et2=findViewById(R.id.etmsg);
b1=findViewById(R.id.btnSms);
if(ContextCompat.checkSelfPermission(MainActivity.this,Manifest.permission.SEND_S
MS)!=
PackageManager.PERMISSION_GRANTED)
{
ActivityCompat.requestPermissions(MainActivity.this,new
String[]{Manifest.permission.SEND_SMS},100);
}
b1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
try {
String phno= et1.getText().toString();
String msg=et2.getText().toString();
SmsManager smsManager= SmsManager.getDefault();
smsManager.sendTextMessage(phno,null,msg,null,null);
Toast.makeText(MainActivity.this,"Sms sent successfully",
Toast.LENGTH_LONG).show();
}
catch(Exception e)
{
Toast.makeText(MainActivity.this,"Sms failed to send... try again",
Toast.LENGTH_LONG).show();
}
}
});
}
@Override
Page No: 17 | 41
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
protected void onStart() {
super.onStart();
IntentFilter filter=new IntentFilter("android.provider.Telephony.SMS_RECEIVED");
registerReceiver(sms,filter);
}

@Override
protected void onStop() {
super.onStop();
unregisterReceiver(sms);
}
}

SmsReceiver.java
package com.example.testreceivesms;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.telephony.SmsMessage;
import android.widget.Toast;

public class SmsReceiver extends BroadcastReceiver {


SmsReceiver(){}
@Override
public void onReceive(Context context, Intent intent) {
Bundle bundle = intent.getExtras();

if (bundle != null) {
// Retrieve the SMS Messages received
Object[] sms = (Object[]) bundle.get("pdus");

// For every SMS message received


for (int i=0; i < sms.length; i++) {
// Convert Object array
SmsMessage smsMessage = SmsMessage.createFromPdu((byte[]) sms[i]);

String phone = smsMessage.getOriginatingAddress();


String message = smsMessage.getMessageBody().toString();

Toast.makeText(context, “Received from “+ phone + ": " + message,


Toast.LENGTH_SHORT).show();
}
}
}
}

5. Attempt any TWO of the following: 12 M

Page No: 18 | 41
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
a) Develop a program to send and receive an Email. 6M

Ans Program to send Email Any correct


activity_main.xml logic
<?xml version="1.0" encoding="utf-8"?> program
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" should be
xmlns:tools="http://schemas.android.com/tools" considered,
android:layout_width="match_parent" 3M for
android:layout_height="match_parent" send logic,
tools:context=".MainActivity"> 3M for
receive
<EditText logic
android:id="@+id/editText1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_marginTop="18dp"
android:layout_marginRight="22dp" />

<EditText
android:id="@+id/editText2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/editText1"
android:layout_alignLeft="@+id/editText1"
android:layout_marginTop="20dp" />

<EditText
android:id="@+id/editText3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/editText2"
android:layout_alignLeft="@+id/editText2"
android:layout_marginTop="30dp" />

<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/editText1"
android:layout_alignBottom="@+id/editText1"
android:layout_alignParentLeft="true"
android:text="Send To:"
android:textColor="#0F9D58" />

<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
Page No: 19 | 41
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/editText2"
android:layout_alignBottom="@+id/editText2"
android:layout_alignParentLeft="true"
android:text="Email Subject:"
android:textColor="#0F9D58" />

<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/editText3"
android:layout_alignBottom="@+id/editText3"
android:text="Email Body:"
android:textColor="#0F9D58" />

<Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/editText3"
android:layout_alignLeft="@+id/editText3"
android:layout_marginLeft="76dp"
android:layout_marginTop="20dp"
android:text="Send email!!" />
</RelativeLayout>

MainActivity.java
import android.content.Intent;
import android.os.Bundle;
import android.widget.Button;
import android.widget.EditText;
import androidx.appcompat.app.AppCompatActivity;
public class MainActivity extends AppCompatActivity {
// define objects for edit text and button
Button button;
EditText sendto, subject, body;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

// Getting instance of edittext and button


sendto = findViewById(R.id.editText1);
subject = findViewById(R.id.editText2);
body = findViewById(R.id.editText3);
button = findViewById(R.id.button);

Page No: 20 | 41
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
// attach setOnClickListener to button with Intent object define in it
button.setOnClickListener(view -> {
String emailsend = sendto.getText().toString();
String emailsubject = subject.getText().toString();
String emailbody = body.getText().toString();

// define Intent object with action attribute as ACTION_SEND


Intent intent = new Intent(Intent.ACTION_SEND);

// add three fields to intent using putExtra function


intent.putExtra(Intent.EXTRA_EMAIL, new String[]{emailsend});
intent.putExtra(Intent.EXTRA_SUBJECT, emailsubject);
intent.putExtra(Intent.EXTRA_TEXT, emailbody);

// set type of intent


intent.setType("message/rfc822");

// startActivity with intent with chooser as Email client using


createChooser function
startActivity(Intent.createChooser(intent, "Choose an Email client :"));
});
}
}

Program to receive Email


(Note: Receiving email is not the service of Android OS, instead it uses some third party
applicaton like Gmail, so instead of receiving email in android app, a code which broadcasts
message if email comes using broadcast receiver or any relevant logic can be considered.)
MainActivity.java
package com.example.myemailprog;
import androidx.appcompat.app.AppCompatActivity;
import android.content.IntentFilter;
import android.os.Bundle;

public class MainActivity extends AppCompatActivity {


GmailReceiver gml;
IntentFilter intf;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
gml = new GmailReceiver();
intf = new IntentFilter("android.intent.action.VIEW");
}

@Override
protected void onResume() {
super.onResume();

Page No: 21 | 41
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
registerReceiver(gml, intf);
}

@Override
protected void onDestroy() {
super.onDestroy();
unregisterReceiver(gml);
}
}
Gmailrerciever..java
package com.example.myemailprog;

import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.graphics.BitmapFactory;
import android.widget.Toast;

public class GmailReceiver extends BroadcastReceiver


{
@Override
public void onReceive(Context context, Intent intent)
{
Toast.makeText(context, "Email Received", Toast.LENGTH_LONG).show();

}
}

AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.myemailprog">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.MyEmailProg">
<activity
android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
Page No: 22 | 41
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
</intent-filter>
</activity>
<receiver android:name="GmailReceiver"
android:exported="false">
<intent-filter>
<action android:name="android.intent.action.PROVIDER_CHANGED"
android:priority="-10">
</action>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="content" android:host="gmail-ls"
android:pathPattern="/unread/.*">
</data>
</intent-filter>
</receiver>
</application>
</manifest>
b) Develop a program for providing bluetooth connectivity. 6M

Ans activity_main.xml Layout file


<RelativeLayout xmlns:androclass="http://schemas.android.com/apk/res/android" : 2M
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" Java File :
android:layout_height="match_parent" 3M
tools:context=".MainActivity" >
Manifest
file : 1M
<TextView android:text=""
android:id="@+id/out"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</TextView>
<Button

android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="30dp"
android:layout_marginTop="49dp"
android:text="TURN_ON" />

<Button
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/button1"
android:layout_below="@+id/button1"
android:layout_marginTop="27dp"
android:text="DISCOVERABLE" />

Page No: 23 | 41
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________

<Button
android:id="@+id/button3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/button2"
android:layout_below="@+id/button2"
android:layout_marginTop="28dp"
android:text="TURN_OFF" />

</RelativeLayout>

AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:androclass="http://schemas.android.com/apk/res/android"
package="com.example.bluetooth"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="16" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.bluetooth.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>

MainActivity.java
package com.example.bluetooth;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.app.Activity;
import android.bluetooth.BluetoothAdapter;
import android.content.Context;
import android.content.Intent;
Page No: 24 | 41
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

public class MainActivity extends Activity {


private static final int REQUEST_ENABLE_BT = 0;
private static final int REQUEST_DISCOVERABLE_BT = 0;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
final TextView out=(TextView)findViewById(R.id.out);
final Button button1 = (Button) findViewById(R.id.button1);
final Button button2 = (Button) findViewById(R.id.button2);
final Button button3 = (Button) findViewById(R.id.button3);
final BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
if (mBluetoothAdapter == null) {
out.append("device not supported");
}
button1.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
if (!mBluetoothAdapter.isEnabled()) {
Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);
}
}
});
button2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View arg0) {
if (!mBluetoothAdapter.isDiscovering()) {
//out.append("MAKING YOUR DEVICE DISCOVERABLE");
Toast.makeText(getApplicationContext(), "MAKING YOUR DEVICE DISCOVERA
BLE",
Toast.LENGTH_LONG);

Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVER


ABLE);
startActivityForResult(enableBtIntent, REQUEST_DISCOVERABLE_BT);

}
}
});
button3.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View arg0) {
Page No: 25 | 41
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
mBluetoothAdapter.disable();
//out.append("TURN_OFF BLUETOOTH");
Toast.makeText(getApplicationContext(), "TURNING_OFF BLUETOOTH", Toast.LENGT
H_LONG);
}
});
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}

}
c) Develop a program to implement 6M

i) List view of 5 items


ii) Grid view of 4 x 4 items
iii) Image view.

Ans <?xml version="1.0" encoding="utf-8"?> Correct


<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" Logics for
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto" ListView :
android:layout_width="match_parent" 2M
android:layout_height="match_parent"
GridView :
android:orientation="vertical"
2M
tools:context=".MainActivity">
ImageView
<ListView : 2M
android:id="@+id/sample_list"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
</ListView>

<GridView
android:id="@+id/gridview1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:columnWidth="50dp"
android:gravity="center"
android:numColumns="auto_fit"
android:stretchMode="columnWidth" >
</GridView>

<ImageView
android:id="@+id/full_logo"
android:layout_width="match_parent"

Page No: 26 | 41
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
android:layout_height="wrap_content"
app:srcCompat="@drawable/android_logo" />

</LinearLayout>
Placed image that has to be displayed in drawable folder

package in.msbte.controls_exam_ques;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.GridView;
import android.widget.ListView;

public class MainActivity extends AppCompatActivity {


String[] sampleArray = {"Item 1","Item 2","Item 3","Item 4", "Item 5"};
GridView gridView;
static final String[] alphabets = new String[]{
"A", "B", "C", "D", "E",
"F", "G", "H", "I", "J",
"K", "L", "M", "N", "O",
"P", "Q", "R", "S", "T",
"U", "V", "W", "X", "Y", "Z"
};
ArrayAdapter adapter, adapter1;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

//List View
adapter = new ArrayAdapter<String>(this, R.layout.simple_item, sampleArray);
ListView listView = (ListView) findViewById(R.id.sample_list);
listView.setAdapter(adapter);

//Grid View
gridView = (GridView) findViewById(R.id.gridview1);
adapter1 = new ArrayAdapter<String>(this, R.layout.simple_item, alphabets);
gridView.setAdapter(adapter1);

}
}
6. Attempt any TWO of the following: 12 M

Page No: 27 | 41
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
a) Develop an application to store customer's details like, customer-id, customer-name, 6M
mobile number, address, pin-code and retrieve customer information using customer-id
in SQLite databases.
(Any other relevant logic can be considered)
Ans activity_main.xml Layout File
<?xml version="1.0" encoding="utf-8"?> : 1M
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" Java File :
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" Correct
android:layout_height="match_parent" Logics for
tools:context=".MainActivity">
Create
table : 1M
<TextView Insertion of
android:text="Insert Customer Details" record : 2M
android:layout_width="wrap_content" Retrival of
android:layout_height="wrap_content" data : 2M
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:id="@+id/textView"
android:gravity="center"
android:textSize="20dp"
android:textColor="#000000"/>

<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="ID"
android:id="@+id/editid"
android:layout_below="@+id/textView"/>

<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="Name"
android:id="@+id/editname"
android:layout_below="@+id/editid"/>

<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="Mobile No."
android:id="@+id/editmobile"
android:layout_below="@+id/editname"/>
Page No: 28 | 41
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________

<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="Address"
android:lines="3"
android:id="@+id/editaddress"
android:layout_below="@+id/editmobile"/>

<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="Pin Code"
android:id="@+id/editpincode"
android:layout_below="@+id/editaddress"/>

<Button
android:text="Insert Data"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/editpincode"
android:layout_centerHorizontal="true"
android:id="@+id/button" />

<TextView
android:text="Search Customer Details"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:layout_centerHorizontal="true"
android:id="@+id/textView1"
android:gravity="center"
android:textSize="20dp"
android:layout_below="@+id/button"
android:textColor="#000000"/>

<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="Enter ID"
android:id="@+id/editsearchid"
android:layout_below="@+id/textView1"/>

Page No: 29 | 41
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
<Button
android:text="Search Data"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/editsearchid"
android:layout_centerHorizontal="true"
android:id="@+id/button1" />
</RelativeLayout>

MainActivity.java
package in.msbte.database;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity {


SQLiteDatabase sqLiteDatabaseObj;
EditText editTextID, editTextName, editMobileNo, editAddress, editPincode,
editSearchid;
String cid, cname, cmobile, caddress, cpincode, sql_query, sid;
Button EnterData, SearchData;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
EnterData = (Button)findViewById(R.id.button);
SearchData = (Button)findViewById(R.id.button1);
editTextID = (EditText)findViewById(R.id.editid);
editTextName = (EditText)findViewById(R.id.editname);
editMobileNo = (EditText)findViewById(R.id.editmobile);
editAddress = (EditText)findViewById(R.id.editaddress);
editPincode = (EditText)findViewById(R.id.editpincode);
editSearchid = (EditText)findViewById(R.id.editsearchid);

EnterData.setOnClickListener(new View.OnClickListener() {
@Override
Page No: 30 | 41
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
public void onClick(View view) {
sqLiteDatabaseObj = openOrCreateDatabase("AndroidJSonDataBase",
Context.MODE_PRIVATE, null);
sqLiteDatabaseObj.execSQL("CREATE TABLE IF NOT EXISTS
AndroidJSonTable(id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, cid
VARCHAR, name VARCHAR, mobile VARCHAR, address VARCHAR, pincode
VARCHAR);");
cid = editTextID.getText().toString();
cname = editTextName.getText().toString() ;
cmobile = editMobileNo.getText().toString();
caddress = editAddress.getText().toString();
cpincode = editPincode.getText().toString();
sql_query = "INSERT INTO AndroidJSonTable (cid, name, mobile, address,
pincode) VALUES('"+cid+"', '"+cname+"', '"+cmobile+"', '"+caddress+"', '"+cpincode+"');";
sqLiteDatabaseObj.execSQL(sql_query);
Toast.makeText(getApplicationContext(), "Data Inserted Successfully",
Toast.LENGTH_LONG).show();
}
});

SearchData.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
sid = editSearchid.getText().toString();
Cursor cursor = sqLiteDatabaseObj.rawQuery( "select * from AndroidJSonTable
where cid="+sid+"", null );
StringBuffer buffer= new StringBuffer();
while (cursor.moveToNext())
{
String cid =cursor.getString(1);
String name =cursor.getString(2);
String mob =cursor.getString(3);
String addr =cursor.getString(4);
String pcode =cursor.getString(5);
buffer.append(cid+ " " + name + " " + mob +" " + addr +" " + pcode +"
\n");
Toast.makeText(getApplicationContext(), buffer,
Toast.LENGTH_LONG).show();
} }); } }
b) Write a program to find the direction from user's current location to MSBTE, 6M
Bandra. (Write only Java and manitest file).
(Note : Any other relevant logic to get the required output can also be considered.)

Page No: 31 | 41
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
Ans AndroidManifest.xml Manifest
file :2M
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" Java File :
package="com.example.msbte.google_map_currentlocationroute"> 4M

<uses-permission android:name="android.permission.INTERNET" />


<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"
/>
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">

<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="@string/google_maps_key" />

<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>

MainActivity.java

import android.Manifest;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.location.Location;
import android.net.Uri;
import android.provider.Settings;
import android.support.v4.app.ActivityCompat;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;

Page No: 32 | 41
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.location.LocationRequest;
import com.google.android.gms.location.LocationServices;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.MapFragment;
import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.model.CameraPosition;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.MarkerOptions;
import com.google.android.gms.maps.model.Polyline;
import com.google.android.gms.maps.model.PolylineOptions;
import com.karumi.dexter.Dexter;
import com.karumi.dexter.MultiplePermissionsReport;
import com.karumi.dexter.PermissionToken;
import com.karumi.dexter.listener.DexterError;
import com.karumi.dexter.listener.PermissionRequest;
import com.karumi.dexter.listener.PermissionRequestErrorListener;
import com.karumi.dexter.listener.multi.MultiplePermissionsListener;
import java.util.List;

public class MainActivity extends AppCompatActivity implements


GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener,
com.google.android.gms.location.LocationListener , OnMapReadyCallback,
TaskLoadedCallback{

//variables for map and route

private GoogleMap mMap;


private MarkerOptions place1, place2;
Button getDirection;
private Polyline currentPolyline;
private MapFragment mapFragment;
private boolean isFirstTime = true;

//variables for current location


private static final String TAG = "MainActivity";

private TextView tvLocation;


private GoogleApiClient mGoogleApiClient;
private Location mLocation;
private LocationRequest mLocationRequest;
private com.google.android.gms.location.LocationListener listener;
private long UPDATE_INTERVAL = 2 * 1000; /* 10 secs */
Page No: 33 | 41
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
private long FASTEST_INTERVAL = 2000; /* 2 sec */

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

//code for getting current location


requestMultiplePermissions();
tvLocation = (TextView) findViewById((R.id.tv));
mGoogleApiClient = new GoogleApiClient.Builder(this)
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.addApi(LocationServices.API)
.build();
}

//code for drawing route

@Override
public void onMapReady(GoogleMap googleMap) {
mMap = googleMap;
mMap.clear();
Log.d("mylog", "Added Markers");
mMap.addMarker(place1);
mMap.addMarker(place2);

CameraPosition googlePlex = CameraPosition.builder()


.target(new LatLng(22.7739,71.6673))
.zoom(7)
.bearing(0)
.tilt(45)
.build();

mMap.animateCamera(CameraUpdateFactory.newCameraPosition(googlePlex), 5000,
null);
}

private String getUrl(LatLng origin, LatLng dest, String directionMode) {


// Origin of route
String str_origin = "origin=" + origin.latitude + "," + origin.longitude;
// Destination of route
String str_dest = "destination=" + dest.latitude + "," + dest.longitude;
// Mode
String mode = "mode=" + directionMode;
// Building the parameters to the web service
String parameters = str_origin + "&" + str_dest + "&" + mode;
// Output format
String output = "json";
Page No: 34 | 41
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
// Building the url to the web service
String url = "https://maps.googleapis.com/maps/api/directions/" + output + "?" +
parameters + "&key=" + getString(R.string.google_maps_key);
return url;
}

@Override
public void onTaskDone(Object... values) {
if (currentPolyline != null)
currentPolyline.remove();
currentPolyline = mMap.addPolyline((PolylineOptions) values[0]);
}

//runtime permission method

private void requestMultiplePermissions(){


Dexter.withActivity(this)
.withPermissions(
Manifest.permission.ACCESS_FINE_LOCATION,
Manifest.permission.ACCESS_COARSE_LOCATION )
.withListener(new MultiplePermissionsListener() {
@Override
public void onPermissionsChecked(MultiplePermissionsReport report) {
// check if all permissions are granted
if (report.areAllPermissionsGranted()) {
Toast.makeText(getApplicationContext(), "All permissions are granted by
user!", Toast.LENGTH_SHORT).show();
}

// check for permanent denial of any permission


if (report.isAnyPermissionPermanentlyDenied()) {
// show alert dialog navigating to Settings
openSettingsDialog();
}
}

@Override
public void onPermissionRationaleShouldBeShown(List<PermissionRequest>
permissions, PermissionToken token) {
token.continuePermissionRequest();
}
}).
withErrorListener(new PermissionRequestErrorListener() {
@Override
public void onError(DexterError error) {
Toast.makeText(getApplicationContext(), "Some Error! ",
Toast.LENGTH_SHORT).show();
}
})
Page No: 35 | 41
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
.onSameThread()
.check();
}

private void openSettingsDialog() {


AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
builder.setTitle("Required Permissions");
builder.setMessage("This app require permission to use awesome feature. Grant them in
app settings.");
builder.setPositiveButton("Take Me To SETTINGS", new
DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
Intent intent = new
Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
Uri uri = Uri.fromParts("package", getPackageName(), null);
intent.setData(uri);
startActivityForResult(intent, 101);
}
});
builder.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
}
});
builder.show();
}

//methods for getting current location


@Override
public void onConnected(Bundle bundle) {
if (ActivityCompat.checkSelfPermission(this,
Manifest.permission.ACCESS_FINE_LOCATION) !=
PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this,
Manifest.permission.ACCESS_COARSE_LOCATION) !=
PackageManager.PERMISSION_GRANTED) {
return;
}

startLocationUpdates();
mLocation = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient);
if(mLocation == null){
startLocationUpdates();
}
if (mLocation != null) {
// mLatitudeTextView.setText(String.valueOf(mLocation.getLatitude()));
//mLongitudeTextView.setText(String.valueOf(mLocation.getLongitude()));
Page No: 36 | 41
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
} else {
Toast.makeText(this, "Location not Detected", Toast.LENGTH_SHORT).show();
} }

@Override
public void onConnectionSuspended(int i) {
Log.i(TAG, "Connection Suspended");
mGoogleApiClient.connect();
}
@Override
public void onConnectionFailed(ConnectionResult connectionResult) {
Log.i(TAG, "Connection failed. Error: " + connectionResult.getErrorCode());
}
@Override
protected void onStart() {
super.onStart();
if (mGoogleApiClient != null) {
mGoogleApiClient.connect();
} }

@Override
protected void onStop() {
super.onStop();
if (mGoogleApiClient.isConnected()) {
mGoogleApiClient.disconnect();
} }

protected void startLocationUpdates() {


// Create the location request
mLocationRequest = LocationRequest.create()
.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY)
.setInterval(UPDATE_INTERVAL)
.setFastestInterval(FASTEST_INTERVAL);
if (ActivityCompat.checkSelfPermission(this,
Manifest.permission.ACCESS_FINE_LOCATION) !=
PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this,
Manifest.permission.ACCESS_COARSE_LOCATION) !=
PackageManager.PERMISSION_GRANTED) {
return;
}
LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient,
mLocationRequest, this);
}

@Override
public void onLocationChanged(Location location) {

String msg = "Updated Location: " +


Double.toString(location.getLatitude()) + "," +
Page No: 37 | 41
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
Double.toString(location.getLongitude());

tvLocation.setText(String.valueOf(location.getLatitude() +"
"+String.valueOf(location.getLongitude())));
Toast.makeText(this, msg, Toast.LENGTH_SHORT).show();

if(isFirstTime){
//code to draw path on map

getDirection = findViewById(R.id.btnGetDirection);
getDirection.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
new FetchURL(MainActivity.this).execute(getUrl(place1.getPosition(),
place2.getPosition(), "driving"), "driving");
}
});

place1 = new MarkerOptions().position(new LatLng(location.getLatitude(),


location.getLongitude())).title("Location 1");
place2 = new MarkerOptions().position(new
LatLng(19.021824,72.8662016)).title("MSBTE");
mapFragment = (MapFragment)
getFragmentManager().findFragmentById(R.id.mapNearBy);
mapFragment.getMapAsync(this);
isFirstTime = false;
} }}
c) Develop a simple calculator using relative layout. 6M

Ans activity_main.xml Use of


<?xml version="1.0" encoding="utf-8"?> Relative
<RelativeLayout Layout
xmlns:android="http://schemas.android.com/apk/res/android" with
appropriate
xmlns:app="http://schemas.android.com/apk/res-auto" attributes :
xmlns:tools="http://schemas.android.com/tools" 3M
android:layout_width="match_parent"
android:layout_height="match_parent" Logic for
simple
tools:context=".MainActivity">
calculator
with basic
<TextView arithmetic
android:id="@+id/heading" operations :
android:layout_width="wrap_content" 3M
android:layout_height="wrap_content"
android:text=" Calculator"
android:layout_centerHorizontal="true"
android:textSize="30dp" />

Page No: 38 | 41
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
<EditText
android:id="@+id/num1"
android:layout_below="@+id/heading"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Enter Number 1"
android:inputType="number" />

<EditText
android:id="@+id/num2"
android:layout_below="@+id/num1"
android:hint="Enter Number 2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="number" />

<TextView
android:id="@+id/result"
android:layout_below="@+id/num2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp"
android:text="Result" />

<Button
android:id="@+id/sum"
android:layout_below="@id/result"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:text="+" />

<Button
android:id="@+id/sub"
android:layout_below="@id/result"
android:layout_toRightOf="@id/sum"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:text="-" />

<Button
Page No: 39 | 41
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
android:id="@+id/div"
android:layout_below="@id/result"
android:layout_toRightOf="@id/sub"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:text="/" />

<Button
android:id="@+id/mul"
android:layout_below="@id/result"
android:layout_toRightOf="@id/div"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:text="x"/>
</RelativeLayout>

MainActivity.java
package in.msbte.calculator;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
public class MainActivity extends AppCompatActivity {
public EditText e1, e2;
Button add, sub , mul, div;
TextView t1;
int num1, num2;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
e1 = (EditText) findViewById(R.id.num1);
e2 = (EditText) findViewById(R.id.num2);
t1 = (TextView) findViewById(R.id.result);
add = (Button) findViewById(R.id.sum);
mul = (Button) findViewById(R.id.mul);
div = (Button) findViewById(R.id.div);
sub = (Button) findViewById(R.id.sub);
add.setOnClickListener(new View.OnClickListener() {
Page No: 40 | 41
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
@Override
public void onClick(View view) {
num1 = Integer.parseInt(e1.getText().toString());
num2 = Integer.parseInt(e2.getText().toString());
int sum = num1 + num2;
t1.setText(Integer.toString(sum));
}
});
sub.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
num1 = Integer.parseInt(e1.getText().toString());
num2 = Integer.parseInt(e2.getText().toString());
int sum = num1 - num2;
t1.setText(Integer.toString(sum));
}
});
mul.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
num1 = Integer.parseInt(e1.getText().toString());
num2 = Integer.parseInt(e2.getText().toString());
int sum = num1 * num2;
t1.setText(Integer.toString(sum));
}
});
div.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
num1 = Integer.parseInt(e1.getText().toString());
num2 = Integer.parseInt(e2.getText().toString());
int sum = num1 / num2;
t1.setText(Integer.toString(sum));
}
});
}
}

Page No: 41 | 41
lOMoARcPSD|29220132

3/13/23, 12:09 PM 22620 modelans W-g22

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

WINTER – 2022 EXAMINATION


MODEL ANSWER
Subject: Network & Information Security Subject Code: 22620
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 anyequivalent 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.

Q. Sub Answer Marking


No Q.N. Scheme
1. Attempt any FIVE of the following: 10
a) Define computer security and state it’s need 2M
Ans. Computer Security refers to techniques for ensuring that data stored Definition
1M
in a computer cannot be read or compromised by any individuals
without authorization.

Need of computer Security:


Any one
1. For prevention of data theft such as bank account numbers, credit
need 1M
card information, passwords, work related documents or sheets, etc.
2. To make data remain safe and confidential.
3. To provide confidentiality which ensures that only those
individuals should ever be able to view data they are not entitled to.

Page 1 / 27

about:blank 1/27
Downloaded by Mr. Omkar ([email protected])
lOMoARcPSD|29220132

3/13/23, 12:09 PM 22620 modelans W-g22

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

WINTER – 2022 EXAMINATION


MODEL ANSWER

Subject: Network & Information Security Subject Code: 22620

4. To provide integrity which ensures that only authorized individuals


should ever be able change or modify information.
5. To provide availability which ensure that the data or system itself
is available for use when authorized user wants it.
6. To provide authentication which deals with the desire to ensure
that an authorized individual.
OR
The need of computer security has been threefold: confidentiality,
integrity, and authentication—the “CIA” of security.
1. Confidentiality: the principle of confidentiality specifies that
only sender and intended recipients should be able to access the
contents of a message. Confidentiality gets compromised if an
unauthorized person is able to access the contents of a message.
2. Integrity: when the contents of the message are changed after the
sender sends it, but before it reaches the intended recipient, we
say that the integrity of the message is lost.
3. Authentication: Authentication helps to establish proof of
identities. The Authentication process ensures that the origin of a
message is correctly identified.

b) Explain shoulder surfing attack. 2M


Ans. Shoulder surfing a similar procedure in which attackers position
themselves in such a way as to- be-able to observe the authorized user Relevant
explanation
entering the correct access code. 2M
Shoulder surfing is an effective way to get information in crowded
places because it's relatively easy to stand next to someone and watch
as they fill out a form, enter a PIN number at an ATM machine, or
use a calling card at a public pay phone. Shoulder surfing can also be
done long distance with the aid of binoculars or other vision-
enhancing devices.
Shoulder surfing is using direct observation techniques, such as
looking over someone's shoulder, to get information.

Page 2 / 27

about:blank 2/27
Downloaded by Mr. Omkar ([email protected])
lOMoARcPSD|29220132

3/13/23, 12:09 PM 22620 modelans W-g22

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

WINTER – 2022 EXAMINATION


MODEL ANSWER
Subject: Network & Information Security Subject Code: 22620
c) Explain the term cryptography. 2M
Ans. Cryptography: Cryptography is the art and science of achieving Correct
explanation
security by encoding messages to make them non-readable. 1M

Diagram
1M

d) State the meaning of hacking. 2M


Ans. Hacking in simple terms means an illegal intrusion into a computer Correct
system and/or network. Government websites are the hot target of the explanation
2M
hackers due to the press coverage, it receives. Hackers enjoy the
media coverage.
OR
Hacking is the act of identifying and then exploiting weaknesses in a
computer system or network, usually to gain unauthorized access to
personal or organizational data. Hacking is not always a malicious
activity, but the term has mostly negative connotations due to its
association with cybercrime.
e) Describe sniffing attack. 2M
Ans. This is software or hardware that is used to observe traffic as it passes Correct
explanation
through a network on shared broadcast media. It can be used to view 2M
all traffic or target specific protocol, service, or string of characters
like logins. Some network sniffers are not just designed to observe
the all traffic but also modify the traffic. Network administrators use
sniffers for monitoring traffic. They can also use for network
bandwidth analysis and to troubleshoot certain problems such as
duplicate MAC addresses.
f) Explain need for firewall. 2M
Ans. Any two
 A firewall is a network security device that monitors incoming
needs 2M
and outgoing network traffic and permits or blocks data packets
based on a set of security rules.
 Its purpose is to establish a barrier between your internal network
and incoming traffic from external sources (such as the internet)
in order to block malicious traffic like viruses and hackers.
 Firewalls can be an effective means of protecting a local system
or network of systems from network-based security threats while
at the same time affording access to the outside world via wide
area networks and the Internet.

Page 3 / 27

about:blank 3/27
Downloaded by Mr. Omkar ([email protected])
lOMoARcPSD|29220132

3/13/23, 12:09 PM 22620 modelans W-g22

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

WINTER – 2022 EXAMINATION


MODEL ANSWER
Subject: Network & Information Security Subject Code: 22620
g) Explain use of PCI DSS 2M
Ans. The Payment Card Industry Data Security Standard (PCI DSS) is a Correct
explanation
set of security standards designed to ensure that all companies that 2M
accept process, store or transmit credit card information maintain a
secure environment.PCI DSS is the global data security standard that
any business of any size must adhere to in order to accept payment
cards, and to store, process, and/or transmit cardholder data. It
presents common sense steps that mirror best security practices.
2. Attempt any THREE of the following: 12
a) Define Risk. Describe qualitative and quantitative risk analysis. 4M
Ans. Risk: A computer security risk is any event or action that could cause Definition
1M
a loss or damage to computer hardware, software, data, or
information OR Risk is probability of threats that may occur because Explanation
of presence of vulnerability in a system. of
qualitative
Quantitative Risk Analysis: A Process of assigning a numeric value and
quantitative
to the probability of loss based on known risks, on financial values of risk analysis
the assets and on probability of threats. It is used to determine 3M
potential direct and indirect costs to the company based on values
assigned to company assets and their exposure to risk. Assets can be
rated as the cost of replacing an asset, the cost of lost productivity, or
the cost of diminished brand reputation. In this 100% quantitative risk
analysis is not possible.

Qualitative Risk Analysis: A collaborative process of assigning


relative values to assets, assessing their risk exposure and estimating
the cost of controlling the risk. It utilizes relative measures and
approximate costs rather than precise valuation and cost
determination. Assets can be rated based on criticality - very
important, important, not-important etc. Vulnerabilities can be rated
based on how it is fixed - fixed soon, should be fixed, fix if suitable
etc. Threats can be rated based on scale of likely - likely, unlikely,
very likely etc. In this 100% qualitative risk analysis is feasible.
b) Explain working of biometric access control with any type of 4M
example. Diagram
Ans. Biometric refers study of methods for uniquely recognizing humans 1M
based upon one or more intrinsic physical or behavioral Explanation
characteristics. Biometric identification is used on the basis of some 3M
unique physical attribute of the user that positively identifies the user.

Page 4 / 27

about:blank 4/27
Downloaded by Mr. Omkar ([email protected])
lOMoARcPSD|29220132

3/13/23, 12:09 PM 22620 modelans W-g22

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

WINTER – 2022 EXAMINATION


MODEL ANSWER
Subject: Network & Information Security Subject Code: 22620
Example: finger print recognition, retina and face scan technique,
voice synthesis and recognition and so on. Different types of
Biometrics
1. Finger print recognition
2. Hand print recognition
3. Retina/iris scan technique
4. Face recognition
5. Voice patterns recognition
6. Signature and writing patterns recognition
7. Keystroke dynamics

Fig. block diagram of biometric system


Finger print recognition
Above figure shows the block diagram of biometric system.
Fingerprint registration & verification process
1. During registration, first time an individual uses a biometric
system is called an enrollment.
2. During the enrollment, biometric information from an individual is
stored.
3. In the verification process, biometric information is detected and
compared with the information stored at the time of enrolment.
4. The first block (sensor) is the interface between the real world and
the system; it has to acquire all the necessary data.
5. The 2nd block performs all the necessary pre-processing
6. The third block extracts necessary features. This step is an
important step as the correct features need to be extracted in the
optimal way.
7. If enrollment is being performed the template is simply stored
somewhere (on a card or within a database or both).
8. If a matching phase is being performed the obtained template is

Page 5 / 27

about:blank 5/27
Downloaded by Mr. Omkar ([email protected])
lOMoARcPSD|29220132

3/13/23, 12:09 PM 22620 modelans W-g22

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

WINTER – 2022 EXAMINATION


MODEL ANSWER
Subject: Network & Information Security Subject Code: 22620
passed to a matcher that compares it with other existing templates,
estimating the distance between them using any algorithm.
9. The matching program will analyze the template with the input.
This will then be output for any specified use or purpose.

Limitations:-
1) Using the fingerprint scanner does not take into consideration
when a person physically changes
2) The cost of computer hardware and software programs can be
expensive
3) Using the fingerprint scanner can lead to false rejections and false
acceptance.
4) It can make mistakes with the dryness or dirty of the finger„s skin,
as well as with the age (is not appropriate with children, because the
size of their fingerprint changes quickly.
c) Explain Caesar’s cipher substitute technique with suitable 4M
example.
Ans. Caesar cipher technique is proposed by Julius Caesar. It is one of the Explanation
simplest and most widely known encryption techniques. It is a type of 2M
substitution technique in which each letter in the plain text is replaced Example
by a letter some fixed number of position down the alphabet. The 2M
Caesar cipher involves replacing each letter of the alphabet with the
letter three places further down the alphabet. For example, with a
shift of 3, A would be replaced by D, B would became E, and so on
as shown in the table below

Example
PLAIN TEXT - COMPUTER ENGINEERING
Convert each alphabet in the plain text, using the table, the cipher text
can be written as
CIPHER TEXT – FRPSXWHU HQJLQHHULQJ
Algorithm to break Caesar cipher:

Page 6 / 27

about:blank 6/27
Downloaded by Mr. Omkar ([email protected])
lOMoARcPSD|29220132

3/13/23, 12:09 PM 22620 modelans W-g22

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

WINTER – 2022 EXAMINATION


MODEL ANSWER

Subject: Network & Information Security Subject Code: 22620


1. Read each alphabet in the cipher text message, and search for it in
the second row of the table above.
2. When a match in found, replace that alphabet in the cipher text
message with the corresponding alphabet in the same column but the
first row of the table. (For example, if the alphabet cipher text is J,
replace it with G).
3. Repeat the process for all alphabets in the cipher text message.
d) Describe DES algorithm with suitable example. 4M
Ans. Data Encryption Standard is symmetric block cipher which takes
input of 64-bit plain text along with 64-bit key and process it, to Diagram
1M
generate the 64-bit cipher text.
The diagram below illustrates the working of DES. Explanation
in short 3M

DES Encryption:-
Step 1: In the first step the 64-bit plain text undergoes initial
permutation which rearranges the bits to produce two 32-bit permuted
block which is called left plain text (LPT 32-bit) and right plain text
(RPT 32-bit).
Step 2: Now, 16 rounds of DES encryption will be performed on this
LPT and RPT with a 56-bit key.
Step 3: After the 16th round the 32-bit LPT and 32-bit RPT are
integrated which forms a 64-bit block again and then the final
permutation is applied to this 64-bit block, to obtain the 64-bit cipher
text.
Rounds in Data Encryption Standard
Each round of DES performs the same function. So, below are the
steps of the function performed in each round of DES algorithm:

Page 7 / 27

about:blank 7/27
Downloaded by Mr. Omkar ([email protected])
lOMoARcPSD|29220132

3/13/23, 12:09 PM 22620 modelans W-g22

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

WINTER – 2022 EXAMINATION


MODEL ANSWER

Subject: Network & Information Security Subject Code: 22620

1. Key Transformation: -In DES initial key size is 64-bit which is


reduced to the 56-bit key. This is done by discarding every 8th bit
from the 64-bit key. So, for each round of DES, this 56-bit key is
used. In the key transformation step, this 56-bit is transformed to the
48-bit key.

2. Expansion Permutation: -In the first step of encryption, during


the initial permutation of DES, the 64-bit plain text is permuted and
we have 32-bit LPT and 32-bit RPT. Now, the expansion permutation
is performed on the 32-bit RPT which transforms it from 32-bit to 48-
bit. The 32-bit LPT is untouched during the process.

3. S-box Substitution:-The input to S-box is 48-bit resultant block of


expansion permutation. In S-box substitution, the input 48-bit block
is transformed to 32-bit block

4. P-box Permutation:- The 32-bit output obtained from s-box


substitution is provided as an input to P-box. Here, the 32-bit input is
simply permuted and send to the next step.

5. XOR and Swap:-In this step, the 32-bit LPT of the initial 64-bit
plain text is XOR with the output of P-box permutation. The result of
the XOR is the new RPT for next round and the old RPT is swapped
with LPT.
DES Decryption:-
The same Data Encryption Standard algorithm used for encrypting
the plain text is also used to decrypting the cipher text. But the
algorithm is reversed, such as the initial and final permutation events
are reversed. Even the sequence of the sub keys applied in 16 rounds
of DES is also reversed.
3. Attempt any THREE of the following: 12
a) Explain the term Authorization and Authentication with respect 4M
to security. Explanation
Ans. Authorization: It is a process of verifying that the known person has of each term
2M
the authority to perform certain operation. It cannot occur without
authentication. It is nothing but granting permissions and rights to
individual so that he can use these rights to access computer resources
or information.

Page 8 / 27

about:blank 8/27
Downloaded by Mr. Omkar ([email protected])
lOMoARcPSD|29220132

3/13/23, 12:09 PM 22620 modelans W-g22

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

WINTER – 2022 EXAMINATION


MODEL ANSWER
Subject: Network & Information Security Subject Code: 22620
Authentication. Authentication is the process of determining identity
of a user or other entity. It is performed during log on process where
user has to submit his/her username and password. There are three
methods used in it. 1. Something you know User knows user id and
password. 2. Something you have Valid user has lock and key. 3.
Something about you User‟s unique identity like fingerprints, DNA
etc.
b) Write an algorithm for simple columnar transposition technique 4M
and explain with example.
Ans. Simple columnar transposition technique: Algorithm
1M
Algorithm:
1. The message is written out in rows of a fixed length. Any
2. Read out again column by column according to given order or in relevant
example 3M
random order.
3. According to order write cipher text.
Example
The key for the columnar transposition cipher is a keyword e.g.,
ORANGE. The row length that is used is the same as the length of
the keyword.
To encrypt a below plaintext: COMPUTER PROGRAMMING

In the above example, the plaintext has been padded so that it neatly
fits in a rectangle. This is known as a regular columnar transposition.
An irregular columnar transposition leaves these characters blank,
though this makes decryption slightly more difficult. The columns are
now reordered such that the letters in the key word are ordered
alphabetically.

Page 9 / 27

about:blank 9/27
Downloaded by Mr. Omkar ([email protected])
lOMoARcPSD|29220132

3/13/23, 12:09 PM 22620 modelans W-g22

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

WINTER – 2022 EXAMINATION


MODEL ANSWER
Subject: Network & Information Security Subject Code: 22620

The Encrypted text or Cipher text is:


MPMETGNMUOIXPRXCERGORAL
c) Describe DMZ with suitable example. 4M
Ans. DMZ (Demilitarized Zone): It is a computer host or small network Description
2M
inserted as a “neutral zone” in a company‟s private network and the
outside public network. It avoids outside users from getting direct Diagram
access to a company‟s data server. A DMZ is an optional but more 1M
secure approach to a firewall. It can effectively acts as a proxy server. Any one
The typical DMZ configuration has a separate computer or host in Example
network which receives requests from users within the private 1M

network to access a web sites or public network. Then DMZ host


initiates sessions for such requests on the public network but it is not
able to initiate a session back into the private network. It can only
forward packets which have been requested by a host. The public
network‟s users who are outside the company can access only the
DMZ host. It can store the company‟s web pages which can be served
to the outside users. Hence, the DMZ can‟t give access to the other
company‟s data. By any way, if an outsider penetrates the DMZ‟s
security the web pages may get corrupted but other company‟s
information can be safe.

Page 10 / 27

about:blank 10/27
Downloaded by Mr. Omkar ([email protected])
lOMoARcPSD|29220132

3/13/23, 12:09 PM 22620 modelans W-g22

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

WINTER – 2022 EXAMINATION


MODEL ANSWER
Subject: Network & Information Security Subject Code: 22620

Examples:
1) Web servers
It‟s possible for web servers communicating with internal database
servers to be deployed in a DMZ. This makes internal databases more
secure, as these are the repositories responsible for storing sensitive
information. Web servers can connect with the internal database
server directly or through application firewalls, even though the DMZ
continues to provide protection.

2) DNS servers
A DNS server stores a database of public IP addresses and their
associated hostnames. It usually resolves or converts those names to
IP addresses when applicable. DNS servers use specialized software
and communicate with one another using dedicated protocols. Placing
a DNS server within the DMZ prevents external DNS requests from
gaining access to the internal network. Installing a second DNS
server on the internal network can also serve as additional security.

3)Proxy servers
A proxy server is often paired with a firewall. Other computers use it
to view Web pages. When another computer requests a Web page, the
proxy server retrieves it and delivers it to the appropriate requesting

Page 11 / 27

about:blank 11/27
Downloaded by Mr. Omkar ([email protected])
lOMoARcPSD|29220132

3/13/23, 12:09 PM 22620 modelans W-g22

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

WINTER – 2022 EXAMINATION


MODEL ANSWER
Subject: Network & Information Security Subject Code: 22620

machine. Proxy servers establish connections on behalf of clients,


shielding them from direct communication with a server. They also
isolate internal networks from external networks and save bandwidth
by caching web content.

d) Write short note on DAC and MAC 4M


Ans. Discretionary Access control (DAC): Explanation
of each term
Restricting access to objects based on the identity of subjects and or 2M
groups to which they belong to, it is conditional, basically used by
military to control access on system. UNIX based System is common
method to permit user for read/write and execute

Mandatory Access control (MAC):


It is used in environments where different levels of security are
classified. It is much more restrictive. It is sensitivity-based
restriction, formal authorization subject to sensitivity. In MAC the
owner or User cannot determine whether access is granted to or not.
i.e. Operating system rights. Security mechanism controls access to
all objects and individual cannot change that access.
4. Attempt any THREE of the following: 12
a) Write a short note on stegnography. 4M
Ans. Steganography is the art and science of writing hidden message in
such a way that no one, apart from the sender and intended recipient, Explanation
of technique
suspects the existence of the message. 2M
Steganography works by replacing bits of useless or unused data in Any
regular computer files (such as graphics, sound, text, html or even relevant
floppy disks) with bits of different, invisible information. diagram 2M

This hidden information can be plain text, cipher text or even images. OR
In modern steganography, data is first encrypted by the usual means Advantage
and then inserted, using a special algorithm, into redundant data that 1M
Disadvantag
is part of a particular file format such as a JPEG image. e 1M

Page 12 / 27

about:blank 12/27
Downloaded by Mr. Omkar ([email protected])
lOMoARcPSD|29220132

3/13/23, 12:09 PM 22620 modelans W-g22

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

WINTER – 2022 EXAMINATION


MODEL ANSWER
Subject: Network & Information Security Subject Code: 22620

Steganography process:
Cover-media + Hidden data + Stego-key = Stego-medium
Cover media is the file in which we will hide the hidden data, which
may also be encrypted using stego-key. The resultant file is stego-
medium. Cover-media can be image or audio file.
Advantages:
1. With the help of steganography we can hide secret message within
graphics image.
2. In modern Steganography, data is encrypted first and then inserted
using special algorithm so that no one suspects its existence.
Drawbacks:
1. It requires lot of overhead to hide a relatively few bits of
information.
2. Once the system is discovered, it becomes virtually worthless.
b) Explain honey pots. 4M
Ans. Honeypots are designed to purposely engage and deceive hackers and
identify malicious activities performed over the Internet. The Explanation
2M
honeypots are designed to do the following:
Any
1. Divert the attention of potential attacker. relevant
diagram 2M
2. Collect information about the intruder‟s action.
3. Provide encouragement to the attacker so as to stay for some time,
allowing the administrations to detect this and swiftly act on this.

Page 13 / 27

about:blank 13/27
Downloaded by Mr. Omkar ([email protected])
lOMoARcPSD|29220132

3/13/23, 12:09 PM 22620 modelans W-g22

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

WINTER – 2022 EXAMINATION


MODEL ANSWER
Subject: Network & Information Security Subject Code: 22620

Honeypots are designed for 2 important goals


1. Make them look-like full real-life systems.
2. Do not allow legitimate users to know about or access them.

c) Explain Host based IDS. 4M


Ans. (Host Intrusion Detection System (HIDS) Explanation
Host intrusion detection systems (HIDS) run on independent hosts or 2M
Relevant
devices on the network. A HIDS monitors the incoming and outgoing diagram 2M
packets from the device only and will alert the administrator if
suspicious or malicious activity is detected. It takes a snapshot of
existing system files and compares it with the previous snapshot. If
the analytical system files were edited or deleted, an alert is sent to
the administrator to investigate. Anexample of HIDS usage can be
seen on mission critical machines, which are not expected to change
their layout.

Basic Components HIDS:


 Traffic collector:
This component collects activity or events from the IDS to examine.
On Host-based IDS, this can be log files, audit logs, or traffic coming
to or leaving a specific system

Page 14 / 27

about:blank 14/27
Downloaded by Mr. Omkar ([email protected])
lOMoARcPSD|29220132

3/13/23, 12:09 PM 22620 modelans W-g22

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

WINTER – 2022 EXAMINATION


MODEL ANSWER
Subject: Network & Information Security Subject Code: 22620

 Analysis Engine:
This component examines the collected network traffic & compares it
to known patterns of suspicious or malicious activity stored in the
signature database. The analysis engine acts like a brain of the IDS.
 Signature database:
It is a collection of patterns & definitions of known suspicious or
malicious activity.
 User Interface & Reporting:
This is the component that interfaces with the human element,
providing alerts & giving the user a means to interact with & operate
the IDS.
d) Describe working principle of SMTP. 4M
Ans. 1. Composition of Mail: A user sends an e-mail by composing an Working
principle
electronic mail message using a Mail User Agent (MUA). Mail User explanation
Agent is a program which is used to send and receive mail. The 2M
message contains two parts: body and header. The body is the main
part of the message while the header includes information such as the Suitable
sender and recipient address. The header also includes descriptive diagram 2M
information such as the subject of the message. In this case, the
message body is like a letter and header is like an envelope that
contains the recipient's address.

2. Submission of Mail: After composing an email, the mail client


then submits the completed e-mail to the SMTP server by using
SMTP on TCP port 25.

3. Delivery of Mail: E-mail addresses contain two parts: username of


the recipient and domain name. For example, [email protected],
where "vivek" is the username of the recipient and "gmail.com" is the
domain name.
If the domain name of the recipient's email address is different from
the sender's domain name, then MSA will send the mail to the Mail
Transfer Agent (MTA). To relay the email, the MTA will find the
target domain. It checks the MX record from Domain Name System
to obtain the target domain. The MX record contains the domain
name and IP address of the recipient's domain. Once the record is
located, MTA connects to the exchange server to relay the message.

Page 15 / 27

about:blank 15/27
Downloaded by Mr. Omkar ([email protected])
lOMoARcPSD|29220132

3/13/23, 12:09 PM 22620 modelans W-g22

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

WINTER – 2022 EXAMINATION


MODEL ANSWER
Subject: Network & Information Security Subject Code: 22620
4. Receipt and Processing of Mail: Once the incoming message is
received, the exchange server delivers it to the incoming server (Mail
Delivery Agent) which stores the e-mail where it waits for the user to
retrieve it.

5. Access and Retrieval of Mail: The stored email in MDA can be


retrieved by using MUA (Mail User Agent). MUA can be accessed
by using login and password.

e) Explain creation and verification of digital signature. 4M


Ans. Working of digital signature Generation and Verification: Working
2M
1. Key Generation: Digital signature are electronic signatures, which
assures that the message was sent by a particular sender. While Relevant
performing digital transactions authenticity and integrity should be diagram 2M
assured, otherwise the data can be altered or someone can also act as
if he was the sender and expect a reply.

2. Signature Verification: Verifier receives Digital Signature along


with the data. It then uses Verification algorithm to process on the
digital signature and the public key (verification key) and generates
some value. It also applies the same hash function on the received
data and generates a hash value. Then the hash value and the output
of the verification algorithm are compared. If they both are equal,
then the digital signature is valid else it is invalid.

Page 16 / 27

about:blank 16/27
Downloaded by Mr. Omkar ([email protected])
lOMoARcPSD|29220132

3/13/23, 12:09 PM 22620 modelans W-g22

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

WINTER – 2022 EXAMINATION


MODEL ANSWER
Subject: Network & Information Security Subject Code: 22620

5. Attempt any TWO of the following: 12


a) Explain any three criteria for classification of information. 6M
Ans. i) Useful life Any three
criteria 2M
A data is labeled „more useful‟ when the information is available each
ready for making changes as and when required. Data might need to
be changed from time to time, and when the „change‟ access is
available, it is valuable data.
ii) Value of data
This is probably the most essential and standard criteria for
information classification. There is some confidential and valuable
information of every organization, the loss of which could lead to
great losses for the organization while creating organizational issues.
Therefore, this data needs to be duly classified and protected.
iii) Personal association
It is important to classify information or data associated with
particular individuals or addressed by privacy law.
iv) Age
The value of information often declines with time. Therefore, if the
given data or information comes under such a category, the data
classification gets lowered.

Page 17 / 27

about:blank 17/27
Downloaded by Mr. Omkar ([email protected])
lOMoARcPSD|29220132

3/13/23, 12:09 PM 22620 modelans W-g22

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

WINTER – 2022 EXAMINATION


MODEL ANSWER
Subject: Network & Information Security Subject Code: 22620
b) List types of firewall and explain any one of them. 6M
Ans. (Note: Firewalls available in market can also be considered)
List four
List of firewall: types 2M
1. Packet filter as a firewall
2. Circuit level gateway firewall Diagram
3. Application level gateway firewall with
4. Proxy server as a firewall explanation
of any one
5. Stateful multilayer Inspection Firewall 4M
.
1. Packet filter as a firewall : As per the diagram given below
Firewall will act according to the table given for example source IP
150.150.0.0 is the IP address of a network , all the packets which are
coming from this network will be blocked by the firewall in this way
it is acting as a firewall. Table also having port 80, IP Address
200.75.10.8 & port 23 firewall will act in the similar fashion. Port 23
is for Telnet remote login in this case firewall won‟t allow to login
onto this server. IP Address 200.75.10.8 is the IP address of
individual Host, all the packet having this IP address as a destination
Address will be denied. Port 80 no HTTP request allowed by firewall

2. Circuit level gateway Firewalls: The circuit level gateway


firewalls work at the session layer of the OSI model. They monitor
TCP handshaking between the packets to determine if a requested
session is legitimate. And the information passed through a circuit
level gateway, to the internet, appears to have come from the circuit
level gateway. So, there is no way for a remote computer or a host to
determine the internal private ip addresses of an organization, for
example. This technique is also called Network Address Translation
where the private IP addresses originating from the different clients
inside the network are all mapped to the public IP address available

Page 18 / 27

about:blank 18/27
Downloaded by Mr. Omkar ([email protected])
lOMoARcPSD|29220132

3/13/23, 12:09 PM 22620 modelans W-g22

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

WINTER – 2022 EXAMINATION


MODEL ANSWER

Subject: Network & Information Security Subject Code: 22620

through the internet service provider and then sent to the outside
world (Internet). This way, the packets are tagged with only the
Public IP address (Firewall level) and the internal private IP
addresses are not exposed to potential intruders

3. Application level gateway Firewalls: Application level firewalls


decide whether to drop a packet or send them through based on the
application information (available in the packet). They do this by
setting up various proxies on a single firewall for different
applications. Both the client and the server connect to these proxies
instead of connecting directly to each other. So, any suspicious data
or connections are dropped by these proxies. Application level
firewalls ensure protocol conformance. For example, attacks over http
that violates the protocol policies like sending Non-ASCII data in the
header fields or overly long string along with NonASCII characters in
the host field would be dropped because they have been tampered
with, by the intruders.

Page 19 / 27

about:blank 19/27
Downloaded by Mr. Omkar ([email protected])
lOMoARcPSD|29220132

3/13/23, 12:09 PM 22620 modelans W-g22

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

WINTER – 2022 EXAMINATION


MODEL ANSWER
Subject: Network & Information Security Subject Code: 22620

4. Stateful multilayer Inspection Firewall (SMLI)


The stateful multi-layer inspection (SMLI) firewall uses a
sophisticated form of packet-filtering that examines all seven layers
of the Open System Interconnection (OSI) model. Each packet is
examined and compared against known states of friendly packets.
While screening router firewalls only examine the packet header,
SMLI firewalls examine the entire packet including the data. SMLI is
a mechanism that uses a sophisticated form of packet-filtering,
examining all major layers of the OSI model. In other words, this
type of filter examines packets on the network, transmission, and
application levels, comparing them to known trusted packets. SMLI
checks the entire packet and only allows it to pass through each layer
individually. Such firewalls inspect packets to assess the state of
communication in order to ensure that all facilitated communication
only takes place with trusted sources. To be more specific, an SMLI
firewall is not necessarily a single firewall implementation. Rather, it
is a series of firewalls that work in concert to secure traffic at
different levels of the OSI model. It may be a composition of a
stateless packet filter, a stateful firewall, as well as an application-
level proxy. SMLI.

Page 20 / 27

about:blank 20/27
Downloaded by Mr. Omkar ([email protected])
lOMoARcPSD|29220132

3/13/23, 12:09 PM 22620 modelans W-g22

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

WINTER – 2022 EXAMINATION


MODEL ANSWER

Subject: Network & Information Security Subject Code: 22620

c) Explain IP sec security with help of diagram. 6M


Ans.
Diagram
2M

Explanation
4M

It encrypts and seal the transport and application layer data during
transmission. It also offers integrity protection for internet layer. It
sits between transport and internet layer of conventional TCP/IP
protocol 1. Secure remote internet access: Using IPsec make a local
call to our internet services provider (ISP) so as to connect to
organization network in a secure fashion from our house or hotel
from there; to access the corporate network facilities or access remote
desktop/servers. 2. Secure branch office connectivity: Rather than
subscribing to an expensive leased line for connecting its branches
across cities, an organization can setup an IPsec enabled network for
security. 3. Setup communication with other organization: Just as
IPsec allow connectivity between various branches of an
organization, it can also be used to connect the network of different
organization together in a secure & inexpensive fashion. Basic
Concept of IPsec Protocol: IP packet consist two position IP header &
actual data IPsec feature are implemented in the form of additional
headers called as extension header to the standard, default IP header.
IPsec offers two main services authentication & confidentially. Each
of these requires its own extension header. Therefore, to support these
two main services, IPsec defines two IP extension header one for
authentication & another for confidentiality.

Page 21 / 27

about:blank 21/27
Downloaded by Mr. Omkar ([email protected])
lOMoARcPSD|29220132

3/13/23, 12:09 PM 22620 modelans W-g22

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

WINTER – 2022 EXAMINATION


MODEL ANSWER
Subject: Network & Information Security Subject Code: 22620

It consists of two main protocols


Authentication header (AH): Authentication header is an IP Packet
(AH) protocol provides authentication, integrity &an optional anti-
reply service. The IPsec AH is a header in an IP packet. The AH is
simply inserted between IP header & any subsequent packet contents
no changes are required to data contents of packet. Security resides
completing in content of AH.
Encapsulation Header (ESP): Used to provide confidentiality, data
origin authentication, data integrity. It is based on symmetric key
cryptography technique. ESP can be used in isolation or it can be
combined with AH.

Fig: AP and ESP


6. Attempt any TWO of the following: 12
a) Define virus and describe the phases of virus. 6M
Ans. Definition: Virus is a program which attaches itself to another Definition
2M
program and causes damage to the computer system or the network. It
is loaded onto your computer without your knowledge and runs Phases 4M
against your wishes.
During the lifecycle of virus it goes through the following four
phases:
1. Dormant phase: The virus is idle and activated by some event.
2. Propagation phase: It places an identical copy of itself into other
programs or into certain system areas on the disk.
3. Triggering phase: The virus is activated to perform the function
for which it was intended.
4. Execution phase: The function of virus is performed

Page 22 / 27

about:blank 22/27
Downloaded by Mr. Omkar ([email protected])
lOMoARcPSD|29220132

3/13/23, 12:09 PM 22620 modelans W-g22

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

WINTER – 2022 EXAMINATION


MODEL ANSWER

Subject: Network & Information Security Subject Code: 22620

b) Explain Kerberos with help of suitable diagram. 6M


Ans. Kerberos: Kerberos is a network authentication protocol. It is
designed to provide strong authentication for client/server Step by step
applications by using secret-key cryptography. It uses secret key explanation
with
cryptography. It is a solution to network security problems. It suitable
provides tools for authentication and strong cryptography over the diagram 6M
network to help you secure your information system There are 4
parties involved in Kerberos protocol
i) User
ii) Authentication service (AS)
iii) Ticket granting server (TGS)
iv) Service server
Working of Kerberos:
1. The authentication service, or AS, receivers the request by the
client and verifies that the client is indeed the computer it claims to
be. This is usually just a simple database lookup of the user‟s ID.

2. Upon verification, a timestamp is created. This puts the current


time in a user session, along with an expiration date. The default
expiration date of a timestamp is 8 hours. The encryption key is then
created. The timestamp ensures that when 8 hours is up, the
encryption key is useless.
3. The key is sent back to the client in the form of a ticket-granting
ticket, or TGT. This is a simple ticket that is issued by the
authentication service. It is used for authentication the client for
future reference.

Page 23 / 27

about:blank 23/27
Downloaded by Mr. Omkar ([email protected])
lOMoARcPSD|29220132

3/13/23, 12:09 PM 22620 modelans W-g22

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

WINTER – 2022 EXAMINATION


MODEL ANSWER
Subject: Network & Information Security Subject Code: 22620

4. The client submits the ticket-granting ticket to the ticket-granting


server, or TGS, to get authenticated.

5. The TGS creates an encrypted key with a timestamp, and grants the
client a service ticket.

6. The client decrypts the ticket, tells the TGS it has done so, and then
sends its own encrypted key to the service.

Page 24 / 27

about:blank 24/27
Downloaded by Mr. Omkar ([email protected])
lOMoARcPSD|29220132

3/13/23, 12:09 PM 22620 modelans W-g22

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

WINTER – 2022 EXAMINATION


MODEL ANSWER

Subject: Network & Information Security Subject Code: 22620

7. The service decrypts the key, and makes sure the timestamp is still
valid. If it is, the service contacts the key distribution center to
receive a session that is returned to the client.

8. The client decrypts the ticket. If the keys are still valid,
communication is initiated between client and server.
c) Write a brief note on firewall configuration 6M
Ans. A firewall is combination of packet filter and application level Diagram
2M
getway , Base on these there are three types of configurations
Explanation
4M

1. Screened Host firewall, Single-Homed Bastion


a) Here , the firewall configuration consist of two parts a packet
filter router and application level gateway
b) A packet filter router will insure that the income traffic will
allowded only if it is intended for the application gatway, by
examining the dstination address field of each incomming IP
Packet

Page 25 / 27

about:blank 25/27
Downloaded by Mr. Omkar ([email protected])
lOMoARcPSD|29220132

3/13/23, 12:09 PM 22620 modelans W-g22

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

WINTER – 2022 EXAMINATION


MODEL ANSWER
Subject: Network & Information Security Subject Code: 22620
c) It will also insure that outgoing traffic is allowded only if it is
originated from appliocation level gateway, by examining the
source address field of every outgoing IP packet.
d) An application level gateway perfors authentication as well as
proxy function

Fig: Single Homed Bastion


Advantages: It improve security of network by performing checks at
both levels- thet is packet and application level.
It provide flexibility fexibility to the network administrator to define
more secure policies.
Disadvantages : Internal users are connected to the application
gateway as well as packet filter router , So if any how packet filter is
attacked , then the whole internal network is exposed to the attacker.
1. Screened Host Firewall , Dule Homed Bastion: In this type of
Configuration the direct connection between internal host and packet
filter are avoided.
Here the packet filter connection only to the application gateway,
which is turned as separate connection with the internal host.
Hence, Packet filter is successfully attacked, and then only
application gateway is visible to the attacker.

Fig: Dule Homed Bastion

Page 26 / 27

about:blank 26/27
Downloaded by Mr. Omkar ([email protected])
lOMoARcPSD|29220132

3/13/23, 12:09 PM 22620 modelans W-g22

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

WINTER – 2022 EXAMINATION


MODEL ANSWER

Subject: Network & Information Security Subject Code: 22620

3 Screened Subnet Firewall


This type of configuration offer highest security among the possible
configurations
In this type two packet filters are used , one between internet and
application gateway and other in between application gateway and
internal network
This configuration achieve 3 level of security of an attacker to break
into

Fig: Screened Subnet Firewall

Page 27 / 27

about:blank 27/27
Downloaded by Mr. Omkar ([email protected])
lOMoARcPSD|29220132

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER – 2022 EXAMINATION


MODEL ANSWER
Subject: Network Information Security Subject Code: 22620

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.

Q.N Sub Answer Marking


o Q.N. Scheme
1. Attempt any FIVE of the following: 10
a) Define following terms: 2M
i) Confidentiality
ii) Accountability
Ans i) Confidentiality: The principle of confidentiality specifies that only 1M for
sender and intended recipients should be able to access the contents of each
a message. Confidentiality gets compromised if an unauthorized person definition
is able to access the contents of a message.
OR
The goal of confidentiality is to ensure that only those individuals who
have the authority can view a piece of information, the principle of
confidentiality specifies that only sender and intended recipients
should be able to access the contents of a message. Confidentiality gets
compromised if an unauthorized person is able to access the contents
of a message.
ii) Accountability: The principle of accountability specifies that every
individual who works with an information system should have specific

Page 1 / 28

Downloaded by Mr. Omkar ([email protected])


lOMoARcPSD|29220132

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER – 2022 EXAMINATION


MODEL ANSWER
Subject: Network Information Security Subject Code: 22620

responsibilities for information assurance.


The tasks for which a individual is responsible are part of the overall
information security plan and can be readily measurable by a person
who has managerial responsibility for information assurance.
One example would be a policy statement that all employees must
avoid installing outside software on a company-owned information
infrastructure.
OR
The security goal that generates the requirement for actions of an entity
to be traced uniquely to that entity.
b) Explain the terms: 2M
i) Shoulder surfing
ii) Piggybacking
Ans. i) Shoulder surfing: It is using direct observation techniques, such as 1M for
looking over someone's shoulder, to get information. Shoulder surfing each
is a similar procedure in which attackers position themselves in such a explanation
way as to- be-able to observe the authorized user entering the correct
access code.
• Shoulder surfing is an effective way to get information in crowded
places because it's relatively easy to stand next to someone and watch
as they fill out a form, enter a PIN number at an ATM machine, or use
a calling card at a public pay phone. Shoulder surfing can also be done
long distance with the aid of binoculars or other vision-enhancing
devices.

ii) Piggybacking : Piggybacking on Internet access is the practice of


establishing a wireless Internet connection by using another
subscriber's wireless Internet access service without the subscriber‟s
explicit permission or knowledge.
OR
Access of wireless internet connection by bringing one's own computer
within range of another wireless connection & using that without
explicit permission , it means when an authorized person allows
(intentionally or unintentionally) others to pass through a secure door.
OR
An attacker can thus gain access to the facility without having to know
the access code or having to acquire an access card. It is the simple
tactic of following closely behind a person who has just used their own
access card or PIN to gain physical access to a room or building.

Page 2 / 28

Downloaded by Mr. Omkar ([email protected])


lOMoARcPSD|29220132

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER – 2022 EXAMINATION


MODEL ANSWER
Subject: Network Information Security Subject Code: 22620

c) Define term cryptography. 2M


Ans. Cryptography is art & science of achieving security by encoding 2M for
messages to make them non-readable. definition,
diagram is
optional

d) Classify following cyber crimes: 2M


i) Cyber stalking
ii) Email harassment 1M for
Ans. i) Cyber stalking : Cyber Stalking means following some ones each
activity over internet. This can be done with the help of many protocols explanation
available such as e- mail, chat rooms, user net groups.
OR
Cyber stalking :Cyberstalking/ Harassment refers to the use of the
internet and other technologies to harass or stalk another person online,
and is potentially a crime in the India under IT act-2000.
This online harassment, which is an extension of cyberbullying and in-
person stalking, can take the form of e-mails, text messages, social
media posts, and more and is often methodical, deliberate, and
persistent.

ii) Email harassment : Email harassment is usually understood to be


a form of stalking in which one or more people send consistent,
unwanted, and often threatening electronic messages to someone else
OR
Email harassment : Cybercrime against individual
e) Differentiate between viruses & worms (any two) 2M
Ans. S. N Worms Virus 1M for
1. The worm is code that The virus is the program code each
replicate itself in order to that attaches itself to difference,
consume resources to application program and when any two can
bring it down. application program run it be
runs along with it considered
2. It exploits a weakness in It inserts itself into a file or
an application or operating executable program.
system by replicating itself

Page 3 / 28

Downloaded by Mr. Omkar ([email protected])


lOMoARcPSD|29220132

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER – 2022 EXAMINATION


MODEL ANSWER
Subject: Network Information Security Subject Code: 22620

3 It can use a network to It has to rely on users


replicate itself to other transferring infected
computer systems without files/programs to other
user intervention. computer systems.
4 Usually not. Worms Yes, it deletes or modifies
usually only monopolize files. Sometimes a virus also
the CPU and memory. changes the location of files.
5 Worm is faster than virus Virus is slower than worm.
6 E.g. Code red E.g. Macro virus, Directory
virus, Stealth Virus
f) Define firewall. Enlist types of firewalls. 2M
Ans. Definition Firewall: A firewall is a network security device that 1M for
monitors incoming and outgoing network traffic and permits or blocks definition
data packets based on a set of security rules. Its purpose is to establish 1M for
a barrier between your internal network and incoming traffic from listing any
external sources (such as the internet) in order to block malicious two types
traffic like viruses and hackers.
Types of Firewall :
1 .Packet Filter
2. Circuit level Gateway
3. Application Gateway
4. Software
5. Hardware
6. Hybrid
7. Stateful multilayer Inspection Firewall

g) Define AH & ESP with respect to IP security. 2M


Ans. Authentication header (AH): 1M each,
1. The AH provides support for data integrity and authentication of any one
IP packets. The data integrity service ensures that data inside IP point also
packet is not altered during the transit. can be
2. The authentication service enables an end user or computer system considered
to authenticate the user or the application at the other end and decides
to accept or reject packets accordingly
Encapsulation Header (ESP):
1. Used to provide confidentiality, data origin authentication, data
integrity.

2. It is based on symmetric key cryptography technique.

Page 4 / 28

Downloaded by Mr. Omkar ([email protected])


lOMoARcPSD|29220132

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER – 2022 EXAMINATION


MODEL ANSWER
Subject: Network Information Security Subject Code: 22620

3. ESP can be used in isolation or it can be combined with AH.

2. Attempt any THREE of the following: 12


a) Define following terms: 4M
i) Operating System Security
ii) Hot fix
iii) Patch
iv) Service pack
Ans. i) Operating System Security: The OS must protect itself from 1M for
security breaches, such as runaway processes ( denial of service ), each
memory-access violations, stack overflow violations, the launching of definition
programs with excessive privileges, and many others.
ii)Hot Fix : Normally this term is given to small software update
designed to address a particular problem like buffer overflow in an
application that exposes the system to attacks.
iii) Patch: This term is generally applied to more formal, larger s/w
updates that may address several or many s/w problems. Patches often
contain improvement or additional capabilities & fixes for known
bugs.
iv) Service Pack : service pack is a collection of updates and fixes,
called patches, for an operating system or a software program. Many of
these patches are often released before a larger service pack, but the
service pack allows for an easy, single installation.
OR
A service pack (SP) is an update, often combining previously released
updates, that helps make Windows more reliable. Service packs can
include security and performance improvements and support for new
types of hardware.
b) Explain the mechanism of fingerprint & voice pattern in 4M
Biometrics. 2M for
Ans. each
explanation
, diagram is
optional

Page 5 / 28

Downloaded by Mr. Omkar ([email protected])


lOMoARcPSD|29220132

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER – 2022 EXAMINATION


MODEL ANSWER
Subject: Network Information Security Subject Code: 22620

Fingerprint registration & verification mechanism


1. During registration, first time an individual uses a biometric system
is called an enrollment.
2. During the enrollment, biometric information from an individual is
stored.
3. In the verification process, biometric information is detected and
compared with the information stored at the time of enrolment.
4. The first block (sensor) is the interface between the real world and
the system; it has to acquire all the necessary data.
5. The 2nd block performs all the necessary pre-processing.
6. The third block extracts necessary features. This step is an important
step as the correct features need to be extracted in the optimal way.
7. If enrollment is being performed the template is simply stored
somewhere (on a card or within a database or both).
8. If a matching phase is being performed the obtained template is
passed to a matcher that compares it with other existing templates,
estimating the distance between them using any algorithm.
9. The matching program will analyze the template with the input. This
will then be output for any specified use or purpose.
Voice pattern :
1. Biometric Voice Recognition is the use of the human voice to
uniquely identify biological characteristics to authenticate an
individual unlike passwords or tokens that require physical input.
2. Voice biometric recognition works by inputting the voice of the
individual whose identity has to be stored in the system. This input
is kept as a print for authentication. The input print is made with
software that can split the voice statement into multiple frequencies
3. A voice biometrics tool collects a user‟s voice template.

Page 6 / 28

Downloaded by Mr. Omkar ([email protected])


lOMoARcPSD|29220132

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER – 2022 EXAMINATION


MODEL ANSWER
Subject: Network Information Security Subject Code: 22620

it only checks who is speaking and what is speaking (Who you are and
what you speak)
c) Differentiate between symmetric and asymmetric key 4M
cryptography. 1M for
Ans. each valid
point, any
four points
can be
considered

d) Write & explain DES algorithm 4M


Ans.
2M for
diagram

2M for
explanation

Initial Permutation (IP): It happens only once. It replaces the first bit
of the original plain text block with the 58th bit of the original plain
text block, the second bit with the 50th bit of original plain text block
and so on. The resulting 64-bits permuted text block is divided into
two half blocks. Each half block consists of 32 bits. The left block
called as LPT and right block called as RPT.16 rounds are performed
on these two blocks. Details of one round in DES

Page 7 / 28

Downloaded by Mr. Omkar ([email protected])


lOMoARcPSD|29220132

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER – 2022 EXAMINATION


MODEL ANSWER
Subject: Network Information Security Subject Code: 22620

Step 1 : key transformation: the initial key is transformed into a 56-


bit key by discarding every 8th bit of initial key. Thus ,for each round ,
a 56 bit key is available, from this 56-bit key, a different 48-bit sub key
is generated during each round using a process called as key
transformation Expansion Permutation Key Transformation
S-box substitution
XOR and swap
P-box Permutation

Step 2: Expansion permutation: During Expansion permutation the


RPT is expanded from 32 bits to 48 bits. The 32-bit RPT is divided
into 8 blocks, with each block consisting of 4-bits. Each 4-bits block of
the previous step is then expanded to a corresponding 6-bit block, per
4-bit block, 2 more bits are added. They are the repeated 1st and 4th
bits of the 4-bit block. The 2nd and 3rd bits are written as they were in
the input. The 48 bit key is XOR ed with the 48-bit RPT and the
resulting output is given to the next step.
Step 3: S-box substitution: It accepts the 48-bits input from the XOR
operation involving the compressed key and expanded RPT and
produces 32-bit output using the substitution techniques. Each of the 8
S-boxes has a 6-bit input and a 4-bit output. The output of each S-box
then combined to form a 32-bit block, which is given to the last stage
of a round
Step 4: P- box permutation: the output of S-box consists of 32-bits.
These 32-bits are permuted using P-box. Step
5: XOR and Swap: The LPT of the initial 64-bits plain text block is
XORed with the output produced by P box-permutation. It produces

Page 8 / 28

Downloaded by Mr. Omkar ([email protected])


lOMoARcPSD|29220132

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER – 2022 EXAMINATION


MODEL ANSWER
Subject: Network Information Security Subject Code: 22620

new RPT. The old RPT becomes new LPT, in a process of swapping.

Final Permutation: At the end of 16 rounds, the final permutation is


performed. This is simple transposition. For e.g., the 40th input bit
takes the position of 1st output bit and so on.

3. Attempt any THREE of the following: 12


a) Describe the features of DAC access control policy. 4M
Ans. DAC (discretionary access control) policy utilizes user identification 1M for
procedures to identify and restrict object access .It restricts access to explanation
objects based on the identity of subjects and or groups to which they , 3M for
belongs to. The owner of information or any resource is able to change features
its permissions at his discretion .Data Owners can transfer ownership
of information to other users .Data Owners can determine the type of
access given to other users (read, write etc.)

Features of DAC policy are as follows :-


Flexible –In DAC policy owner of information or resource can change
its permission.

Page 9 / 28

Downloaded by Mr. Omkar ([email protected])


lOMoARcPSD|29220132

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER – 2022 EXAMINATION


MODEL ANSWER
Subject: Network Information Security Subject Code: 22620

Backup - Discretionary access control allows organizations to


backup security policies and data to ensure effective access points.

Usability - Discretionary access control is easy to use. Data Owners


can transfer ownership of information to other users easily.

b) Consider plain text “COMPUTER ENGINEERING” and convert 4M


given plain text into cipher text using „Caesar Cipher‟ with shift of
position three- write down steps in encryption.
Ans. Caesar cipher technique is proposed by Julius Caesar. It is one of the 2M for
simplest and most widely known encryption techniques. It is a type of explanation
substitution technique in which each letter in the plain text is replaced 2M for
by a letter some fixed number of position down the alphabet. The problem
Caesar cipher involves replacing each letter of the alphabet with the solution
letter three places further down the alphabet. For example, with a shift
of 3, A would be replaced by D, B would became E, and so on as
shown in the table below

PLAIN TEXT -COMPUTER ENGINEERING


CIPHER TEXT–FRPSXWHU HQJLQHHULQJ

c) Differentiate between host-based & network based IDS 4M


Ans. SN Host Based Ids Network Based Ids 1M for
1 Examines activity on an Examines activity on the each valid
individual system, such as a network itself point, any
mail server, web server, or four points
individual PC. can be
2 It is concerned only with an It has visibility only into the considered
individual system and traffic crossing the network
usually has no visibility into link it is monitoring and
the activity on the network typically has no idea of
or systems around it what is happening on
individual systems.

Page 10 / 28

Downloaded by Mr. Omkar ([email protected])


lOMoARcPSD|29220132

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER – 2022 EXAMINATION


MODEL ANSWER
Subject: Network Information Security Subject Code: 22620

3 HIDS is looking for certain NIDSs look for certain


activities that typify hos- activities that typify hostile
tile actions or misuse, such actions or misuse, such as
as the following: the following:
 Logins at odd hours  Denial-of-service
 Login authentication attacks
failures  Port scans or sweeps
 Additions of new user  Malicious content in the
accounts data payload of a packet
 Modification or access or packets
of critical system files  Vulnerability scanning
 Trojans, viruses, or
worms
 Tunneling
 Brute-force attacks
4

5 It is host dependent It is host independent


6 It has low false positive rate It has high false positive
rate
7 It senses local attack. It senses network attack
8 It slow down the host that It slow down the network
have IDS client installed that have IDS client
installed
d) Define access control and explain authentication mechanism for 4M
access control.
Ans. Access Control – 2M for
Access is the ability of a subject to interest with an object. Access
Authentication deals with verifying the identity of a subject. It is control
ability to specify, control and limit the access to the host system or
application, which prevents unauthorized use to modify data or

Page 11 / 28

Downloaded by Mr. Omkar ([email protected])


lOMoARcPSD|29220132

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER – 2022 EXAMINATION


MODEL ANSWER
Subject: Network Information Security Subject Code: 22620

resources. Access control is to specify, control and limit the access to 2M for
the host system or application, which prevents unauthorized use to authenticati
access or modify data or resources. on
Authentication -
Authentication helps to establish proof of identities. The
Authentication process ensures that the origin of a message is correctly
identified. For example, suppose that user C sends a message over the
internet to user B. however, the trouble is that user C had posed as user
A when he sent a message to user B. how would user B know that the
message has come from user C, who posing as user A? This concept is
shown in fig. below. This type of attack is called as fabrication
Authentication is the process of determining identity of a user or other
entity. It is performed during log on process where user has to submit

His / her username and password.


There are three methods used in it.
1. Something you know - User knows user id and password.
2. Something you have - Valid user has lock and key.
3. Something about you - User‟s unique identity like fingerprints,
DNA etc.

4. Attempt any THREE of the following: 12


a) Enlist substitution techniques & explain any one. 4M
Ans. Substitution Techniques:- In substitution technique letters of plain text 1M for list,
are replaced by the other letters or by numbers or by symbols. 2M for
Substitution techniques are as follows:- explanation
a) Caesar cipher 1M for
b) Modified version of Caesar cipher example
c) Mono-alphabetic cipher
d) Vigener„s cipher

Page 12 / 28

Downloaded by Mr. Omkar ([email protected])


lOMoARcPSD|29220132

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER – 2022 EXAMINATION


MODEL ANSWER
Subject: Network Information Security Subject Code: 22620

Caesar cipher:
It is proposed by Julius Caesar. In cryptography Caesar cipher also
known as Caesar cipher/code, shift cipher/code. It is one of the
simplest and most widely known encryption techniques. It is a type of
substitution technique in which each letter in the plain text is replaced
by a letter some fixed number of position
down the alphabet. For example, with a shift of 3, A would be replaced
by D, B would became E, and so on as shown in the table below.

Using this scheme, the plain text “SECRET” encrypts as Cipher text
“VHFUHW”. To allow someone to read the cipher text, you tell them
that the key is 3
For S:= (p+k)mod26
= (18 + 3) mod 26
= 21
=V
To allow someone to read the cipher text, you tell them that the key is3
Algorithm to break Caesar cipher:
1. Read each alphabet in the cipher text message, and search for it in
the second row of the table above.
2. When a match in found, replace that alphabet in the cipher text
message with the corresponding alphabet in the same column but the
first row of the table. (For example, if the alphabet cipher text is J,
replace it with G).
3. Repeat the process for all alphabets in the cipher text message.
b) Explain DMZ 4M
Ans. DMZ (Demilitarized Zone):- 1M for
 It is a computer host or small network inserted as a “neutral diagram
zone” in a company‟s private network and the outside public network. 2M for
It avoids outside users from getting direct access to a company‟s data explanation
server. A DMZ is an optional but more secure approach to a firewall. It 1M for

Page 13 / 28

Downloaded by Mr. Omkar ([email protected])


lOMoARcPSD|29220132

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER – 2022 EXAMINATION


MODEL ANSWER
Subject: Network Information Security Subject Code: 22620

can effectively acts as a proxy server. example


 The typical DMZ configuration has a separate computer or host
in network which receives requests from users within the private
network to access a web sites or public network. Then DMZ host
initiates sessions for such requests on the public network but it is not
able to initiate a session back into the private network. It can only
forward packets which have been requested by a host.

Advantage: The main benefit of a DMZ is to provide an internal


network with an additional security layer by restricting access to
sensitive data and servers. A DMZ enables website visitors to obtain
certain services while providing a buffer between them and the
organization's private network.

c) Differentiate between firewall & IDS 4M


Ans. S. N Firewall IDS 1M for
1 Firewall is hardware or An intrusion detection system each
software that stands (IDS) is a device or software correct
between a local network application that monitors a point
and the Internet and filters traffic for malicious activity or Any four
traffic that might be policy violations and sends points
harmful based on alert on detection.
predetermined rules.
2 Firewall does not inspect IDS inspects overall network
content of permitted traffic
traffic

Page 14 / 28

Downloaded by Mr. Omkar ([email protected])


lOMoARcPSD|29220132

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER – 2022 EXAMINATION


MODEL ANSWER
Subject: Network Information Security Subject Code: 22620

3 A firewall can block an An IDS can only report an


unauthorized access to intrusion .It cannot block it.
network
4 Firewalls Block traffic IDS gives Alerts/alarms on
based on rules the detection of anomaly
5 It filters traffic based on It detects real time traffic and
IP address and port looks for traffic patterns or
numbers signatures of attack and them
generates alerts
d) Explain Email security in SMTP. 4M
Ans. Email Security Email is emerging as one of the most valuable services 1M for
on the internet today. Most of the internet systems use SMTP as a diagram
method to transfer mail from one user to another. SMTP is a push 3M for
protocol and is used to send the mail whereas POP (post office explanation
protocol) or IMAP (internet message access protocol) are used to
retrieve those mails at the receiver„s side.
1. SMTP (simple mail transfer protocol)
2. PEM (Privacy Enhance Mail)
3. PGP (Pretty Good Privacy)
SMTP (Simple Mail Transfer Protocol)
Simple Mail Transfer Protocol, a protocol for sending email messages
between servers. Most e-mail systems that send mail over the Internet
use SMTP to send messages from one server to another; the messages
can then be retrieved with an e-mail client using either POP or IMAP.
In addition, SMTP is generally used to send messages from a mail
client to a mail server. This is why you need to specify both the POP or
IMAP server and the SMTP server when you configure your e-mail
application. SMTP usually is implemented to operate over Internet port
25. An alternative to SMTP that is widely used in Europe is X.400.
Many mail servers now support Extended Simple Mail Transfer
Protocol (ESMTP), which allows multimedia files to be delivered as e-
mail.

Page 15 / 28

Downloaded by Mr. Omkar ([email protected])


lOMoARcPSD|29220132

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER – 2022 EXAMINATION


MODEL ANSWER
Subject: Network Information Security Subject Code: 22620

The basic phases of an email communication consists of the following


steps :-
1. At sender„s end an SMTP server takes the message sent by uses
computer
2. The SMTP server at the sender„s end then transfer the message to
the SMTP server of the receiver.
3. The receiver„s computer then pulls the email message from the
SMTP server at the receiver„s end, using the other mail protocol such
as Post Office Protocol (POP) or IMAP (Internet mail access protocol )

e) Explain digital signature in Cryptography. 4M


Ans. Digital Signature: 1Mfor
1. Digital signature is a strong method of authentication in an diagram
electronic form. 3M for
2. It includes message authentication code (MAC), hash value of a explanation
message and digital pen pad devices. It also includes cryptographically
based signature protocols.
3. Digital Signature is used for authentication of the message and the
sender to verify the integrity of the message.
4. Digital Signature may be in the form of text, symbol, image or
audio.
5. In today‟s world of electronic transaction, digital signature plays a
major role in authentication. For example, one can fill his income tax
return online using his digital signature, which avoids the use of paper
and makes the process faster.
6. Asymmetric key encryption techniques and public key infrastructure
are used in digital signature.
7. Digital signature algorithms are divided into two parts-
a. Signing part: It allows the sender to create his digital signature.
b. Verification part: It is used by the receiver for verifying the
signature after receiving the message.
Generation and Verification of digital signatures:
Working:
1. Message digest is used to generate the signature. The message digest
(MD) is calculated from the plaintext or message.
2. The message digest is encrypted using user‟s private key.
3. Then, the sender sends this encrypted message digest with the
plaintext or message to the receiver.

Page 16 / 28

Downloaded by Mr. Omkar ([email protected])


lOMoARcPSD|29220132

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER – 2022 EXAMINATION


MODEL ANSWER
Subject: Network Information Security Subject Code: 22620

4. The receiver calculates the message digest from the plain text or
message he received.
5. Receiver decrypts the encrypted message digest using the sender‟s
public key. If both the MDs are not same then the plaintext or message
is modified after signing.

Advantages of Digital Signatures


 Speed: Businesses no longer have to wait for paper documents to
be sent by courier. Contracts are easily written, completed, and
signed by all concerned parties in a little amount of time no matter
how far the parties are geographically.
 Costs: Using postal or courier services for paper documents is
much more expensive compared to using digital signatures on
electronic documents.
 Security: The use of digital signatures and electronic documents
reduces risks of documents being intercepted, read, destroyed, or
altered while in transit.
 Authenticity: An electronic document signed with a digital
signature can stand up in court just as well as any other signed
paper document.
 Non-Repudiation: Signing an electronic document digitally
identifies you as the signatory and that cannot be later denied.
 Time-Stamp: By time-stamping your digital signatures, you will
clearly know when the document was signed

Page 17 / 28

Downloaded by Mr. Omkar ([email protected])


lOMoARcPSD|29220132

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER – 2022 EXAMINATION


MODEL ANSWER
Subject: Network Information Security Subject Code: 22620

5. a) Attempt any TWO of the following 12


Define Information. Explain the basic principle of information 6M
Ans. security.
Information is organized or classified data, which has some
meaningful values for the receiver. Information is the processed data
on which knowledge, decisions and actions are based.
For the decision to be meaningful, the processed data must qualify for 2M for
the following characteristics definition
 Timely − Information should be available when required. 1M for
 Accuracy − Information should be accurate. diagram
 Completeness − Information should be complete. 3M for
principles
Basic Principles of information security explanation

Fig CIA Triad of information security


1. Confidentiality: The goal of confidentiality is to ensure that only
those individuals who have the authority can view a piece of
information, the principle of confidentiality specifies that only
sender and intended recipients should be able to access the contents
of a message. Confidentiality gets compromised if an unauthorized
person is able to access the contents of a message.
2. Authentication helps to establish proof of identities. Authentication
process ensures that the origin of a message is correctly identified.
Authentication deals with the desire to ensure that an individual is
who they claim to be.
3. Integrity: Integrity is a related concept but deals with the generation
and modification of data. Only authorized individuals should ever be
able to create or change (or delete) information. When the contents
of the message are changed after the sender sends it, but before it
reaches the intended recipient, we say that the integrity of the
message is lost.

Page 18 / 28

Downloaded by Mr. Omkar ([email protected])


lOMoARcPSD|29220132

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER – 2022 EXAMINATION


MODEL ANSWER
Subject: Network Information Security Subject Code: 22620

b) Define & explain. 6M


i) Circuit Gateway
ii) Honey Pots
iii) Application Gateway
Ans. i) Circuit level gateway does not permit an end-to-end TCP 2M for
connection; rather, the gateway sets up two TCP connections, one each
between itself and a TCP user on an inner host and one between itself definition
and a TCP user on an outer host. Once the two connections are and
established, the gateway typically relays TCP segments from one explanation
connection to the other without examining the contents. The security
function consists of determining which connections will be allowed. A
typical use of Circuit level gateways is a situation in which the system
administrator trusts the internal users. The gateway can be configured
to support application level or proxy service on inbound connections
and circuit level functions for outbound connections.

ii) Honey Pots

A relatively recent innovation in intrusion detection technology is the


honey pot. Honey pots are decoy systems that are designed to lure a
potential attacker away from critical systems. Honey pots are designed
to:
 divert an attacker from accessing critical systems
 collect information about the attacker's activity
It encourages the attacker to stay on the system long enough for
administrators to respond. These systems are filled with fabricated
information designed to appear valuable but that a legitimate user of
the system wouldn‟t access. Thus, any access to the honey pot is
suspect.

Page 19 / 28

Downloaded by Mr. Omkar ([email protected])


lOMoARcPSD|29220132

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER – 2022 EXAMINATION


MODEL ANSWER
Subject: Network Information Security Subject Code: 22620

iii) Application Gateway

An Application level gateway, also called a proxy server, acts as a


relay of application level traffic. The user contacts the gateway using a
TCP/IP application, such as Telnet or FTP, and the gateway asks the
user for the name of the remote host to be accessed. When the user
responds and provides a valid user ID and authentication information,
the gateway contacts the application on the remote host and relays TCP
segments containing the application data between the two endpoints.
Application level gateways tend to be more secure than packet filters.
It is easy to log and audit all incoming traffic at the application level. A
prime disadvantage is the additional processing overhead on each
connection.

c) Explain the working of Kerberos 6M


Ans Kerberos is a network authentication protocol. It is designed to provide 6M for
strong authentication for client/server applications by using secret-key relevant
cryptography. steps

Page 20 / 28

Downloaded by Mr. Omkar ([email protected])


lOMoARcPSD|29220132

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER – 2022 EXAMINATION


MODEL ANSWER
Subject: Network Information Security Subject Code: 22620

The entire process takes a total of eight steps, as shown below.


1. The authentication service, or AS, receivers the request by the client
and verifies that the Client is indeed the computer it claims to be. This
is usually just a simple database lookup of the user‟s ID.

2. Upon verification, a timestamp is crated. This puts the current time


in a user session, along with an expiration date. The default expiration
date of a timestamp is 8 hours. The encryption key is then created. The
timestamp ensures that when 8 hours is up, the encryption key is
useless. (This is used to make sure a hacker doesn‟t intercept the data,
and try to crack the key. Almost all keys are able to be cracked, but it
will take a lot longer than 8 hours to do so).

3. The key is sent back to the client in the form of a ticket-granting


ticket, or TGT. This is a simple ticket that is issued by the
authentication service. It is used for authentication the client for future
reference.

4. The client submits the ticket-granting ticket to the ticket-granting


server, or TGS, to get authenticated.

Page 21 / 28

Downloaded by Mr. Omkar ([email protected])


lOMoARcPSD|29220132

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER – 2022 EXAMINATION


MODEL ANSWER
Subject: Network Information Security Subject Code: 22620

5. The TGS creates an encrypted key with a timestamp, and grants the
client a service ticket.

6. The client decrypts the ticket, tells the TGS it has done so, and then
sends its own encrypted key to the service server.

7. The service server decrypts the key, and makes sure the timestamp is
still valid. If it is, the
service contacts the key distribution center to receive a session that is
returned to the client.
8. The client decrypts the ticket. If the keys are still valid,
communication is initiated between client and server.

Page 22 / 28

Downloaded by Mr. Omkar ([email protected])


lOMoARcPSD|29220132

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER – 2022 EXAMINATION


MODEL ANSWER
Subject: Network Information Security Subject Code: 22620

6. Attempt any TWO of the following: 12


a) Explain DOS with neat diagram. 6M
Ans. Denial Of Service Attack: Denial of service (DOS) attack scan exploits 2M for
a known vulnerability in a specific application or operating system, or diagram
they may attack features (or weaknesses) in specific protocols or 4M for
services. In this form of attack, the attacker is attempting to deny explanation
authorized users access either to specific information or to the
computer system or network itself. The purpose of such an attack can
be simply to prevent access to the target system, or the attack can be
used in conjunction with other actions in order to gain unauthorized
access to a computer or network. SYN flooding is an example of a
DOS attack that takes advantage of the way TCP/IP networks were
designed to function, and it can be used to illustrate the basic principles
of any DOS attack. SYN flooding utilizes the TCP three-way
handshake that is used to establish a connection between two systems.
In a SYN flooding attack, the attacker sends fake communication
requests to the targeted system. Each of these requests will be
answered by the target system, which then waits for the third part of
the handshake. Since the requests are fake the target will wait for
responses that will never come, as shown in Figure.

The target system will drop these connections after a specific time-out
period, but if the attacker sends requests faster than the time-out period
eliminates them, the system will quickly be filled with requests. The
number of connections a system can support is finite, so when more
requests come in than can be processed, the system will soon be
reserving all its connections for fake requests. At this point, any further
requests are simply dropped (ignored), and legitimate users who want
to connect to the target system will not be able to. Use of the system
has thus been denied to them.

Page 23 / 28

Downloaded by Mr. Omkar ([email protected])


lOMoARcPSD|29220132

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER – 2022 EXAMINATION


MODEL ANSWER
Subject: Network Information Security Subject Code: 22620

b) Explain Public Key Infrastructure with example. 6M


Ans. A public key infrastructure (PKI) is a set of roles, policies, 3M
hardware, software and procedures needed to create, manage, Explanatio
distribute, use, store and revoke digital certificates and manage public- n
key encryption. The purpose of a PKI is to facilitate the secure 1M
electronic transfer of information for a range of network activities such diagram
as e-commerce, internet banking and confidential email. 2M for
PKI is the governing body behind issuing digital certificates. It helps to example
protect confidential data and gives unique identities to users and
systems. Thus, it ensures security in communications.
The public key infrastructure uses a pair of keys: the public key and the
private key to achieve security. The public keys are prone to attacks
and thus an intact infrastructure is needed to maintain them.
PKI identifies a public key along with its purpose. It usually consists of
the following components:

 A digital certificate also called a public key certificate


 Private Key tokens
 Registration authority
 Certification authority
 CMS or Certification management system

Working on a PKI:
PKI and Encryption: The root of PKI involves the use of
cryptography and encryption techniques. Both symmetric and
asymmetric encryption uses a public key. There is always a risk of
MITM (Man in the middle). This issue is resolved by a PKI using
digital certificates. It gives identities to keys in order to make the
verification of owners easy and accurate.
Public Key Certificate or Digital Certificate: Digital certificates are
issued to people and electronic systems to uniquely identify them in the
digital world.
 The Certification Authority (CA) stores the public key of a user
along with other information about the client in the digital
certificate. The information is signed and a digital signature is also
included in the certificate.
 The affirmation for the public key then thus be retrieved by
validating the signature using the public key of the Certification
Authority.

Page 24 / 28

Downloaded by Mr. Omkar ([email protected])


lOMoARcPSD|29220132

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER – 2022 EXAMINATION


MODEL ANSWER
Subject: Network Information Security Subject Code: 22620

Certifying Authorities: A CA issues and verifies certificates. This


authority makes sure that the information in a certificate is real and
correct and it also digitally signs the certificate. A CA or Certifying
Authority performs these basic roles:

 Generates the key pairs – This key pair generated by the CA can be
either independent or in collaboration with the client.
 Issuing of the digital certificates – When the client successfully
provides the right details about his identity, the CA issues a
certificate to the client. Then CA further signs this certificate
digitally so that no changes can be made to the information.
 Publishing of certificates – The CA publishes the certificates so
that the users can find them. They can do this by either publishing
them in an electronic telephone directory or by sending them out to
other people.
 Verification of certificate – CA gives a public key that helps in
verifying if the access attempt is authorized or not.
 Revocation – In case of suspicious behavior of a client or loss of
trust in them, the CA has the power to revoke the digital
certificate.

The most popular usage example of PKI (Public Key Infrastructure) is


the HTTPS (Hypertext Transfer Protocol Secure) protocol. HTTPS is a
combination of the HTTP (Hypertext Transfer Protocol) and SSL/TLS
(Secure Sockets Layer/Transport Layer Security) protocols to provide
encrypted communication and secure identification of a Web server.

In HTTPS, the Web server's PKI certificate is used by the browser for
two purposes:

Page 25 / 28

Downloaded by Mr. Omkar ([email protected])


lOMoARcPSD|29220132

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER – 2022 EXAMINATION


MODEL ANSWER
Subject: Network Information Security Subject Code: 22620

 Validate the identity of the Web server by verify the CA's digital
signature in the certificate.
 Encrypt a secret key to be securely delivered to the Web server. The
secret key will be used to encrypt actual data to be exchanged between
the browser and the Web server.

Other examples of PKI (Public Key Infrastructure) are:

 Digital signature - The sender of a digital message uses his/her private


key to generate a digital signature attached to the message. The
receiver uses the sender's certificate to verify the digital signature to
ensure the message was sent by the claimed sender.
 Encryption of documents - The sender of a digital message uses the
receiver's certificate to encrypt the message to protect the
confidentiality of the message. Only the receiver who can use his/her
private key decrypt the message.
 Digital identification - User's certificate is stored in a smart card to be
used to verify card holder's identities.
 (CONSIDER ANY ONE EXAMPLE)

c) Explain Policies, configuration & limitations of firewall. 6M


Ans. Policies of firewall:
a) All traffic from inside to outside and vice versa must pass through the 1M for
firewall. To achieve this all access to local network must first be policies
physically blocked and access only via the firewall should be 1M for
permitted. As per local security policy traffic should be permitted. listing
b) The firewall itself must be strong enough so as to render attacks on it configurati
useless. on
2M for
Configuration of firewall configurati
There are 3 common firewall configurations. on, any one
1. Screened host firewall, single-homed bastion configuration can be
2. Screened host firewall, dual homed bastion configuration explained
3. Screened subnet firewall configuration 2M for
limitation,
1. Screened host firewall, single-homed bastion configuration any two
points
In this type of configuration a firewall consists of following parts
i)A packet filtering router
(ii)An application gateway.

Page 26 / 28

Downloaded by Mr. Omkar ([email protected])


lOMoARcPSD|29220132

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER – 2022 EXAMINATION


MODEL ANSWER
Subject: Network Information Security Subject Code: 22620

The main purpose of this type is as follows:Packet filter is used to


ensure that incoming data is allowed only if it is destined for
application gateway, by verifying the destination address field of
incoming IP packet. It also performs the same task on outing data by
checking the source address field of outgoing IP packet.
Application gateway is used to perform authentication and proxy
function. Here Internal users are connected to both application gateway
as well as to packet filters therefore if packet filter is successfully
attacked then the whole Internal Network is opened to the attacker

Fig single homed bastion configuration

2. Screened host firewall, dual homed bastion configuration


To overcome the disadvantage of a screened host firewall, single
homed bastion configuration, another configuration is available known
as screened host firewall, Dual homed bastion. n this, direct
connections between internal hosts and packet filter are avoided. As it
provide connection between packet filter and application gateway,
which has separate connection with the internal hosts. Now if the
packet filter is successfully attacked. Only application gateway is
visible to attacker. It will provide security to internal hosts.

Fig dual homed bastion configuration

Page 27 / 28

Downloaded by Mr. Omkar ([email protected])


lOMoARcPSD|29220132

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER – 2022 EXAMINATION


MODEL ANSWER
Subject: Network Information Security Subject Code: 22620

3. Screened subnet firewall configuration


It provides the highest security among all firewall configurations. It is
improved version over all the available scheme of firewall
configuration. It uses two packet filters, one between the internet and
application gateway and another between the application gateway and
the internal network. Thus this configuration achieves 3 levels of
security for an attacker to break into.

Fig Screened subnet firewall configuration

Limitations: (one mark)


1. Firewall do not protect against inside threats.
2. Packet filter firewall does not provide any content based filtering.
3. Protocol tunneling, i.e. sending data from one protocol to another
protocol which negates the purpose of firewall.
4. Encrypted traffic cannot be examine and filter.

Page 28 / 28

Downloaded by Mr. Omkar ([email protected])


lOMoARcPSD|29220132

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER – 2022 EXAMINATION


MODEL ANSWER
Subject: Wireless & Mobile Network Subject Code: 22622

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.

Q. Sub Answer Marking


No Q.N. Scheme
.
1. Attempt any FIVE of the following: 10
a) Define the term 2M
i) Routing area.
ii) Location area
Ans. i) Routing Area: The routing area is the packet-switched domain
equivalent of the location area. A "routing area" is normally a 1M
subdivision of a "location area". Routing areas are used by mobiles for each
which are GPRS-attached . definition

ii) Location Area: A "location area" is a set of base stations that are
grouped together to optimize signaling.

Page 1 / 26

Downloaded by Mr. Omkar ([email protected])


lOMoARcPSD|29220132

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER – 2022 EXAMINATION


MODEL ANSWER
Subject: Wireless & Mobile Network Subject Code: 22622

b) State the processes involved in the use of RFID in student 2M


attendance in a college. 2M for
Ans. Wireless data capture and Transaction are processes involved in the naming
use of RFID in student attendance in college. correct
processes

c) State two features of 5G technology. 2M


Ans.  Up to 10Gbps data rate - > 10 to 100x speed improvement over
4G and 4.5G networks 1M each
 1-millisecond latency Any 2
 Packet switching features
 CDMA multiplexing
 Up to 100x number of connected devices per unit area
(compared with 4G LTE)
 99.999% availability
 100% coverage
 90% reduction in network energy usage
 Up to 10-year battery life for low power IoT device

d) Classify Clustering algorithm. 2M


Ans. i. Distributed Clustering Algorithm 1M
ii. CentralizedClustering Algorithms each

e) Define the term LEC (Local Exchange Carrier) 2M


Ans. Local Exchange Carrier (LEC) is a local telecom Exchange that 2M for
provides telecommunication services within the area and operates Correct
within a local area. definition

f) State two applications of MANET. 2M


Ans.  PAN and Bluetooth: A PAN is localized and tiny range
network whose devices are generally belong to a specified 1M each
individual. Limited-range MANET such as Bluetooth can make Any 2
simpler the exchange among several portable devices like a applications
laptop, and a cell phone.

 Business Sector: Ad-hoc network could be used for rescuing


and emergency processes for adversity assistance struggles, for
instance, in flood, fire or earthquake. Emergency saving
procedures should take place where damaged and non-existing

Page 2 / 26

Downloaded by Mr. Omkar ([email protected])


lOMoARcPSD|29220132

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER – 2022 EXAMINATION


MODEL ANSWER
Subject: Wireless & Mobile Network Subject Code: 22622

transmissions structure and quick preparation of a transmission


network is required.

 Sensor Networks: managing home appliances with MANETs


in both the case like nearby and distantly. Tracking of objects
like creatures. Weather sensing related activities.

 Backup Services: liberation operations, tragedy recovery,


diagnosis or status or record handing in hospitals, replacement
of stationary infrastructure.

 Educational sector: arrangement of communications facilities


for computer-generated conference rooms or classrooms or
laboratories.

 Military field: Ad-Hoc networking can permit army to exploit


benefit of conventional network expertise for preserving any
info network among vehicles, armed forces, and headquarters of
information.

 Cooperative work: To facilitate the commercial settings,


necessity for concerted computing is very significant external to
office atmosphere and surroundings as compared to inner
environment. People want getting outside meetings for
exchanging the information plus cooperating with each other
regarding any assigned task.

 Confined level: Ad-Hoc networks are able to freely associate


with immediate, in addition momentary hypermedia network by
means of laptop computers for sharing the info with all the
contestants’ e.g. classroom and conference. Additional valid
and confined level application may be in domestic network
where these devices can interconnect straight in exchanging the
information.
(Any other Relevant Application can be considered)

Page 3 / 26

Downloaded by Mr. Omkar ([email protected])


lOMoARcPSD|29220132

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER – 2022 EXAMINATION


MODEL ANSWER
Subject: Wireless & Mobile Network Subject Code: 22622

g) State two specifications of IMT 2000. 2M


Ans.  Frequency 2000MHz region
 Target user data rate 2000 kbps 1M each
 144kbps absolute minimum acceptable transmission data rate
 384 kbps the ideal achievable data rate Any two
 2000 kbps data rate while operating mobile phone inside specificatio
building for stationary user. ns
 Symmetrical and asymmetrical Data transmission
 High data rates for indoor and outdoor operations
 Roaming between different operational environments

2. Attempt any THREE of the following: 12


a) Draw the block diagram of the architecture of PCS (Personal 4M
Communication Services) and explain.

Ans.
2M for
Block
Diagram

• The PCS Network Architecture is a communication network


structure in which components communicate with one another to 2M for
establish wireless communication. explanation
• The PCS Network Architecture is divided into two sections:
• Wireline Transport Network
• Radio Network

Page 4 / 26

Downloaded by Mr. Omkar ([email protected])


lOMoARcPSD|29220132

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER – 2022 EXAMINATION


MODEL ANSWER
Subject: Wireless & Mobile Network Subject Code: 22622

Radio Network:
• The radio network connects Mobile Stations (MS) and other
network components via a wireless network.
• MS connect with one another via the radio network's Base Stations
(BS).
• The radio link protocols are handled by the BS in a radio network
during communication.
• The BSC serves as a link between the radio network's BTS and the
Wireline Transport network's MSC

Wireline Transport Network:


• The Base Station Controller (BSC) in the Radio Network
interfaces with the Mobile Switching Center (MSC) in the
Wireline Transport Network.
• To provide wireline customers with communication services, MSC
connects to the Public Switch Telephone Network (PSTN).
• MSC also communicates with a mobility database, which keeps
track of where moving devices are in the architecture.

b) Explain the functions performed by GPRS support nodes. 4M


Ans. There are TWO Support nodes in GPRS:
 Serving GPRS Support Node (SGSN)
 Gateway GPRS Support Nodes (GGSN) 2M for each
node
 Serving GPRS Support Node (SGSN)
The Serving GPRS Support Node is responsible for authentication of
GPRS mobiles, registration of mobiles in the network, mobility
management, and collecting information on charging for the use of
the air interface
 Gateway GPRS Support Node (GGSN)
The Gateway GPRS Support Node acts as an interface and a router to
external networks. It contains routing information for GPRS mobiles,
which is used to tunnel packets through the IP based internal
backbone to the correct Serving GPRS Support Node. The GGSN
also collects charging information connected to the use of the external
data networks and can act as a packet filter for incoming traffic.

Page 5 / 26

Downloaded by Mr. Omkar ([email protected])


lOMoARcPSD|29220132

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER – 2022 EXAMINATION


MODEL ANSWER
Subject: Wireless & Mobile Network Subject Code: 22622

c) Draw the WAP protocol stack and state the functions of any four 4M
protocols.
Ans.

1M for each
protocol

Any four
protocols

1. Wireless Datagram Protocol (WDP):


The WDP allows WAP to be bearer-independent by adapting the
transport layer of the underlying bearer. The WDP presents a
consistent data format to the higher layers of the WAP protocol stack,
thereby offering the advantage of bearer independence to application
developers.
2.Wireless Transport layer Security(WTLS)
WTLS incorporates security features that are based upon the
established Transport Layer Security (TLS) protocol standard. It
includes data integrity checks, privacy, service denial, and
authentication services.
3.Wireless Transaction Protocol:
The WTP runs on top of a datagram service, such as User Datagram
Protocol (UDP) and is part of the standard suite of TCP/IP protocols
used to provide a simplified protocol suitable for low bandwidth
wireless stations.
4. Wireless Session Protocol:
Unlike HTTP, WSP has been designed by the WAP Forum to provide
fast connection suspension and reconnection.
5. Wireless Application Environment (WAE).
This layer is of most interest to content developers because it contains
among other things, device specifications, and the content
development programming languages, WML, and WMLScript.

Page 6 / 26

Downloaded by Mr. Omkar ([email protected])


lOMoARcPSD|29220132

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER – 2022 EXAMINATION


MODEL ANSWER
Subject: Wireless & Mobile Network Subject Code: 22622

d) Draw the block schematic of WLL architecture and explain. 4M


Ans.

2M for
Block
Diagram

WLL stands for Wireless Local Loop. Microwave wireless linkcan be


used to create a wireless local loop such as shown in figure. The
components are
 PSTN:
It is Public Switched Telephone Network which is a circuit
switched network. It is a collection of world’s interconnected
circuit switched telephone networks.
 Switch Function:
Switch Function switches the PSTN among various WANUs.
 WANU:
It is short for Wireless Access Network Unit. It is present at the 2M for
local exchange office. All local WASUs are connected to it. Its explanation
functions includes: Authentication, Operation & maintenance,
Routing, Transceiving voice and data. It consists of following
sub-components:
i. Transceiver: It transmits/receives data.
ii. WLL Controller: It controls the wireless local loop component
with WASU.
iii. AM: It is short for Access Manager. It is responsible for
authentication.
iv. HLR: It is short for Home Location Register. It stores the
details of all local WASUs.
 WASU:
It is short for Wireless Access Subscriber Units. It is present at
the house of the subscriber. It connects the subscriber to WANU
and the power supply for it is provided locally.

Page 7 / 26

Downloaded by Mr. Omkar ([email protected])


lOMoARcPSD|29220132

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER – 2022 EXAMINATION


MODEL ANSWER
Subject: Wireless & Mobile Network Subject Code: 22622

3. Attempt any THREE of the following: 12


a) Compare the features of 3G and 4G. 4M

Ans. Parameters 3G Technology 4G Technology 1M each for


any relevant
Full Form The term 3G is an The term 4G is an abbreviation feature
abbreviation for the third for the fourth generation
generation technology. technology.
Maximum It can go up to 5 It can go much higher, about 500
Upload Rate Megabytes per second. Megabytes per second.
Maximum The 3G technology offers The 4G technology can
Rate of a maximum download download videos at a much
Download rate of about 21 faster rate, which can go as high
Megabytes per second. as 1 Gigabyte per second.
Switching It utilizes the packet It utilizes both the message
Techniques switching technique. switching as well as the packet
switching techniques.
Range of The frequency of the 3G The frequency range of the 4G
Frequency technology ranges technology ranges somewhat
somewhat between 1.8 to between 2 to 8 Gigahertz.
2.5 Gigahertz.
Leniency The 3G technology is The 4G technology is both
horizontally lenient. vertically as well as horizontally
lenient.
Network The network architecture The network architecture of the
Architecture of the 3G technology is a 4G technology is cell-based for a
wide area cell-based one. wide area along with the
integration of WLAN.
Error The 3G technology The 4G technology performs
Correction performs error correction error correction using the
using the turbo codes. concatenated codes.

b) Explain the Quality of service parameters of GPRS. 4M


Ans. The QoS is a vital feature of GPRS services as there are different QoS 1M for each
support requirements for assorted GPRS applications like realtime point
multimedia, web browsing, and e-mail transfer.
GPRS allows defining QoS profiles using the following parameters :
 Service Precedence
 Reliability
 Delay and
 Throughput

Page 8 / 26

Downloaded by Mr. Omkar ([email protected])


lOMoARcPSD|29220132

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER – 2022 EXAMINATION


MODEL ANSWER
Subject: Wireless & Mobile Network Subject Code: 22622

These parameters are described below:


Service Precedence
The preference given to a service when compared to another service
is known as Service Precedence.This level of priority is classified
into three levels called:
 high
 normal
 low
When there is network congestion, the packets of low priority are
discarded as compared to high or normal priority packets.
Reliability
This parameter signifies the transmission characteristics required by
an application.The reliability classes are defined which guarantee
certain maximum values for the probability of loss, duplication, mis-
sequencing, and corruption of packets.
Delay
The delay is defined as the end-to-end transfer time between two
communicating mobile stations or between a mobile station and the
GI interface to an external packet data network.
This includes all delays within the GPRS network, e.g., the delay for
request and assignment of radio resources and the transit delay in the
GPRS backbone network. Transfer delays outside the GPRS network,
e.g., in external transit networks, are not taken into account.
Throughput
The throughput specifies the maximum/peak bit rate and the mean bit
rate.
Using these QoS classes, QoS profiles can be negotiated between the
mobile user and the network for each session, depending on the QoS
demand and the available resources.
c) Encode the datastream 1011000101 using the following 4M
techniques
i) RZ Bipolar
ii) AMI
iii) Manchester
iv) NRZ-unipolar

Page 9 / 26

Downloaded by Mr. Omkar ([email protected])


lOMoARcPSD|29220132

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER – 2022 EXAMINATION


MODEL ANSWER
Subject: Wireless & Mobile Network Subject Code: 22622

Ans. 1M for each


technique

d) Draw the architecture of WSN and explain. 4M


Ans. There are 2 types of architecture used in WSN:
1. Layered Network Architecture:Layered Network Architecture 2M for
makes use of a few hundred sensor nodes and a single powerful base diagram
station. Network nodes are organized into concentric Layers. It
consists of 5 layers and three crosslayers.

Page 10 / 26

Downloaded by Mr. Omkar ([email protected])


lOMoARcPSD|29220132

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER – 2022 EXAMINATION


MODEL ANSWER
Subject: Wireless & Mobile Network Subject Code: 22622

The 5 layers are:


2M for
1. Application -Responsible for traffic management and provide explanation
software for differentapplicationsthat translate the data in an
understandable form orsendqueriesto obtaincertain information Any one
architecture
2. Transport Layer-Layer-The function of thislayer is to provide can be
reliability and congestionavoidance where a lot of protocols designed explained
to provide thisfunction are either appliedon the upstream or by students
downstream.

3. Network Layer-The major function of thislayer is


routing,handling the major challengesare in the powersaving, limited
memory and buffers,sensor does not have a global IDand have to be
self organized. The basic idea of the routing protocol isto define a
reliable path and redundant paths.

4. Data Link Layer-Responsible for multiplexing data streams, data


frame detection, MAC, and error control, ensure reliability ofPoint–
point or point– multipoint. Errors or unreliability comesfrom.

5. Physical Layer -Responsible for frequency selection, carrier


frequency generation,signal detection, Modulation and data
encryption The cross layers : These layers are used to manage the
network and make the sensors work together in order to increase the
overall efficiency of the network

Page 11 / 26

Downloaded by Mr. Omkar ([email protected])


lOMoARcPSD|29220132

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER – 2022 EXAMINATION


MODEL ANSWER
Subject: Wireless & Mobile Network Subject Code: 22622

Three functions are-


1.Power Management Plane
2.Mobility Management Plane-detect sensor nodes movement. Node
can keep track of neighbors and power levels (for power balancing )
3.Task Management Plane-schedule the sensing tasks to a given area.
Determine which nodes are off and which ones are on.

2. Clustered Network Architecture:


• In Clustered Network Architecture, Sensor Nodes autonomously
clubs into groups called clusters. It isbased on the Leach Protocol
which makes use of clusters. Leach Protocol stands for Low Energy
AdaptiveClustering Hierarchy.
Properties of Leach Protocol:
• It is a 2-tier hierarchy clustering architecture.
• It is a distributed algorithm for organizing the sensor nodes into
groups called clusters.
• The cluster head nodes in each of the autonomously formed clusters
create the Time-division multiple access
(TDMA) schedules.
• It makes use of the concept called Data Fusion which makes it
energy efficient.

Page 12 / 26

Downloaded by Mr. Omkar ([email protected])


lOMoARcPSD|29220132

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER – 2022 EXAMINATION


MODEL ANSWER
Subject: Wireless & Mobile Network Subject Code: 22622

4. Attempt any THREE of the following: 12


a) Draw the architecture of UMTS and explain 4M
Ans.

2M for any
relevant
diagram

UMTS system uses the same core network as the GPRS and uses
entirely new radio interface. 2M for
• The new radio network in UMTS is called UTRAN (UMTS explanation
Terrestrial Radio Access Network) and is connected to the core
network (CN) of GPRS via Iu interface.
• The Iu is the UTRAN interface between the Radio network
controller RNC and CN.
• The mobile terminal in UMTS is called User Equipment (UE). The
UE is connected to Node-B over high speed Uu (up to 2 Mbps)
Interface. The Node-B are the equivalent of BTS in GSM and
typically serve a cell site. Several Node-Bs are controlled by a
single RNCs over the Iub interface.
• The RNCs are connected to CN through Iu interface.
• The packet switched data is transmitted through Iu-PS interface
and circuit switched data is transferred over Iu-CS interface. One
of the new interfaces in UTRAN is Iur interface which connects
two RNCs and has no equivalent in GSM system. The Iur interface
facilitates handling of 100 percent of RRM (Radio Resource

Page 13 / 26

Downloaded by Mr. Omkar ([email protected])


lOMoARcPSD|29220132

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER – 2022 EXAMINATION


MODEL ANSWER
Subject: Wireless & Mobile Network Subject Code: 22622

Management) and eliminates the burden from CN.

• UMTS also supports GSM mode connections in which case the


MS connect to the CN through Um interface to BSS and BSS
connects through A (Gb interface in GPRS) interface to CN.

b) Compare GSM networks with GPRS networks 4M

Ans. 1M for each


GSM GPRS
relevant
point
GSM represents Global GPRS represents General Packet
Systems for Mobile Radio Service.
Communications.

It is 2G It is 2.5 G

The frequency bands The frequency bands used in the


used in the GSM system system are 850, 900, 1800 and
are 900 and 1800 MHz. 1900 MHZ.

GSM is used in circuit GPRS is used for packet switching


switching traffic. traffic.

GSM is used in almost all GPRS services cannot be provided


countries and remote in all the countries and remote
locations. Therefore, locations. This creates GPRS
GSM supports its service confined to developed areas with a
to the users. suitable network connection.

Internet service is not Internet services are supported in


supported in GSM and GPRS and this is completed with
this creates wireless systems. Therefore the
communication harder in internet can be used even in remote
the system. locations and communication is
Communication has to be completed through emails or other
completed through messaging services with the internet.
messages or calls.

Page 14 / 26

Downloaded by Mr. Omkar ([email protected])


lOMoARcPSD|29220132

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER – 2022 EXAMINATION


MODEL ANSWER
Subject: Wireless & Mobile Network Subject Code: 22622

c) Explain the energy constraints in sensor nodes in WSN and name 4M


the protocols to design energy efficiency in WSN
Ans. Energy constraints in sensor nodes inWSN:

Wireless sensor node is microelectronic device meansit is equipped 2M for


with a limited number of power source. Nodes are dependent constraints
onbattery for their power. Hence power conservation and power
management isan important issue in wireless sensor network. Due to
this reason researchersare focusing on the design of power aware
protocols and algorithm forsensors network.

Protocol used:
Hierarchal routing protocols are considered more energy efficient 2M for
when compared with flat and location based routing protocols. A relevant
number of hierarchal based energy efficient routing protocols have protocol
been referred to in the literature review such as LEACH , TEEN and
APTEEN , PEGASIS , MECN and SMECN , SOP , HPAR , VGA ,
Sensor Aggregate , TTDD , Energy Efficient Self-Healing , Energy
Efficient Position Based , and CELRP .

d) Explain the logical channels in a GPRS system in short. 4M


Ans. There is a variety of channels used within GPRS, and they can be set
into groups dependent upon whether they are for common or
dedicated use.The system does use the GSM control and broadcast 4M for
channels for initial set up, but all the GPRS actions are carried out correct
within the GPRS logical channels carried within the PDCH explanation

Broadcast channels:
• Packet Broadcast Central Channel (PBCCH):
• This is a downlink only channel that is used to broadcast
information to mobiles and informs them of incoming calls
etc.
• It is very similar in operation to the BCCH used for GSM.
• In fact the BCCH is still required in the initial to provide a
time slot number for the PBCCH.
• In operation the PBCCH broadcasts general information such
as power control parameters, access methods and operational
modes, network parameters, etc, required to set up calls.

Page 15 / 26

Downloaded by Mr. Omkar ([email protected])


lOMoARcPSD|29220132

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER – 2022 EXAMINATION


MODEL ANSWER
Subject: Wireless & Mobile Network Subject Code: 22622

Common control channels:


• Packet Paging Channel (PPCH): This is a downlink only
channel and is used to alert the mobile to an incoming call and
to alert it to be ready to receive data. It is used for control
signaling prior to the call set up. Once the call is in progress a
dedicated channel referred to as the PACCH takes over.
• Packet Access Grant Channel (PAGCH): This is also a
downlink channel and it sends information telling the mobile
which traffic channel has been assigned to it. It occurs after
the PPCH has informed the mobile that there is an incoming
call.
• Packet Notification Channel (PNCH): This is another
downlink only channel that is used to alert mobiles that there
is broadcast traffic intended for a large number of mobiles. It
is typically used in what is termed point-to-point multicasting.
• Packet Random Access Channel (PRACH): This is an
uplink channel that enables the mobile to initiate a burst of
data in the uplink. There are two types of PRACH burst, one
is an 8 bit standard burst, and a second one using an 11 bit
burst has added data to allow for priority setting. Both types
of burst allow for timing advance setting.

Dedicated control channels:


• Packet Associated Control Channel (PACCH): : This
channel is present in both uplink and downlink directions and
it is used for control signaling while a call is in progress. It
takes over from the PPCH once the call is set up and it carries
information such as channel assignments, power control
messages and acknowledgements of received data.
• Packet Timing Advance Common Control Channel
(PTCCH): This channel, which is present in both the uplink
and downlink directions is used to adjust the timing advance.
This is required to ensure that messages arrive at the correct
time at the base station regardless of the distance of the
mobile from the base station. As timing is critical in a TDMA
system and signals take a small but finite time to travel this
aspect is very important if long guard bands are not to be left.

Page 16 / 26

Downloaded by Mr. Omkar ([email protected])


lOMoARcPSD|29220132

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER – 2022 EXAMINATION


MODEL ANSWER
Subject: Wireless & Mobile Network Subject Code: 22622

Dedicated traffic channel:


• Packet Data Traffic Channel (PDTCH): This channel is
used to send the traffic and it is present in both the uplink and
downlink directions. Up to eight PDTCHs can be allocated to
a mobile to provide high speed data.

e) Draw the MANET Topology and explain. State two applications 4M


of MANET.
Ans. Topology in MANET
MANET may operate as standalone fashion or they can be the part of 2M for
larger internet. They Topology
form highly dynamic autonomous topology with the presence of one
or multiple different
transceivers between nodes. Autonomous Behavior: Each node can
act as a host and router, 2M for
which shows its autonomous behavior. Typically communicate at applications
radio frequencies
(30MHz-5GHz)
• TORA is a routing algorithm and is mainly used in MANETs to
enhance scalability TORA
is an adaptive routing protocol. It is therefore used in multi-hop
networks.

Page 17 / 26

Downloaded by Mr. Omkar ([email protected])


lOMoARcPSD|29220132

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER – 2022 EXAMINATION


MODEL ANSWER
Subject: Wireless & Mobile Network Subject Code: 22622

Applications of MANET
• Defense applications: Many defense applications require on the fly
communications set-up, and adHoc/sensor networks are excellent
candidates for use in battlefield management.
• Crisis management applications: These arise, for example, as a
result of natural disasters in which theentire communication
infrastructure is in disarray. Restoring communications quickly is
essential.
• Telemedicine: The paramedic assisting the victim of a traffic
accident in a remote location must accessmedical records (e.g. X-
rays) and may need video conference assistance from a surgeon for an
emergencyintervention. In fact, the paramedic may need to
instantaneously relay back to the hospital the victim's X-rays and
other diagnostic tests from the site of the accident.
• Tele- Geoprocessing application: The combination of GPS, GIS
(Geographical Information Systems), andhigh-capacity wireless
mobile systems enables a new type of application referred to as tele-
geoprocessing WSN
• Virtual Navigation: A remote database contains the graphical
representation of building, streets, andphysical characteristics of a
large metropolis. They may also "virtually" see the internal layout of
buildings,including an emergency rescue plan, or find possible points
of interest.
• For example, A VANET (Vehicular Ad Hoc Network), is a type of
MANET that allows vehicles tocommunicate with roadside
equipment.

5. Attempt any TWO of the following: 12


a) Explain location update procedure for a inter LA Movement in 6M
GSM with suitable diagram
Ans. Inter LA movement in GSM
Step 1:
 The MS moves from LA1 to LA2, where both LAs are
connected to the same MSC
 A location update request message is sent from the MS to the 4M for
MSC through the BTS, include the address of the previously explanation
visited LA, MSC, and VLR and TMSI is used to avoid
sending the IMSI on the radio path

Page 18 / 26

Downloaded by Mr. Omkar ([email protected])


lOMoARcPSD|29220132

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER – 2022 EXAMINATION


MODEL ANSWER
Subject: Wireless & Mobile Network Subject Code: 22622

Step 2:The MSC forwards the location update request to the VLR by
a TCAP message(TRANSACTION CAPABILITY APPLICATION
PART) message, MAP_UPDATE_LOCATION_AREA ,
 Address of the MSC ,
 TMSI of the MS ,
 Previous location area identification (LAI)
 Target LAI
Step 3 and Step 4: 2M for
MSC updates the LAI field of the VLR record, and replies with an diagram
acknowledgment to the MS through the MSC

b) Explain the principle of working of ASK and BPSK with suitable 6M


waveforms for the bit sequence 110101100
Ans. ASK Block Diagram

Page 19 / 26

Downloaded by Mr. Omkar ([email protected])


lOMoARcPSD|29220132

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER – 2022 EXAMINATION


MODEL ANSWER
Subject: Wireless & Mobile Network Subject Code: 22622

2M for
diagram

• The carrier is a sinewave of frequency . 4M for


explanation
• The digital signal from the computer acts as the modulating signal
• The ASK modulator is nothing but a multiplier followed by a
band pass filter.
• Due to the multiplication, the ASK output will be present only
when a binary “1” is to be transmitted
• The ASK output corresponding to a binary “0” is zero.
• The carrier is transmitted when a binary 1 is to be sent and no
carrier is transmitted when a binary 0 is to be sent.
PSK Block Diagram

Page 20 / 26

Downloaded by Mr. Omkar ([email protected])


lOMoARcPSD|29220132

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER – 2022 EXAMINATION


MODEL ANSWER
Subject: Wireless & Mobile Network Subject Code: 22622

• Phase-shift keying (PSK) is a digital to analog modulation scheme


based on changing, or modulating, the initial phase of a carrier
signal.
• PSK is used to represent digital information, such as binary digits
zero (0) and one (1).The modulation of PSK is done using a
balance modulator, which multiplies the two signals applied at the
input.
• For a zero binary input, the phase will be 180° and for a high input,
the phase reversal is of 0°
• Following is the diagrammatic representation of PSK Modulated
output wave along with its given input.
• The output sine wave of the modulator will be the direct input
carrier or the inverted (180° phase shifted) input carrier, which is a
function of the data signal.
• Amplitude and frequency of the original carrier signal is kept
constant.

Page 21 / 26

Downloaded by Mr. Omkar ([email protected])


lOMoARcPSD|29220132

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER – 2022 EXAMINATION


MODEL ANSWER
Subject: Wireless & Mobile Network Subject Code: 22622

c) Draw the architecture of 4G and explain. 6M


Ans.

2M for
diagram

Figure: 4G network architecture

4G network is an integration of all heterogeneous wireless access


networks such as Ad-hoc, cellular, hotspot and satellite radio
component.
Technologies used in 4G are smart antennas for multiple input and
multiple output (MIMO), IPv6,VoIP, OFDM and Software Defined 4M for
Radio (SDR) System. explanation
Smart Antennas:
Smart Antennas are Transmitting and receiving antennas.
It does not require increase power and additional frequency.
IPV6 Technology:
4G uses IPV6 Technology in order to support a large number of
wireless enable devices.
It enables a number of application with better multicast, security and
route optimization
capabilities.
VoIP:
It stands for Voice over IP.
It allows only packet to be transferred eliminating complexity of 2
protocols over the same circuit.
OFDM
OFDM stands for Orthogonal Frequency Division Multiplexing.It is
currently used as WiMax and WiFi.

Page 22 / 26

Downloaded by Mr. Omkar ([email protected])


lOMoARcPSD|29220132

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER – 2022 EXAMINATION


MODEL ANSWER
Subject: Wireless & Mobile Network Subject Code: 22622

SDR:
SDR stands for Software Defined Radio.It is the form of open
wireless architecture.
MME- Mobility Management Entity:
It is used for Paging, Authentication, Handover and Selection of
Serving Gateway
SGW-Serving Gateway:
It is used to Routing and Forwarding user data packet.
PDN-GW Packet Data Network Gateway:
It is used for User Equipment (UE) IP allocation.
HSS-Home Subscriber Server:
It is a user Database used for service subscriber, user identification
and addressing
PCRF-Policy and Charging Rule Function:
It provide quality of service and charging
eNode B-evolved Node B:
It is used as radio resources management and radio bearer control.

6. Attempt any TWO of the following: 12


a) Explain the Network signaling and radio interfaces in GSM. 6M

2M for
Ans. diagram

Page 23 / 26

Downloaded by Mr. Omkar ([email protected])


lOMoARcPSD|29220132

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER – 2022 EXAMINATION


MODEL ANSWER
Subject: Wireless & Mobile Network Subject Code: 22622

GSM Network Signaling: 4M for


• The figure shows various network signaling protocols used by the explanation
entity interfaces in GSM
• The software platform for implementing GSM network signaling
protocol is GSM MAP(Mobile Application Part)
• GSM MAP is used in B,C,D,E,F,G interfaces
• In terms of Network signaling, the GSM architecture can be
partitioned into 3 parts
1. databases
2. Switches
3. Radio System
Databases:
GSM utilizes databases such as HLR, VLR and AuC. It also consists
of EIR which is used to maintain a list of legitimate , fraudulent
mobile station(faulty)
EIR is optional in GSM. AuC/EIR is a combined Node
To accomplish mobility management, VLRs communicate using G
interface and HLR to VLR using D interface
Switches :
• The GMSC performs necessary switching functions for mobile
stations within the geographical area it controls. An MSC area is
partitioned into several location areas. Each LA consists of many
BTS. For originating a call from MS to a wireline user , the MSC
communicates with SSP in the PSTN using SS7ISUP protocol
• To deliver a call from PSTN to MS, the originating SSP in PSTN
with Gateway MSC using SS&ISUP protocol
• In Intersystem Handoff, 2 MSCs are required to communicate
through E interface
• To perform Mobility and call handling tasks, the MSC needs to
communicate with HLR using the C interface and with VLR using
B interface
• To prevent Fraudulent handset usage, MSCcommunicates with EIR
using F interface
Radio system
It consists of BSc, BTS and MS. The BSCs connect to MSC through
A interface. BSC connects to BTS through A-Bis interface using
ISDN link access protocol for D channel(LAPD). A BTS
communicates with MS through radio interface Um

Page 24 / 26

Downloaded by Mr. Omkar ([email protected])


lOMoARcPSD|29220132

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER – 2022 EXAMINATION


MODEL ANSWER
Subject: Wireless & Mobile Network Subject Code: 22622

b) Draw the block diagram of a sensor node in WSN and state the 6M
function of various components.
Ans. • A Wireless Sensor Network (WSN) is a wireless network 2M for
consisting of spatially distributed autonomous devices using diagram
sensors to monitor physical or environmental conditions.
• A WSN system incorporates a gateway that provides wireless
connectivity back to the wired worldand distributed nodes.
4M for
explanation

• Sensors: Sensors are used by wireless sensor nodes to capture data


from their environment. They arehardware devices that produce a
measurable response to a change in a physical condition
liketemperature or pressure.
• Sensors are classified into two categories: Passive and Active
sensors.
 Passive sensors sense the data without actually manipulating the
environment by activeprobing. They are self-powered, that is,
energy is needed only to amplify their analog signal.
 Active sensors actively probe the environment, for example, a
sonar or radar sensor, and theyrequire continuous energy from a
power source.
• Microcontroller: The controller performs tasks, processes data and
controls the functionality ofother components in the sensor node.
While the most common controller is a microcontroller,
otheralternatives that can be used as a controller are: a general
purpose desktop microprocessor, digitalsignal processors, FPGAs
(Field Programmable Gate Array) and ASICs (Application
SpecificIntegrated Circuits).
 Digital signal Processors may be chosen for broadband wireless
communication applications,but in Wireless Sensor Networks the

Page 25 / 26

Downloaded by Mr. Omkar ([email protected])


lOMoARcPSD|29220132

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION


(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER – 2022 EXAMINATION


MODEL ANSWER
Subject: Wireless & Mobile Network Subject Code: 22622

wireless communication is often modest: i.e., simpler, easierto


process modulation and the signal processing tasks of actual
sensing of data is lesscomplicated.
 Transceivers: Sensor nodes often make use of ISM band, which
gives free radio, spectrum allocationand global availability. The
possible choices of wireless transmission media are radiofrequency
(RF), optical communication (laser) and infrared.
 Memory: Flash memories are used due to their cost and storage
capacity. Memory requirements arevery much application
dependent.
 Power source: Two power saving policies used are Dynamic
Power Management (DPM) andDynamic voltage
Scaling (DVS). DPM conserves power by shutting down parts of
the sensor node which are not currently used or active. A DVS
scheme varies the power levels within the sensor node depending
on the non-deterministic workload.
c) Compare WCDMA and CDMA 2000 on the basis of channel 6M
Bandwidth, Chip rate, Duplex mode, Modulation, Frame length
and Power Control rate.
Ans.
Parameters CDMA 2000 WCDMA
Channel 1.25MHz(1X),3.75M 5MHz
1M
Bandwidth Hz
for each
Chip Rate 1.2288Mcps(1X),3.68 4-256
correct
64Mcps(3X)
point
Duplex mode Full duplex Full duplex
Modulation QPSK (forward QPSK(both links)
link),BPSK (reverse
link)
Frame length 5ms(signaling),20,40, 10ms for physical
80ms physical layer layer,10,20,40 and 80 ms
frames for transport layer
Power 800Hz in both the 1500Hz in both the links
Control rate links

Page 26 / 26

Downloaded by Mr. Omkar ([email protected])

You might also like