MCC New
MCC New
Lab Manual
Fourth Year / Semester-VII
Subject: Mobile Computing Communication
3. Broad Base
To provide broad education necessary to understand the science of computer engineering and the
impact of it in a global and social context.
4. Techno-leader
To provide exposure to emerging cutting edge technologies, adequate training & opportunities to
work as teams on multidisciplinary projects with effective communication skills and leadership
qualities.
5. Practice citizenship
To provide knowledge of professional and ethical responsibility and to contribute to society
through active engagement with professional societies, schools, civic organizations or other
community activities.
2|Page
Departmental Program Outcomes (POs)
2. Problem Analysis: Identify, formulate, review research, and analyze complex engineering
problems reaching substantiated conclusions using first principles of mathematics, naturalizing
sciences, and engineering sciences.
5. Modern Tool Usage: Create, select, and apply appropriate techniques, resources, and modern
engineering and IT tools including prediction and modeling to complex engineering activities
with an understanding of the limitations.
6. The Engineer and Society: Apply reasoning informed by the contextual knowledge to assess
societal, health, safety, legal and cultural issues and the consequent responsibilities relevant to
the professional engineering practice.
8. Ethics: Apply ethical principles and commit to professional ethics and responsibilities and
norms of the engineering practice.
9. Individual and Team Work: Function effectively as an individual and as a member or leader
in diverse teams and individual and as a member or leader in diverse teams and in
multidisciplinary settings.
11. Project Management and Finance: Demonstrate knowledge and understanding of the
engineering and management principles and apply these to one’s own work as a member and
leader in a team to manage projects and in multidisciplinary environments.
3|Page
12. Life-Long Learning: Recognize the need for and have the preparation and ability to engage
in independent and lifelong learning in the broadest context of technological change.
4|Page
Index
Sr.No. Contents Page No.
1. List of Experiments
2. Course Objective, Course Outcomes and
Experiment Plan
3. CO-PO Mapping
4. Study and Evaluation Scheme
5. Experiment No. 1
6. Experiment No. 2
7. Experiment No. 3
8. Experiment No. 4
9. Experiment No. 5
10. Experiment No. 6
11. Experiment No. 7
12. Experiment No. 8
13. Experiment No. 9
14. Experiment No. 10
5|Page
List of Experiments
Sr.No. Experiments Name
1 To setup and configuration of android studio to develop mobile application.
2 Develop an application that uses GUI components.
3 Write a mobile application to calculator.
4 To implement mobile node discovery.
5 Develop an application that makes use of database
6 To setup and configuration of Wireless Access Point using NS2.
7 Write a mobile application to create alarm clock.
8 Develop an application that writes data to the SD card.
9 Implement an application that creates alert upon receiving a message.
10 Write an application that draws basic graphical primitives on the screen.
6|Page
Course Objectives & Course Outcome,
Experiment Plan
Course Objectives:
To To introduce the basic concepts and principles in mobile computing. This includes
1. major techniques involved, and networks & systems issues for the design and
implementation of mobile computing systems and applications.
Course Outcomes:
Student will identify basic concepts and principles in mobile communication &
CO1 computing, cellular architecture.
CO2 Student will describe the components and functioning of mobile networking.
CO3 Student will classify variety of security techniques in mobile network:
CO4 Student will apply the concepts of WLAN for local as well as remote applications.
CO5 Student will describe and apply the concepts of mobility management
CO6 Student will describe Long Term Evolution (LTE) architecture and its interfaces.
7|Page
Experiment Plan
Module Week Course
Experiments Name
No. No. Outcome
8|Page
Mapping Course Outcomes (CO) -
Program Outcomes (PO)
Subject Course Outcomes Contribution to Program outcomes
Weight
P10
P11
P12
P1
P2
P3
P4
P5
P6
P7
P8
P9
Student will identify basic concepts
and principles in mobile
CO1
communication & computing,
cellular architecture.
Student will describe the
CO2 components and functioning of
mobile networking.
Student will classify variety of
PRATICA CO3 security techniques in mobile
L network:
50%
Student will apply the concepts of
CO4 WLAN for local as well as remote
applications.
Student will describe and apply the
CO5
concepts of mobility management
Student will describe Long Term
CO6 Evolution (LTE) architecture and
its interfaces.
9|Page
Study and Evaluation Scheme
Course
Course Name Teaching Scheme Credits Assigned
Code
CPC801 Mobile Theory Practical Tutorial Theory Practical Tutorial Total
Communication 02 02 -- 100 02 -- 02
& Computing
Term Work:
Internal Assessment consists of two tests. Test 1, an Institution level central test, is for 20 marks
and is to be based on a minimum of 40% of the syllabus. Test 2 is also for 20 marks and is to be
based on the remaining syllabus. Test 2 may be either a class test or assignment on live problems
or course project
Oral examination is to be conducted by pair of internal and external examiners based on the
syllabus.
10 | P a g e
Experiment No. 1
Theory:
Android Studio is the official integrated development environment (IDE) for Android application
development. It is based on the IntelliJ IDEA, a Java integrated development environment for
software, and incorporates its code editing and developer tools. To support application
development within the Android operating system, Android Studio uses a Gradle-based build
system, emulator, code templates, and Github integration. Every project in Android Studio has
one or more modalities with source code and resource files. These modalities include Android
app modules, Library modules, and Google App Engine modules.
11 | P a g e
Step 2 - Setup Android Studio
Overview
Android Studio is the official IDE for android application development.It works based
on IntelliJ IDEA, You can download the latest version of android studio from Android Studio
2.2 Download, If you are new to installing Android Studio on windows,you will find a file,
which is named as android-studio-bundle-143.3101438-windows.exe.So just download and run
on windows machine according to android studio wizard guideline.
If you are installing Android Studio on Mac or Linux, You can download the latest version
from Android Studio Mac Download,or Android Studio Linux Download, check the
instructions provided along with the downloaded file for Mac OS and Linux. This tutorial will
consider that you are going to setup your environment on Windows machine having Windows
8.1 operating system.
Installation
So let's launch Android Studio.exe,Make sure before launch Android Studio, Our Machine
should required installed Java JDK. To install Java JDK,take a references of Android
environment setup
Once you launched Android Studio, its time to mention JDK7 path or later version in android
studio installer.
12 | P a g e
Below the image initiating JDK to android SDK
Need to check the components, which are required to create applications, below the image has
selected Android Studio, Android SDK, Android Virtual Machine and performance(Intel
chip).
13 | P a g e
Need to specify the location of local machine path for Android studio and Android SDK, below
the image has taken default location of windows 8.1 x64 bit architecture.
Need to specify the ram space for Android emulator by default it would take 512MB of local
machine RAM.
14 | P a g e
At final stage, it would extract SDK packages into our local machine, it would take a while time
to finish the task and would take 2626MB of Hard disk space.
After done all above steps perfectly, you must get finish button and it gonna be open android
studio project with Welcome to android studio message as shown below
15 | P a g e
You can start your application development by calling start a new android studio project. in a
new installation frame should ask Application name, package information and location of the
project.
After entered application name, it going to be called select the form factors your application
runs on, here need to specify Minimum SDK, in our tutorial, I have declared as API23: Android
6.0(Mashmallow)
16 | P a g e
The next level of installation should contain selecting the activity to mobile, it specifies the
default layout for Applications
At the final stage it going to be open development tool to write the application code.
17 | P a g e
Step 3 - Create Android Virtual Device
To test your Android applications, you will need a virtual Android device. So before we start
writing our code, let us create an Android virtual device. Launch Android AVD Manager
Clicking AVD_Manager icon as shown below
After Click on a virtual device icon, it going to be shown by default virtual devices which are
present on your SDK, or else need to create a virtual device by clicking Create new Virtual
device button
18 | P a g e
If your AVD is created successfully it means your environment is ready for Android application
development. If you like, you can close this window using top-right cross button. Better you re-
start your machine and once you are done with this last step, you are ready to proceed for your
first Android example but before that we will see few more important concepts related to
Android Application Development.
To show hello word, we need to call text view with layout ( about text view and layout, you
must take references at Relative Layout and Text View ).
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
19 | P a g e
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".MainActivity">
<TextView android:text="@string/hello_world"
android:layout_width="550dp"
android:layout_height="wrap_content" />
</RelativeLayout>
Need to run the program by clicking Run>Run App or else need to call shift+f10key. Finally,
result should be placed at Virtual devices as shown below
Result:____________________________________________________
______________________________________________________
Conclusion:
20 | P a g e
Questionnaire
1) What is android?
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
5) What is AIDL?
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
21 | P a g e
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
7) What is Orientation?
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
22 | P a g e
Experiment No. 2
Theory:
The basic building block for user interface is a View object which is created from the View
class and occupies a rectangular area on the screen and is responsible for drawing and event
handling. View is the base class for widgets, which are used to create interactive UI components
like buttons, text fields, etc.
The ViewGroup is a subclass of View and provides invisible container that hold other Views or
other ViewGroups and define their layout properties.
At third level we have different layouts which are subclasses of ViewGroup class and a typical
layout defines the visual structure for an Android user interface and can be created either at run
time using View/ViewGroupobjects or you can declare your layout using simple XML
file main_layout.xml which is located in the res/layout folder of your project.
1 Linear Layout
LinearLayout is a view group that aligns all children in a single direction, vertically
or horizontally.
2 Relative Layout
3 Table Layout
23 | P a g e
4 Absolute Layout
5 Frame Layout
The FrameLayout is a placeholder on screen that you can use to display a single view.
6 List View
7 Grid View
Buttons
Depending on whether you want a button with text, an icon, or both, you can create the button in
your layout in three ways:
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/button_text"
... />
With an icon, using the ImageButton class:
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/button_icon"
... />
With text and an icon, using the Button class with the android:drawableLeft attribute:
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/button_text"
24 | P a g e
android:drawableLeft="@drawable/button_icon"
... />
To create a font family, perform the following steps in the Android Studio:
1.Right-click the font folder and go to New > Font resource file. The New Resource File window
appears.
2.Enter the file name, and then click OK. The new font resource XML opens in the editor.
3.Enclose each font file, style, and weight attribute in the <font> element. The following XML
illustrates adding font-related attributes in the font resource XML:
Android UI Controls
There are number of UI controls provided by Android that allow you to build the graphical user
interface for your app.
1 TextView
25 | P a g e
2 EditText
3 AutoCompleteTextView
4 Button
5 ImageButton
6 CheckBox
An on/off switch that can be toggled by the user. You should use check box
when presenting users with a group of selectable options that are not mutually
exclusive.
7 ToggleButton
8 RadioButton
9 RadioGroup
10 ProgressBar
The ProgressBar view provides visual feedback about some ongoing tasks, such
as when you are performing a task in the background.
26 | P a g e
11 Spinner
A drop-down list that allows users to select one value from a set.
12 TimePicker
The TimePicker view enables users to select a time of the day, in either 24-hour
mode or AM/PM mode.
13 DatePicker
Result:____________________________________________________
______________________________________________________
Conclusion:
27 | P a g e
Questionnaire
1) What is view?
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
2) What is ViewGroup?
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
28 | P a g e
7) List all Android UI Controls.
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
29 | P a g e
Experiment No. 3
Theory: As with all applications, we should always start with building the interface. For the
calculator app, we require the following elements.
1.TextView
2.Buttons
That’s it. We use the textView to show users the numbers they have written and also to display
the result of the calculations we are going to do.
Each of the numbers will have a different button, from 0-9 and we will have four additional
buttons for addition, subtraction, multiplication and division. Other than this, we require a button
to calculate the operation, a button for decimals, and a button to clear the display.
Requirements
1. EditText: To display numbers and the result.
2. Button: Numbers 0-9
3. Button: Operational buttons (+, -, *, /, =)
4. Button: Decimal button
5. Button: Clear display button.
Here’s a screenshot of what the code at the bottom would look like, if you were to paste it in
your activity_main.xml file.
Step 2: Fetching values from the elements into the working of our app
Inside the onCreate function, we will fetch all values and assign it to our objects. We do this by
the following code
btn_0 = (Button) findViewById(R.id.btn_0);
Here, we are fetching the value of ‘btn_0’, which is the ID of our button zero, and storing it in
the object ‘btn_0’ that we created earlier. Though, they are named the same, Android Studio has
the ability to identify the correct one. But if it gets confusing for you, feel free to give either one
of them any other names.
30 | P a g e
Step 3: Changing the EditText value by pressing the buttons.
Here’s the code
btn_1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ed1.setText(ed1.getText()+"1");
}
});
This is what happens when you push one. The editText, first already fetches the value that it is
already displaying, null in this case, and then adds 1 to it. If we don’t fetch the existing value
then it will become impossible to enter multiple digit numbers.
Result:____________________________________________________
______________________________________________________
Conclusion:
32 | P a g e
Questionnaire
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
5) Write code for Changing the EditText value by pressing the buttons.
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
33 | P a g e
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
34 | P a g e
Experiment No. 4
Theory:
A mobile node is an Internet-connected device whose location and point of attachment to the
Internet may frequently be changed. This kind of node is often a cellular
telephone or handheld or laptop computer, although a mobile node can also be a router. Special
support is required to maintain Internet connections for a mobile node as it moves from one
network or subnet to another, because traditional Internet routing assumes a device will always
have the same IP address. Therefore, using standard routing procedures, a mobile user would
have to change the device's IP address each time they connected through another network or
subnet.
Since mobility and ease of connection are crucial considerations for mobile device users,
organizations that want to promote mobile communications are putting a great deal of effort into
making mobile connection and uncomplicated for the user. The Internet Engineering Task Force
(IETF) Mobile IP working group has developed several standards or proposed standards to
address these needs, including Mobile IP and later enhancements, Mobile IP version 6 (MIPv6)
and Hierarchical Mobile IP version 6 (HMIPv6).
Mobile IP Overview
35 | P a g e
Because the mobility functions of Mobile IP are performed at the network layer rather than the
physical layer, the mobile device can span different types of wireless and wireline networks
while maintaining connections and ongoing applications. Remote login, remote printing, and file
transfers are some examples of applications where it is undesirable to interrupt communications
while an individual roams across network boundaries. Also, certain network services, such as
software licenses and access privileges, are based on IP addresses. Changing these IP addresses
could compromise the network services.
The Mobile Node is a device such as a cell phone, personal digital assistant, or laptop whose
software enables network roaming capabilities.
The Home Agent is a router on the home network serving as the anchor point for communication
with the Mobile Node; it tunnels packets from a device on the Internet, called a Correspondent
Node, to the roaming Mobile Node. (A tunnel is established between the Home Agent and a
reachable point for the Mobile Node in the foreign network.)
The Foreign Agent is a router that may function as the point of attachment for the Mobile Node
when it roams to a foreign network, delivering packets from the Home Agent to the Mobile
Node.
The care-of address is the termination point of the tunnel toward the Mobile Node when it is on a
foreign network. The Home Agent maintains an association between the home IP address of the
36 | P a g e
Mobile Node and its care-of address, which is the current location of the Mobile Node on the
foreign or visited network
This section explains how Mobile IP works. The Mobile IP process has three main phases, which
are discussed in the following sections.
• Agent Discovery
A Mobile Node discovers its Foreign and Home Agents during agent discovery.
• Registration
The Mobile Node registers its current location with the Foreign Agent and Home Agent during
registration.
• Tunneling
A reciprocal tunnel is set up by the Home Agent to the care-of address (current location of the
Mobile Node on the foreign network) to route packets to the Mobile Node as it roams.
Agent Discovery
During the agent discovery phase, the Home Agent and Foreign Agent advertise their services on
the network by using the ICMP Router Discovery Protocol (IRDP). The Mobile Node listens to
these advertisements to determine if it is connected to its home network or foreign network.
The IRDP advertisements carry Mobile IP extensions that specify whether an agent is a Home
Agent, Foreign Agent, or both; its care-of address; the types of services it will provide such as
reverse tunneling and generic routing encapsulation (GRE); and the allowed registration lifetime
or roaming period for visiting Mobile Nodes. Rather than waiting for agent advertisements, a
Mobile Node can send out an agent solicitation. This solicitation forces any agents on the link to
immediately send an agent advertisement.
If a Mobile Node determines that it is connected to a foreign network, it acquires a care-of
address. Two types of care-of addresses exist:
• Care-of address acquired from a Foreign Agent
• Colocated care-of address
A Foreign Agent care-of address is an IP address of a Foreign Agent that has an interface on the
foreign network being visited by a Mobile Node. A Mobile Node that acquires this type of care-
of address can share the address with other Mobile Nodes. A colocated care-of address is an IP
address temporarily assigned to the interface of the Mobile Node itself. A colocated care-of
address represents the current position of the Mobile Node on the foreign network and can be
used by only one Mobile Node at a time.
When the Mobile Node hears a Foreign Agent advertisement and detects that it has moved
outside of its home network, it begins registration.
37 | P a g e
Registration
The Mobile Node is configured with the IP address and mobility security association (which
includes the shared key) of its Home Agent. In addition, the Mobile Node is configured with
either its home IP address, or another user identifier, such as a Network Access Identifier.
The Mobile Node uses this information along with the information that it learns from the Foreign
Agent advertisements to form a Mobile IP registration request. It adds the registration request to
its pending list and sends the registration request to its Home Agent either through the Foreign
Agent or directly if it is using a colocated care-of address and is not required to register through
the Foreign Agent. If the registration request is sent through the Foreign Agent, the Foreign
Agent checks the validity of the registration request, which includes checking that the requested
lifetime does not exceed its limitations, the requested tunnel encapsulation is available, and that
reverse tunnel is supported. If the registration request is valid, the Foreign Agent adds the
visiting Mobile Node to its pending list before relaying the request to the Home Agent. If the
registration request is not valid, the Foreign Agent sends a registration reply with appropriate
error code to the Mobile Node.
The Home Agent checks the validity of the registration request, which includes authentication of
the Mobile Node. If the registration request is valid, the Home Agent creates a mobility binding
(an association of the Mobile Node with its care-of address), a tunnel to the care-of address, and
a routing entry for forwarding packets to the home address through the tunnel.
The Home Agent then sends a registration reply to the Mobile Node through the Foreign Agent
(if the registration request was received via the Foreign Agent) or directly to the Mobile Node. If
the registration request is not valid, the Home Agent rejects the request by sending a registration
reply with an appropriate error code.
The Foreign Agent checks the validity of the registration reply, including ensuring that an
associated registration request exists in its pending list. If the registration reply is valid, the
Foreign Agent adds the Mobile Node to its visitor list, establishes a tunnel to the Home Agent,
and creates a routing entry for forwarding packets to the home address. It then relays the
registration reply to the Mobile Node.
Finally, the Mobile Node checks the validity of the registration reply, which includes ensuring an
associated request is in its pending list as well as proper authentication of the Home Agent. If the
registration reply is not valid, the Mobile Node discards the reply. If a valid registration reply
specifies that the registration is accepted, the Mobile Node is confirmed that the mobility agents
are aware of its roaming. In the colocated care-of address case, it adds a tunnel to the Home
Agent. Subsequently, it sends all packets to the Foreign Agent.
The Mobile Node reregisters before its registration lifetime expires. The Home Agent and
Foreign Agent update their mobility binding and visitor entry, respectively, during reregistration.
In the case where the registration is denied, the Mobile Node makes the necessary adjustments
38 | P a g e
and attempts to register again. For example, if the registration is denied because of time
mismatch and the Home Agent sends back its time stamp for synchronization, the Mobile Node
adjusts the time stamp in future registration requests.
Thus, a successful Mobile IP registration sets up the routing mechanism for transporting packets
to and from the Mobile Node as it roams.
Tunneling
The Mobile Node sends packets using its home IP address, effectively maintaining the
appearance that it is always on its home network. Even while the Mobile Node is roaming on
foreign networks, its movements are transparent to correspondent nodes.
Data packets addressed to the Mobile Node are routed to its home network, where the Home
Agent now intercepts and tunnels them to the care-of address toward the Mobile Node.
Tunneling has two primary functions: encapsulation of the data packet to reach the tunnel
endpoint, and decapsulation when the packet is delivered at that endpoint. The default tunnel
mode is IP Encapsulation within IP Encapsulation. Optionally, GRE and minimal encapsulation
within IP may be used.
Typically, the Mobile Node sends packets to the Foreign Agent, which routes them to their final
destination, the Correspondent Node, as shown in Figure 2.
However, this data path is topologically incorrect because it does not reflect the true IP network
source for the data—rather, it reflects the home network of the Mobile Node. Because the
packets show the home network as their source inside a foreign network, an access control list on
routers in the network called ingress filtering drops the packets instead of forwarding them. A
feature called reverse tunneling solves this problem by having the Foreign Agent tunnel packets
back to the Home Agent when it receives them from the Mobile Node. See Figure 3.
39 | P a g e
Figure 3 Reverse Tunnel
Tunnel MTU discovery is a mechanism for a tunnel encapsulator such as the Home Agent to
participate in path MTU discovery to avoid any packet fragmentation in the routing path between
a Correspondent Node and Mobile Node. For packets destined to the Mobile Node, the Home
Agent maintains the MTU of the tunnel to the care-of address and informs the Correspondent
Node of the reduced packet size. This improves routing efficiency by avoiding fragmentation and
reassembly at the tunnel endpoints to ensure that packets reach the Mobile Node.
Security
Mobile IP uses a strong authentication scheme for security purposes. All registration messages
between a Mobile Node and Home Agent are required to contain the Mobile-Home
Authentication Extension (MHAE).
The integrity of the registration messages is protected by a preshared 128-bit key between a
Mobile Node and Home Agent. The keyed message digest algorithm 5 (MD5) in "prefix+suffix"
mode is used to compute the authenticator value in the appended MHAE, which is mandatory.
Mobile IP also supports the hash-based message authentication code (HMAC-MD5). The
receiver compares the authenticator value it computes over the message with the value in the
extension to verify the authenticity.
Optionally, the Mobile-Foreign Authentication Extension and Foreign-Home Authentication
Extension are appended to protect message exchanges between a Mobile Node and Foreign
Agent and between a Foreign Agent and Home Agent, respectively.
Replay protection uses the identification field in the registration messages as a timestamp and
sequence number. The Home Agent returns its time stamp to synchronize the Mobile Node for
registration.
Cisco IOS software allows the mobility keys to be stored on an authentication, authorization, and
accounting (AAA) server that can be accessed using TACACS+ or RADIUS protocols. Mobile
40 | P a g e
IP in Cisco IOS software also contains registration filters, enabling companies to restrict who is
allowed to register.
Network mobility is enabled by Mobile IP, which provides a scalable, transparent, and secure
solution. It is scalable because only the participating components need to be Mobile IP aware—
the Mobile Node and the endpoints of the tunnel. No other routers in the network or any hosts
with which the Mobile Node is communicating need to be changed or even aware of the
movement of the Mobile Node. It is transparent to any applications while providing mobility.
Also, the network layer provides link-layer independence, interlink layer roaming, and link-layer
transparency. Finally, it is secure because the set up of packet redirection is authenticated.
Result:____________________________________________________
______________________________________________________
Conclusion:
41 | P a g e
Questionnaire
42 | P a g e
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
8) Why network mobility scalable?
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
43 | P a g e
Experiment No.5
Theory:
SQLite is a opensource SQL database that stores data to a text file on a device. Android comes
in with built in SQLite database implementation.
SQLite supports all the relational database features. In order to access this database, you don't
need to establish any kind of connections for it like JDBC,ODBC e.t.c
Database - Package
The main package is android.database.sqlite that contains the classes to manage your own
databases
Database - Creation
In order to create a database you just need to call this method openOrCreateDatabase with your
database name and mode as a parameter. It returns an instance of SQLite database which you
have to receive in your own object.Its syntax is given below
Apart from this , there are other functions available in the database package , that does this job.
They are listed below
44 | P a g e
It not only opens but create the database if it not exists. This method is equivalent
to openDatabase method.
Database - Insertion
we can create table or insert data into table using execSQL method defined in SQLiteDatabase
class. Its syntax is given below
This will insert some values into our table in our database. Another method that also does the
same job but take some additional parameter is given below
Database - Fetching
We can retrieve anything from database using an object of the Cursor class. We will call a
method of this class called rawQuery and it will return a resultset with the cursor pointing to the
table. We can move the cursor forward and retrieve the data.
1 getColumnCount()
This method return the total number of columns of the table.
45 | P a g e
2 getColumnIndex(String columnName)
This method returns the index number of a column by specifying the name of the
column
3 getColumnName(int columnIndex)
This method returns the name of the column by specifying the index of the
column
4 getColumnNames()
This method returns the array of all the column names of the table.
5 getCount()
This method returns the total number of rows in the cursor
6 getPosition()
This method returns the current position of the cursor in the table
7 isClosed()
This method returns true if the cursor is closed and return false otherwise
Example
Here is an example demonstrating the use of SQLite Database. It creates a basic contacts
applications that allows insertion, deletion and modification of contacts.
To experiment with this example, you need to run this on an actual device on which camera is
supported.
Steps Description
1 You will use Android studio to create an Android application under a package
com.example.sairamkrishna.myapplication.
2 Modify src/MainActivity.java file to get references of all the XML components and
populate the contacts on listView.
4 Create a new Activity as DisplayContact.java that will display the contact on the
screen
46 | P a g e
5 Modify the res/layout/activity_main to add respective XML components
10 Run the application and choose a running android device and install the application
on it and verify the results.
Result:____________________________________________________
______________________________________________________
Conclusion:
47 | P a g e
Questionnaire
48 | P a g e
Experiment No. 6
Features of NS2
1. It is a discrete event simulator for networking research.
2. It provides substantial support to simulate bunch of protocols like TCP, FTP, UDP, https and
DSR.
3. It simulates wired and wireless network.
4. It is primarily Unix based.
5. Uses TCL as its scripting language.
6. Otcl: Object oriented support
7. Tclcl: C++ and otcl linkage
8. Discrete event scheduler
NS2 builds and runs under windows using Cygwin. Cygwin provides Linux like environment
under windows.
System Requirements: A computer with C++ compiler. Building full NS2 package requires large
memory space approximately 250MB
2. Run the downloaded setup.exe and you will see screen shown below click next.
49 | P a g e
6. Next screen will ask for your Internet connection type keep it as "Direct connection" and click
next and in next screen choose one site to download the packages and click next.
7. In next screen Cygwin will allow to select the packages you want to install
50 | P a g e
8. Uncheck the option "Hide obsolete packages" then click on "view" button till the word
"category" changes to "Full"
1. gcc
2. gcc-g++
3. gnuplot
4. make
5. patch
6. perl
7. tar
8. X-startup-scripts
9. xorg-x11-base
10. xorg-x11-bin
11. xorg-x11-devel
12. xorg-x11-bin-dlls
51 | P a g e
13. xorg-x11-bin-lndir
14. xorg-x11-etc
15. xorg-x11-fenc
16. xorg-x11-fnts
17. xorg-x11-libs-data
18. xorg-x11-xwin
19. libxt-devel
20. libXmu-devel
To select a package search the package name and click on word "skip" this will change it to
version number of the package. Do this for all above packages and click next to start download
and installation
52 | P a g e
2. Decompress the file use winrar. Copy the decompressed folder the Cygwin installation
directory under the subdirectory home. It will be C:\cygwin\home\system_name : where
system_name is name of your system in above Cygwin installation this path will be
C:\Cygwin\home\sys27
3. Run Cygwin from desktop and change the directory to folder you copied just now in step 2
command to change directory:cd /home/sys27/ns-allinone-2.28
This will began the installation process if any Cygwin package is missing it will be reported to
you if so the run Cygwin setu.exe and install the missing package and start again from step 2.
Installation is a long process and take quite some time once it is finished you will get a screen as
shown below:
export TCL_LIBRARY=$NS_HOME/tcl8.4.5/library
53 | P a g e
export
PATH=$NS_HOME/nam-
1.11:$NS_HOME/tcl8.4.5/unix:$NS_HOME/tk8.4.5/unix:$NS_HOME/bin:$PATH
export
LD_LIBRARY_PATH=$NS_HOME/tcl8.4.5/unix:$NS_HOME/tk8.4.5/unix:$NS_HOME/otcl-
1.9:$NS_HOME/lib:$LD_LIBRARY_PATH
export TCL_LIBRARY=$NS_HOME/tcl8.4.5/library
7. To check if NS2 is installed correctly you can run one sample example given in ns-tutorials
folder
ns example2.tcl
54 | P a g e
55 | P a g e
NOTE: If you missed any package while installing Cygwin first time you can install it by running
the setup.exe again and selecting the package in step 8.
10. Cygwin installation is complete now you can run Cygwin from desktop and see its interface.
3. Select option "Install From Internet". If you have already downloaded the package select
"Install from local directory" and click next
56 | P a g e
4. Keep the default installation directory as "C:\cygwin" and click next
5. Keep default local package directory as your download folder and click next.
57 | P a g e
Result:____________________________________________________
______________________________________________________
Conclusion:
58 | P a g e
Questionnaire
1) What is NS2?
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
2) What is simulator?
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
59 | P a g e
6) Enlist atleast four network softwares that can be used to develop and simulate network
applications?
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
60 | P a g e
Experiment No.7
Theory:
This Android tutorial will walk you through to create an alarm clock Android application. This
alarm app is planned to be minimalistic and usable. It can set alarm for one occurrence for the
coming day. You will get alarm ring sound, a notification message and a message in the app UI.
This application and device can be idle or sleeping when the alarm triggers.
We will be using the AlarmManager API to set and ring the alarm notification. We will have a
TimePicker component and a toggle switch in the UI to set the alarm time.
1. Android Manifest
AndroidManifest.xml
We need to give uses-permission for WAKE_LOCK, other than that the
AndroidManifest.xml is pretty standard one. Just need to include the service and receiver.
AlarmActivity.java
AlarmActivity uses the AlarmManager to set the alarm and send notification on alarm
trigger.
3. Alarm Receiver
AlarmReceiver.java
AlarmReceiver is a WakefulBroadcasReceiver, this is the one that receives the alarm
trigger on set time. From here we initiate different actions to notify the user as per our
choice. I have given three type of notifications, first show a message to user in the
activity UI, second play the alarm ringtone and third send an Android notification
message. So this is the place to add enhancement for different types of user notifications.
61 | P a g e
4. Alarm Notification Message
AlarmService.java
The receiver will start the following IntentService to send a standard notification to the
user.
Result:____________________________________________________
______________________________________________________
Conclusion:
62 | P a g e
Questionnaire
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
63 | P a g e
6) What is Alarm Activity?
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
64 | P a g e
Experiment No.8
Theory:
Android external storage can be used to write and save data, read configuration files etc. This
article is continuation of the Android Internal Storage tutorial in the series of tutorials on
structured data storage in android.
External storage such as SD card can also store application data, there’s no security enforced
upon files you save to the external storage.
In general there are two types of External Storage:
Primary External Storage: In built shared storage which is “accessible by the user by
plugging in a USB cable and mounting it as a drive on a host computer”. Example: When
we say Nexus 5 32 GB.
Secondary External Storage: Removable storage. Example: SD Card
All applications can read and write files placed on the external storage and the user can remove
them. We need to check if the SD card is available and if we can write to it. Once we’ve checked
that the external storage is available only then we can write to it else the save button would be
disabled.
65 | P a g e
Steps to Create application:
Go to res folder and select layout Double click the main xml file
Type the code for main.xml or drag and drop various components used in our program
Drag and drop image view and change its properties according to our programs
Create Image view and initialize its using id of some components used in the xml program
Result:____________________________________________________
__________________________________________________________
Conclusion:
66 | P a g e
Questionnaire
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
3) What is?
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
4) What is the?
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
5) What is the?
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
67 | P a g e
6) What is?
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
7) Define.
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
8) Define
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
10) Explain
---------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------
---------------------------
68 | P a g e
Experiment No.9
Aim: To develop a Android Application that creates an alert upon receiving a message.
Theory
Procedure:
Creating a New project:
Open Android Studio and then click on File -> New -> New project.
69 | P a g e
Then select the Minimum SDK as shown below and click Next.
70 | P a g e
Finally click Finish.
71 | P a g e
Steps for Creating Second Activity for the Android Application:
Result:____________________________________________________
__________________________________________________________
Conclusion:
72 | P a g e
Questionnaire
1)What is a notification ?
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
----------------------------------------- ---------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
-
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
73 | P a g e
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------
---------------------------
74 | P a g e
Experiment No.10
Aim: Write an application that draws basic graphical primitives on the screen.
Theory
Procedure:
Open Android Studio and then click on File -> New -> New project.
75 | P a g e
Then select the Minimum SDK as shown below and click Next.
76 | P a g e
Then select the Empty Activity and click Next.
77 | P a g e
It will take some time to build and load the project.
After completion it will look as given below.
Now click on Text and then delete the code which is there and type the your code.
Now click on Design and your application will look as given below.
78 | P a g e
So now the designing part is completed.
Java Coding for the Android Application:
Result:____________________________________________________
______________________________________________________
Conclusion:
79 | P a g e
Questionnaire
1) What is a android.graphics.Paint?
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
80 | P a g e
6) What is Alarm Activity?
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------
---------------------------
81 | P a g e