Mobile Computing LAB MANUAL - (2024-25) - 1
Mobile Computing LAB MANUAL - (2024-25) - 1
MOBILE COMPUTING(410245(C))
LABORATORY MANUAL
INSTITUTE To impart value added technological education through pursuit of academic excellence,
VISION research and entrepreneurial attitude.
M1: To achieve academic excellence through innovative teaching and learning process.
INSTITUTE M2: To imbibe the research culture for addressing industry and societal needs.
MISSION
M4: To produce competent and socially responsible professionals with core human values.
M4: To incorporate social and ethical awareness among the students to make them
conscientious professionals.
Department
Program Educational Objectives(PEOs)
PEO1: To Impart fundamentals in science, mathematics and engineering to cater the needs of society
and Industries.
PEO2: Encourage graduates to involve in research, higher studies, and/or to become entrepreneurs.
PEO3: To Work effectively as individuals and as team members in a multidisciplinary environment with
high ethical values for the benefit of society.
Course Objectives:
➢ To introduce the basic concepts and principles in mobile computing. This includes major techniques
involved, and networks & systems issues for the design and implementation of mobile computing
systems and applications.
➢ To demonstrate the protocols of mobile communication.
➢ To know GSM architecture and support services
➢ To Study on location, handoff management and wireless fundamentals.
➢ To summarize VLR and HLR identification algorithms
➢ To learn current technologies being used on field and design and development of various network
protocol using simulation tools.
Course Outcomes:
On completion of the course, student will be able to-
List of Assignments
Sr. TITLE
No. Group A
To implement a basic function of Code Division Multiple Access (CDMA) to test the orthogonally and
01 autocorrelation of a code to be used for CDMA operation. Write an application based on the above
concept.
Implementation of GSM security algorithms (A3/A5/A8)
02
Write an application that draws basic graphical primitives on the screen.
03
Group B
Mini-Projects/ Case Study (Any two)
Mini Project
01
02 Mini Project-
03 Mini Project-
04 Mini Project-
GROUP A: ASSIGNMENT NO 1
Problem Statement:
To implement a basic function of Code Division Multiple Access (CDMA) to test the orthogonally and autocorrelation of
a code to be used for CDMA operation. Write an application based on the above concept.
Aim:
To study the basic function of Code Division Multiple Access (CDMA).
Objective:
To develop a program for CDMA.
Theory:
CDMA is a channelization protocol for Multiple Access, where information can be sent simultaneously through several
transmitters over a single communication channel. It is achieved in below steps:
• A signal is generated which extends over a wide bandwidth.
• The code which performs this action is called spreading code.
• Later on, a specific signal can be selected with a given code even in the presence of many other signals.
It is mainly used in mobile networks like 2G and 3G.
Rule 2:
Procedure:
1. The station encodes its data bit as follows.
• +1 if bit = 1
• -1 if bit = 0
• no signal (interpreted as 0) if station is idle
2. Each station is assigned a unique orthogonal sequence (code) which is N bit long for N stations
3. Each station does a scalar multiplication of its encoded data bit and code sequence.
4. The resulting sequence is then placed on the channel.
5. Since the channel is common, amplitudes add up and hence resultant channel sequence is sum of sequences from all
channels.
6. If station 1 wants to listen to station 2, it multiplies (inner product) the channel sequence with code of station S2.
7. The inner product is then divided by N to get data bit transmitted from station 2.
Example: Assume 4 stations S1, S2, S3, S4. We’ll use 4×4 Walsh Table to assign codes to them.
C1 = [+1 +1 +1 +1]
C2 = [+1 -1 +1 -1]
C3 = [+1 +1 -1 -1]
C4 = [+1 -1 -1 +1]
Date:
Marks obtained:
Sign of course coordinator:
Name of course Coordinator:
GROUP A : ASSIGNMENT NO 2
Problem Statement: -
Implementation of GSM security algorithms (A3/A5/A8)
Aim: -
To learn about GSM security algorithms (A3/A5/A8)
Objective: -
To understand the basic concept of GSM security algorithms (A3/A5/A8).
Theory Concepts: -
Subscriber side: The security measures need to be more promising and precise on subscriber’s side. They should aim at
➢ Maintaining privacy and anonymity of user which means that identification and location of the subscriber should be
concealed
➢ Confidentiality of communication over air should be maintained by providing proper encryption methods
➢ There should be strong access control mechanisms for devices and SIM card
➢ Only authenticated users should be able to access the network
Access control
SIM Subscriber identity module stores confidential information which can be personal as well as network specific. It
stores the following information:
• International Mobile Subscriber Identity (IMSI) number: A globally unique identifier allocated to each GSM
subscriber. It is permanently stored both in the HLR of the user and in the SIM of the user terminal. Any GSM
subscriber can be uniquely identified by its IMSI number. This International Mobile Subscriber Identity (IMSI)
number is composed of the Mobile Country Code (MCC, three digits), the Mobile Network Code (MNC, two digits)
and the Mobile Subscriber Identification Number (MSIN, ten digits).
• Subscriber Authentication key (Ki): 128-bit shared key used for authentication of the subscriber by the network
• A3 and A8 Security algorithms: Algorithms used for authentication and generation of cipher key.
Therefore, it is necessary to protect the SIM card.
• PUK (Personal Unlocking Key): A PIN unblocking key should be entered which is provided by the user to unlock
the SIM which is locked after giving the wrong PIN. If the PUK entered incorrectly a number of times, (normally
10) the access to inform is refused permanently and SIM becomes useless.
To prevent eavesdropping, the identity of the user should be hidden. The identity of user is hidden by use of TSMI
(Temporary Mobile Subscriber Identity) in place of IMSI of the user. When a MS makes initial contact with the GSM
network, an un encrypted subscriber identifier (IMSI) has to be transmitted. The IMSI is sent only once, then a temporary
mobile subscriber identity (TMSI) is assigned (encrypted) and used in the entire range of the MSC. When the MS moves
into the range of another MSC a new TMSI is assigned. The IMSI is not sent over the radio interface so as to prevent the
user from being traced. A TMSI is used instead of IMSI. It is valid in the area of associated MSC i.e. will be valid only till
the user is in the area of MSC for communication. Outside location area, it is used along with LAI (Location Area
Identification). The TMSI identifies the user along with the location area. The TMSI is updated every time user moves to a
new geographical area. It can contain 4 * 8 bits (4 octets). But all 32 bits as one cannot be allocated. TMSI is stored in SIM
and all 1’s in SIM indicates no TMSI. The VLR must be capable of correlating an allocated TMSI with IMSI of MS to
which it is allocated. At the time of paging, to localize the mobile phone the TMSI is broadcasted.
Authentication and Encryption GSM ensures authentication of subscriber before it can use any services of the
network. At the same time privacy of user data and signal should also be maintained by proper encryption mechanisms.
Three security algorithms are documented in GSM specifications for this purpose. They are called A3, A5 and A8. A3 is
authentication algorithm, A8 is ciphering key generating algorithm and A5 is a stream cipher for encryption of user data
transmitted between mobile and base station. The GSM specifications for security were designed by GSM consortium in
secrecy. The consortium used “Security by obscurity” which says algorithm would be difficult to crack if they are not
publicly available.Therefore algorithms were made available only to hardware and software manufactures and GSM
network operators. A3 and A8 are stored on SIM card and at AUC. A5 is stored on device. A3 and A8 are not that strong
therefore the network providers can use their own algorithms or users can use their own algorithms but the encryption
algorithmA5 is implemented on device and should be identical for all providers. A3 and A8 are symmetric algorithms using
the same key embedded on SIM card.
Figure 2: A8 algorithm
Both are one way functions which means output can be found if inputs are known but it is impossible to find inputs if output
is known. A3 and A8 use COMP128 which is a keyed hash function. Both are one way functions which means output can
be found if inputs are known but it is impossible to find inputs if output is known. A3 and A8 use COMP128 which is a
keyed hash function. It takes 128 bit key and 128 bit RAND number as input and produces 128 bit output. The first 32 bits
of 128 bit form SRES i.e. Signed response and next 54 bits forms the cipher key which is used for authentication and
encryption.
Authentication is performed using following entities and a technique called “Challenge Response”
• A3 Algorithm for Authentication
• 128-bit key Kistored at SIM card and AUC
• RAND number auto generated by AUC known as Challenge
Therefore mechanisms for encryption need to be performed both at base station and mobile station. The algorithms A5
and A8 are used for encryption.Any encryption algorithm needs a cipher key. This cipher key is not statically
available. It is dynamically generated using A8 algorithm. It takes 128-bit key Ki and 128 bit RAND to generate 54 bit
cipher key. Then 10 zero bits are appended to the key to make it 64-bit. This is done to reduce the key space from 64
bits to 54 bits.
A5 algorithm
A5 is the encryption algorithm. It is a stream cipher. It works on bit-by-bit basis. A5 is stored on hardware as it has to
encrypt and decrypt data during transmission and reception of information, which must be fast enough. A5 takes 64-bit
cipher key and 22 bit function key as input and 114 bit plain text to generate 114-bit cipher text (Fig.7). The
encryption decryption processes are performed both at Base station and Mobile station.
A5 is not implemented as block cipher
The reason being that bit error rate on the wireless links is high. If there is an error of single bit in the cipher text it
affects an entire clear text frame. In contrast to it, by using a Stream cipher, a single bit error in the cipher text affects
only one single clear text bit. Therefore stream cipher is used for encryption in GSM. There are many
implementation of algorithm. Most common one being A5/0 A5/1 A5/2 A5/3 A5/1 is the strongest one. A5/0 is
literally no encryption.
Date:
Marks obtained:
Sign of course coordinator:
Name of course Coordinator :
GROUP A: ASSIGNMENT NO 3
Problem Statement: -
Write an application that draws basic graphical primitives on the screen.
Aim: -
To develop an application that draws basic graphical primitives on the screen.
Objective-:
To learn about basic graphical primitives on the screen.
Theory Concepts:
Procedure:
➢ Open eclipse or android studio and create new project
➢ Select our project in the project explorer
➢ 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 relative layout and change its properties
➢ Drag and drop image view and change its properties according to our programs
➢ Screen layout can be viewed by clicking graphics layout tab
➢ Include necessary files
➢ Override OnCreate() function
➢ Create Image view and initialize its using id of some components used in the xml program
➢ Save the program
➢ Run the program
➢ Output can be viewed in the android emulator
Activity_main.xml:
MainActivity.java:
package com.example.exno3;
import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.drawable.BitmapDrawable;
import android.os.Bundle;
import android.widget.ImageView;
public class MainActivity extends Activity
{
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//Creating a Bitmap
Bitmap bg = Bitmap.createBitmap(720, 1280, Bitmap.Config.ARGB_8888);
//Setting the Bitmap as background for the ImageView
ImageView i = (ImageView) findViewById(R.id.imageView);
i.setBackgroundDrawable(new BitmapDrawable(bg));
//Creating the Canvas Object
Canvas canvas = new Canvas(bg);
//Creating the Paint Object and set its color & TextSize
Paint paint = new Paint();
paint.setColor(Color.BLUE);
paint.setTextSize(50);
//To draw a Rectangle
canvas.drawText("Rectangle", 420, 150, paint);
canvas.drawRect(400, 200, 650, 700, paint);
//To draw a Circle
canvas.drawText("Circle", 120, 150, paint);
canvas.drawCircle(200, 350, 150, paint);
//To draw a Square
canvas.drawText("Square", 120, 800, paint);
canvas.drawRect(50, 850, 350, 1150, paint);
Conclusion-: Thus, a Simple Android Application that draws basic Graphical Primitives on the screen is developed
and executed successfully
Date:
Marks obtained:
Sign of course coordinator:
Name of course Coordinator :
GROUP A: ASSIGNMENT NO 4
Problem Statement: -
Develop a native application that uses GPS location information.
Objectives:
To develop a native application that uses GPS location information
Theory Concepts:
Procedure-
➢ Open eclipse or android studio and select new android project
➢ Choose the android version. Choose the lowest android version (Android 2.2) and select next
➢ Enter the package name. package name must be two word seprated by comma and click finish
➢ Go to res folder and select layout. Double click the main.xml file. Add the code below
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/relativeLayout1"
android:layout width="match_parent"
android:layout_height="match_parent" >
<Button
android:id="@+id/show_Location"
android:layout width="wrap_content"
android:layout height="wrap_content"
android:text="Show_Location"
android:layout_centerVertical="true"
android:layout centerHorizontal="true"/>
</RelativeLayout>
➢ Now select mainactivity.java file and type the following code.In my coding maniactivity name is
GPSlocationActivity.
➢ Go to src folder and Right Click on your package folder and choose new class and give the class nams as GPStrace
package gps.location;
import android.app.AlertDialog;
import android.app.Service;
import android.content.Intent;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.provider.Settings;
boolean isGPSEnabled=false;
boolean canGetLocation-false;
boolean isNetworkEnabled=false;
Location location:
double latitude:
double longtitude;
this.context=context; getLocation();
}else{
this.canGetLocation=true;
if(locationManager!=null){
if(location!=null)(
longtitude-location.getLongitude();
if(isGPSEnabled) (
if(location==null){
locationManager.requestLocationUpdates (LocationManager.G
if (locationManager!=null){
if (location!=null) {
latitude-location.getLatitude();
longtitude=location.getLongitude();
catch (Exception e)
e.printStackTrace();
return location;
if (locationManager!=null) {
locationManager.removeUpdates (GPStrace.this);
if (location!=null){
latitude=location.getLatitude();
return latitude;
if (location!=null) (
longtitude=location.getLatitude();
} return longtitude;
return this.canGetLocation:
alertDialog.setTitle("GPS is settings");
alertDialog.setPositiveButton("settings", new
DialogInterface.OnClickListener() {
@Override
which) (
Intent intent-new
});
@Override
which) {
alertDialog.show();
@Override
@Override
@Override
Bundle extras) f
@override
return null
}
}
➢ Now go to main.xml and right click select run as option and select run configuration
Conclusion: -
uccessfully developed a native application that uses GPS location information.
Date:
Marks obtained:
Sign of course coordinator:
Name of course Coordinator :
GROUP A: ASSIGNMENT NO 5
Problem Statement:
Design an android application for frame animation
Aim:
To understand the android application for frame animation.
Objective:
To design an android application for frame animation.
Theory Concepts:
In Android Frame Animation, you will be swapping frames repeatedly, so that it appears continuous to the human eye and
we feel that it is animated. Frame is referred to an image. So to implement frame by frame animation in android, one needs
to have set of images, which describes a motion.
[code lang="java"]
// Declaring an Image View and an Animation Drawable
ImageView view;
AnimationDrawable frameAnimation;
Conclusion: -
Successfully implemented an android application for frame animation
Date:
Marks obtained: