Mad Lab Record
Mad Lab Record
LABORATORY RECORD
DEPARTMENT OF
INFORMATION TECHNOLOGY
1
DEPARTMENT OF INFORMATION TECHNOLOGY
2
INSTITUTION VISION
INSTITUTION MISSION
VISION
To empower technically proficient Information Technology professionals and socially responsible
individuals in an ever-evolving technological landscape .
MISSION
MO1: To import student success through best pedagogical practices and creative use of Information
Technology.
MO2: To create state-of-the-art facilities for elevating technology innovation through research, teaching
and learning.
MO3: To provide sustainable technologies through strategic partnership and community engagement.
MO4: To promote ethical conduct, unwavering integrity, and a strong sense of responsibility within the
realm of Information Technology
3
PROGRAMME EDUCATIONAL OBJECTIVES(PEOs)
1. To provide the students with a strong foundation in the required sciences in order to pursue
studies in Electronics and Communication Engineering.
2. To gain adequate knowledge to become good professional in electronic and communication
engineering associated industries, higher education and research.
3. To develop attitude in lifelong learning, applying and adapting new ideas and technologies as
their field evolves.
4. To prepare students to critically analyze existing literature in an area of specialization and
ethically develop innovative and research-oriented methodologies to solve the problems
identified.
5. To inculcate in the students a professional and ethical attitude and an ability to visualize the
engineering issues in a broader social context.
PSO1: Design, develop and analyze electronic systems through application of relevant electronics,
mathematics and engineering principles.
PSO2: Design, develop and analyze communication systems through application of fundamentals from
communication principles, signal processing, and RF System Design & Electromagnetics.
PSO3: Adapt to emerging electronics and communication technologies and develop innovative
solutions for existing and newer problems.
4
INDEX
Epx.No Date Experiment Name Page Marks Signature
.
No
1. Study and Installation of Flutter/Kotlin multi- 6
platform environment.
Total Marks :
Faculty Signature :
5
EX. NO. : 1
Study and Installation of Flutter/Kotlin multi-platform
DATE :
environment.
Aim:
To study and install the development environment required for Flutter and Kotlin
Multiplatform to enable cross-platform mobile and web application development using a
single codebase.
Procedure:
nginx
CopyEdi
t
flutter doctor
o This command checks your environment and displays the status of your setup.
4. Install Android Studio:
o Download from https://developer.android.com/studio.
o Install necessary plugins: Flutter and Dart.
o Configure an Android Virtual Device (AVD) for emulator testing.
5. Install Visual Studio Code (optional):
o Add Flutter and Dart plugins from the Extensions tab for lightweight development.
Result :
You will have a working development environment capable of building and running Flutter and
Kotlin Multiplatform applications, supporting cross-platform development for Android, iOS, and
more.
7
EX. NO. : 2
Develop an application that uses GUI components, Font and Colors
DATE :
AIM:
To develop an android application that uses GUI Components, Font and colors.
ALGORITHM:
8
PROGRAM CODE
MainActivity.java
package com.example.p1;
import android.graphics.Color;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
}
}
});
case 1:
t.setTextColor(Color.RED);
break;
9
case 2:
t.setTextColor(Color.GREEN);
break;
case 3:
t.setTextColor(Color.BLUE);
break;
case 4:
t.setTextColor(Color.CYAN);
break;
case 5:
t.setTextColor(Color.YELLOW);
break;
case 6:
t.setTextColor(Color.MAGENTA);
break;
}
ch++; // Increment color case
if (ch == 7) { // Reset color counter to 1 ch = 1;
}
}
});
}
Activity_main.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center"
android:padding="16dp">
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World"
android:textSize="30sp"
android:layout_marginBottom="20dp" />
10
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Increase Text Size"
android:layout_marginBottom="20dp" />
<Button
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Change Text Color" />
</LinearLayout>
Output :
RESULT:
Thus, the program for android application GUI Components, Font and colors was executed
successfully.
11
EX. NO. : 3
Develop a native calculator application.
DATE :
Aim:
Algorithm :
Program code :
12
}
};
switch (operator) {
case "+":
newResult += current;
break;
case "-":
newResult -= current;
break;
case "x":
newResult *= current;
break;
case "/":
newResult /= current;
break;
default:
return;
}
setInput(newResult.toString());
setResult(newResult);
setOperator(null);
setIsNewInput(true);
}
};
13
// Function to handle special buttons
const handleSpecialPress = (type) => {
switch (type) {
case "C":
setInput("0");
setResult(null);
setOperator(null);
setIsNewInput(true);
break;
case "+/-":
setInput((parseFloat(input) * -1).toString());
break;
case "%":
setInput((parseFloat(input) / 100).toString());
break;
default:
break;
}
};
return (
<View style={styles.container}>
<StatusBar />
<View style={styles.displayContainer}>
<Text style={styles.displayText}>{input}</Text>
</View>
<View style={styles.buttonContainer}>
{["C", "+/-", "%", "/"].map((op) => (
<Button key={op} label={op} onPress={() => handleSpecialPress(op)} />
))}
{["7", "8", "9", "x"].map((item) => (
<Button
key={item}
label={item}
onPress={() =>
item === "x" ? handleOperatorPress(item) : handleDigitPress(item)
}
/>
))}
{["4", "5", "6", "-"].map((item) => (
<Button
key={item}
label={item}
14
onPress={() =>
item === "-" ? handleOperatorPress(item) : handleDigitPress(item)
}
/>
))}
{["1", "2", "3", "+"].map((item) => (
<Button
key={item}
label={item}
onPress={() =>
item === "+" ? handleOperatorPress(item) : handleDigitPress(item)
}
/>
))}
{["0", ".", "="].map((item) => (
<Button
key={item}
label={item}
onPress={() =>
item === "=" ? calculate() : handleDigitPress(item)
}
/>
))}
</View>
</View>
);
};
});
15
Output :
RESULT:
Thus, the program for developing an application for native calculator was executed
successfully.
16
EX. NO. : 4
Develop a gaming application that uses 2-D animations and gestures
DATE :
AIM:
To develop an android application that draws basic graphical primitives on the screen.
ALGORITHM:
17
Program Code :
MainActivity.java:
package com.example.p3;
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;
// Create a Bitmap
Bitmap bg = Bitmap.createBitmap(720, 1280, Bitmap.Config.ARGB_8888);
// Create a Canvas using the Bitmap Canvas canvas = new Canvas(bg);
// Draw shapes
canvas.drawText("Rectangle", 420, 150, paint);
canvas.drawRect(400, 200, 650, 700, paint);
<ImageView android:id="@+id/imageView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:contentDescription="Canvas drawing area"
android:background="#FFFFFF" />
</FrameLayout>
19
Output:
RESULT:
Thus, the program for developing an application for native calculator was executed
successfully.
20
EX. NO: 5 Develop a movie rating application(similar to IMDB).
DATE :
Aim :
To develop a movie rating application that allows users to browse movies, view details, submit star
ratings and reviews, and view aggregated feedback, similar to IMDb.
Algorithm :
Program Code :
package com.hosseiniseyro.sample
import android.os.Bundle
import android.widget.Toast
import androidx.fragment.app.FragmentActivity
import com.hosseiniseyro.apprating.AppRatingDialog
import com.hosseiniseyro.apprating.listener.RatingDialogListener
import kotlinx.android.synthetic.main.activity_samples.*
showDialogButton_1.setOnClickListener { showRatingDialog_example1() }
showDialogButton_2.setOnClickListener { showRatingDialog_example2() }
showDialogButton_3.setOnClickListener { showRatingDialog_example3() }
21
showDialogButton_4.setOnClickListener { showRatingDialog_example4() }
buildRatingDialog().monitor()
buildRatingDialog().showRateDialogIfMeetsConditions()
}
Output :
RESULT:
Thus, the program for developing a movie rating application was executed successfully.
24
EX. NO. :6
Develop an application to connect to a web service and to retrieve
DATE : data with HTTP
AIM:
To develop an android application that implements multithreading.
ALGORITHM:
25
Program Code :
MainActivity.Java
package com.example.admin.multithreading;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
setContentView(R.layout.activity_main);
bt1 = (Button)findViewById(R.id.button);
bt2= (Button) findViewById(R.id.button2);
img= (ImageView)findViewById(R.id.imageView);
bt1.setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View v)
{
new Thread(new Runnable()
{
@Override public void run()
{
img.post(new Runnable()
{
{
img.post(new Runnable()
{
</LinearLayout>
27
Output :
RESULT:
Thus, the program for android application that makes use of multithreading was executed
successfully.
28
EX. NO. :7 Develop a simple shopping application.
DATE :
AIM:
To develop an android application that creates an alert upon receiving a message.
ALGORITHM:
1. Create a New Android
Project:
● Click New in the toolbar.
● In the window that appears, open the Android folder, select Android
Application Project, and click next.
● Provide the application name and the project name and then finally give
the desired package name.
● Choose a launcher icon for your application and then select Blank Activity and
then click Next
● Provide the desired Activity name for your project and then click Finish.
2. Create a New AVD (Android Virtual Device):
● click Android Virtual Device Manager from the toolbar.
● In the Android Virtual Device Manager panel, click New.
● Fill in the details for the AVD. Give it a name, a platform target, an SD card
size, and a skin (HVGA is default).
● Click Create AVD and Select the new AVD from the Android Virtual Device
Manager and click Start.
3. Design the layout by adding a text box and a command button.
4. Run the application.
5. If the entered E-mail doesn’t match the given E-mail id, then an alert will be
displayed.
6. If the entered E-mail id matches with the provided mail-id then login is successful.
Close the Android project
29
Program Code :
MainActivity.java
package com.pa.Alert;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
public class MainActivity extends Activity { private Button BTN;
private EditText email;
protected void onCreate(Bundle savedInstanceState)
{ super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
BTN = (Button) findViewById(R.id.btn);
email = (EditText) findViewById(R.id.emailInput);
BTN.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
String val = email.getText().toString();
if (val == null || val.length() <= 0) {
Toast.makeText(getApplicationContext(),
"Please Enter the email", Toast.LENGTH_LONG).show();
} else if (val.equals("enpboss@gmail.com")) {
Intent intent = new Intent(getApplicationContext(), SecondActivity.class); startActivity(intent);
Toast.makeText(getApplicationContext(),
"Login Success",
Toast.LENGTH_LONG).show();
} else
{
Toast.makeText(getApplicationContext(),
"Please Enter valid email",
Toast.LENGTH_LONG)
.show();
}
}
});
}
30
}
SecondActivity.java
package com.pa.Alert;
import android.app.Activity;
import android.os.Bundle;
public class SecondActivity extends Activity { @Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub super.onCreate(savedInstanceState);
setContentView(R.layout.second_activity);
}
}
AndroidMainfest.Xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.admin.myapplication">
<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">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="
android.intent.action.MAIN" />
<category android:name="
android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".SecondActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
31
Output :
RESULT:
Thus, the program for android application that creates an alert upon receiving a message
was executed successfully.
32
EX. NO. : 8
Design a web server supporting push notifications
DATE :
AIM:
To develop an android application that makes use of RSS (Rich Site Summary) Feed.
ALGORITHM:
33
Program Code :
MainActivity.java:
package com.example.p2;
import android.content.Intent;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
public class MainActivity extends AppCompatActivity {
private EditText eTo;
private EditText eSubject;
private EditText eMsg;
private Button btn;
@Override protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
eTo = (EditText)findViewById(R.id.txtTo);
eSubject = (EditText)findViewById(R.id.txtSub);
eMsg = (EditText)findViewById(R.id.txtMsg);
btn = (Button)findViewById(R.id.btnSend);
btn.setOnClickListener(new View.OnClickListener()
{
@Override public void onClick(View v)
{
Intent it = new Intent(Intent.ACTION_SEND);
it.putExtra(Intent.EXTRA_EMAIL,
new String[]{eTo.getText().toString()});
it.putExtra(Intent.EXTRA_SUBJECT,eSubject.getText().toString());
it.putExtra(Intent.EXTRA_TEXT,eMsg.getText()); it.setType("message/rfc822");
startActivity(Intent.createChooser(it,"Choose Mail
App" ));
}
}
);
}
Activity_main.xml:
34
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:orientation="vertical" >
<EditText android:id="@+id/txtTo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="To"/>
<EditText android:id="@+id/txtSub"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Subject"/>
<EditText android:id="@+id/txtMsg"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:gravity="top"
android:hint="Message"/>
<Button
android:layout_width="100dp"
android:layout_height="wrap_content
android:layout_gravity="right"
android:text=" Compose An Email"
android:id="@+id/btnSend"/>
</LinearLayout>
Andriodmanifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.example.p2">
<!-- Permissions -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />
35
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="28" />
</activity>
</application>
36
Output :
RESULT:
Thus, the program for android application that makes use of RSS Feed was executed
successfully.
37
EX. NO. : 9
Develop an application by integrating Google maps
DATE :
AIM:
To develop an android application that send an email.
ALGORITHM:
Program Code:
MainActivity.java:
package com.example.p2;
import android.Manifest; import android.content.Context;
import android.content.pm.PackageManager; import android.location.Location;
import android.location.LocationListener; import android.location.LocationManager; import
android.os.Build;
import android.os.Bundle;
import androidx.annotation.RequiresApi; import androidx.core.app.ActivityCompat;
import androidx.appcompat.app.AppCompatActivity;
import android.util.Log;
38
import android.widget.TextView;
public class MainActivity extends AppCompatActivity implements LocationListener {
protected LocationManager locationManager; protected LocationListener locationListener;
TextView txtLat;
@RequiresApi(api = Build.VERSION_CODES.M) @Override
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) !=
PackageManager.PERMISSION_GRANTED
&& ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) !=
PackageManager.PERMISSION_GRANTED) {
}
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, this);
}
@Override
public void onLocationChanged(Location location) {
// Display the location on the TextView
txtLat.setText("Latitude: " + location.getLatitude() + ", Longitude: " + location.getLongitude());
}
@Override
public void onStatusChanged(String provider, int status, Bundle extras) { Log.d("Latitude", "Status
changed: " + provider + ", Status: " + status);
}
// Callback when the provider is enabled @Override
public void onProviderEnabled(String provider) { Log.d("Latitude", provider + " enabled");
}
Output :
RESULT:
Thus, the program for android application to send an email was executed successfully.
40
EX. NO. :10 Mini Project
Mini Projects involving Flutter/Kotlin multi-platform
DATE :
AIM:
To develop a calculator android application.
ALGORITHM:
Program Code:
MainActivity.java
package com.example.calculator_two;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
41
import android.widget.EditText;
private Button nine, eig, sev, six, fiv, four, thr, two, one, zero, dot,
etContentView(R.layout.activity_main);
eq = (Button) findViewById(R.id.beq);
cl = (Button) findViewById(R.id.bcl);
et = (EditText) findViewById(R.id.tv);
zero.setOnClickListener(this);
nine.setOnClickListener(this);
eig.setOnClickListener(this);
sev.setOnClickListener(this);
six.setOnClickListener(this);
fiv.setOnClickListener(this);
four.setOnClickListener(this);
thr.setOnClickListener(this);
two.setOnClickListener(this);
one.setOnClickListener(this);
dot.setOnClickListener(this);
plus.setOnClickListener(this);
mins.setOnClickListener(this);
div.setOnClickListener(this);
mul.setOnClickListener(this);
eq.setOnClickListener(this);
43
cl.setOnClickListener(this);
et.setOnClickListener(this);
case R.id.b1:
case R.id.b2:
case R.id.b3:
case R.id.b4:
case R.id.b5:
case R.id.b6:
case R.id.b7:
case R.id.b8:
case R.id.b9:
if (s.equals("0")) { s = inDigit;
} else {
s += inDigit;
et.setText(s);
lO = ' ';
break
44
; case R.id.bpl:
compute();
lO = '+';
break;
case
R.id.bmin:
compute();
lO = '-';
break;
case
R.id.bdiv:
compute();
lO = '/';
break;
case
R.id.bmul:
compute();
lO = '*';
break;
case R.id.beq:
compute();
lO = '=';
45
break;
case
R.id.bcl:
result = 0;
s = "0";
lO = ' ';
et.setText("0");
break;
s = "0";
result = inNum;
et.setText(String.valueOf(result));
46
}
activity_main.xml
<LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android "
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<EditText android:id="@+id/tv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="30dp" />
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="100dp"
android:orientation="horizontal"
android:weightSum="4">
<Button android:id="@+id/b6"
android:layout_width="match_parent"
android:layout_height="wrap_content "
47
android:layout_weight="1"
android:text="6"
android:textColor="#ff0000" />
<Button android:id="@+id/b5"
android:layout_width="match_parent"
android:layout_height="wrap_content "
android:layout_weight="1"
android:text="5"
android:textColor="#ff0000" />
<Button android:id="@+id/b4"
android:layout_width="match_parent"
android:layout_height="wrap_content "
android:layout_weight="1"
android:text="4"
android:textColor="#ff0000" />
<Button
android:id="@+id/bmin"
android:layout_width="match_parent"
android:layout_height="wrap_content "
android:layout_weight="1"
android:text="-"
android:textColor="#ff0000" />
</LinearLayout>
48
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="4">
<Button android:id="@+id/b3"
android:layout_width="match_parent"
android:layout_height="wrap_content "
android:layout_weight="1"
android:text="3"
android:textColor="#ff0000" />
<Button
android:id="@+id/b2"
android:layout_width="match_parent"
android:layout_height="wrap_content "
android:layout_weight="1"
android:text="2"
android:textColor="#ff0000" />
<Button android:id="@+id/b1"
android:layout_width="match_parent"
android:layout_height="wrap_content " a
ndroid:layout_weight="1" android:text="1"
android:textColor="#ff0000" />
<Button
49
android:id="@+id/bmul"
android:layout_width="match_parent"
android:layout_height="wrap_content "
android:layout_weight="1"
android:text="*"
android:textColor="#ff0000" />
</LinearLayout>
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="5">
<Button
android:id="@+id/bd"
android:layout_width="match_parent"
android:layout_height="wrap_content "
android:layout_weight="1"
<Button
android:id="@+id/b0"
android:layout_width="match_parent"
android:layout_height="wrap_content "
android:layout_weight="1"
android:text="0"
50
android:textColor="#ff0000" />
<Button android:id="@+id/bcl"
android:layout_width="match_parent"
android:layout_height="wrap_content "
android:layout_weight="1"
android:text="Clr"
android:textColor="#ff0000" />
<Button android:id="@+id/beq"
android:layout_width="match_parent"
android:layout_height="wrap_content "
android:layout_weight="1"
android:text="="
android:textColor="#ff0000" />
<Button android:id="@+id/bdiv"
android:layout_width="match_parent"
android:layout_height="wrap_content "
android:layout_weight="1"
android:text="/"
android:textColor="#ff0000" />
</LinearLayout
51
Output :
RESULT:
Thus, the program for android based calculator application was executed successfully.
52
53