MAD Record
MAD Record
AIM:
To develop an android application that uses GUI Components, Font and colors.
ALGORITHM:
3. Design the graphical layout with a text view and two command buttons.
4. Run the application.
5. On pressing the change color button, color of the text gets changed.
6. On pressing the change font size button, the size of the font gets altered.
7. Close the Android project.
PROGRAM CODE
MainActivity.java
packagecom.example.gui;
importandroid.os.Bundle;
importandroid.app.Activity;
importandroid.graphics.Typeface;
importandroid.graphics.Color;
importandroid.view.View;
importandroid.widget.Button;
importandroid.widget.TextView;
publicclassMainActivityextends Activity {
float font = 24;
inti = 1;
protectedvoidonCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
finalTextView t1 = (TextView)findViewById(R.id.textView1);Button b1 =
(Button)findViewById(R.id.button1);
b1.setOnClickListener(newView.OnClickListener() {
publicvoidonClick(View view) {
t1.setTextSize(font);
font = font+4;
if(font==40)
font = 20;
}
});
Button b2 = (Button)findViewById(R.id.button2);
b2.setOnClickListener(newView.OnClickListener() {
i++;
if(i==5)
i=1;
}
}
}
t1.setTextCt1.se
activity_main.xml
<LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
>
<TextView android:id="@+id/textView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="WELCOME"
android:layout_margin="20sp"
android:gravity="center"
android:textSize="20sp"
android:textStyle="bold"
/>
<Button
android:id="@+id/button1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="20sp"
android:gravity="center"
android:text="Change Font Size" />
<Button
android:id="@+id/button2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_margin="20sp"
android:text="Change Color" />
</LinearLayout>
OUTPUT:
Class Performance
Record
Viva
Total
RESULT:
Thus, the program for android application GUI Components, Font and colors was executed
successfully.
EX. NO. :1(b)
Develop an application that uses Layout Managers and Event Listeners
DATE :
AIM:
To develop an android application that uses Layout Managers and event listeners.
ALGORITHM:
PROGRAM CODE:
MainActivity.java
packagecom.example.layout;
importandroid.os.Bundle;
importandroid.app.Activity;
importandroid.view.View;
importandroid.view.View.OnClickListener;
importandroid.widget.Button;
importandroid.widget.EditText;
importandroid.widget.Toast;
Toast.makeText(getBaseContext(),"ANSWER:"+result1,Toast.LENGTH_SHORT).show();
}
catch(Exception e)
{
Toast.makeText(getBaseContext(),e.getMessage(),Toast.LENGTH_SHORT).show();
}
}
});
Button sub = (Button)findViewById(R.id.button3);
sub.setOnClickListener(newOnClickListener(){
Toast.makeText(getBaseContext(),"ANSWER:"+result2,Toast.LENGTH_SHORT).show();
}
catch(Exception e)
{
Toast.makeText(getBaseContext(),e.getMessage(),Toast.LENGTH_SHORT).show();
}
}
});
Button clear = (Button)findViewById(R.id.button2);
clear.setOnClickListener(newOnClickListener() {
publicvoidonClick(View v)
{
try
{
txtData1.setText("");
txtData2.setText("");
}
catch(Exception e)
{
Toast.makeText(getBaseContext(),e.getMessage(),Toast.LENGTH_SHORT).show();
}
}
});
}
}
activity_main.xml
<RelativeLayoutxmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/relativeLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="ADDITION"
android:layout_gravity="center"
android:textSize="20dp">
</TextView>
</LinearLayout>
<LinearLayout
android:id="@+id/linearLayout2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_below="@+id/linearLayout1">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Enter No 1" />
<EditText android:id="@+id/editText1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.20"
android:inputType="number">
</EditText>
</LinearLayout>
<LinearLayout android:id="@+id/linearLayout3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_below="@+id/linearLayout2">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Enter No 2" />
<EditText android:id="@+id/editText2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.20"
android:inputType="number">
</EditText>
</LinearLayout>
<LinearLayout android:id="@+id/linearLayout4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_below="@+id/linearLayout3">
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.50"
android:text="Addition" />
<Button
android:id="@+id/button3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.50"
android:text="Subtraction" />
<Button
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.50"
android:text="Clear" />
</LinearLayout>
<View
android:id="@+id/linearLayout4"
android:layout_width="fill_parent"
android:layout_height="2px"
android:background="#DDFFDD" />
</RelativeLayout>
OUTPUT:
Class Performance
Record
Viva
Total
RESULT:
Thus, the program for android application that uses layout managers and event listeners was
executed successfully.
EX. NO:2
Develop an application that makes use of database
DATE :
AIM:
To develop an android application that makes use of database.
ALGORITHM:
PROGRAM CODE
MainActivity.java
package com.example.admin.myapplication;
import android.app.Activity;
import android.app.AlertDialog.Builder;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
public class MainActivityextends Activity implements OnClickListener
{
EditTextRollno,Name,Marks;
Button Insert,Delete,Update,View,ViewAll;
SQLiteDatabasedb;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Rollno=(EditText)findViewById(R.id.Rollno);
Name=(EditText)findViewById(R.id.Name);
Marks=(EditText)findViewById(R.id.Marks);
Insert=(Button)findViewById(R.id.Insert);
Delete=(Button)findViewById(R.id.Delete);
Update=(Button)findViewById(R.id.Update);
View=(Button)findViewById(R.id.View);
ViewAll=(Button)findViewById(R.id.ViewAll);
Insert.setOnClickListener(this);
Delete.setOnClickListener(this);
Update.setOnClickListener(this);
View.setOnClickListener(this);
ViewAll.setOnClickListener(this);
// Creating database and table
db=openOrCreateDatabase("StudentDB", Context.MODE_PRIVATE, null);
db.execSQL("CREATE TABLE IF NOT EXISTS
student(rollnoVARCHAR,nameVARCHAR,marks VARCHAR);");
}
public void onClick(View view)
{
// Inserting a record to the Student table
if(view==Insert)
{
// Checking for empty fields
if(Rollno.getText().toString().trim().length()==0||
Name.getText().toString().trim().length()==0||
Marks.getText().toString().trim().length()==0)
{
showMessage("Error", "Please enter all values");
return;
}
db.execSQL("INSERT INTO student VALUES('"+Rollno.getText()+"','"+Name.getText()+
"','"+Marks.getText()+"');");
showMessage("Success", "Record added");
clearText();
}
// Deleting a record from the Student table
if(view==Delete)
{
// Checking for empty roll number
if(Rollno.getText().toString().trim().length()==0)
{
showMessage("Error", "Please enter Rollno");
return;
}
Cursor c=db.rawQuery("SELECT * FROM student WHERE
rollno='"+Rollno.getText()+"'", null);
if(c.moveToFirst())
{
db.execSQL("DELETE FROM student WHERE rollno='"+Rollno.getText()+"'");
showMessage("Success", "Record Deleted");
}
else
{
showMessage("Error", "Invalid Rollno");
}
clearText();
}
// Updating a record in the Student table
if(view==Update)
{
// Checking for empty roll number
if(Rollno.getText().toString().trim().length()==0)
{
showMessage("Error", "Please enter Rollno");return;
}
Cursor c=db.rawQuery("SELECT * FROM student WHERE
rollno='"+Rollno.getText()+"'", null);
if(c.moveToFirst()) {
db.execSQL("UPDATE student SET name='" + Name.getText() + "',marks='" +
Marks.getText() +
"' WHERE rollno='"+Rollno.getText()+"'");
showMessage("Success", "Record Modified");
}
else {
showMessage("Error", "Invalid Rollno");
}
clearText();
}
// Display a record from the Student table
if(view==View)
{
// Checking for empty roll number
if(Rollno.getText().toString().trim().length()==0)
{
showMessage("Error", "Please enter Rollno");return;
}
Cursor c=db.rawQuery("SELECT * FROM student WHERE
rollno='"+Rollno.getText()+"'", null);
if(c.moveToFirst())
{
Name.setText(c.getString(1));
Marks.setText(c.getString(2));
}
else{
showMessage("Error", "Invalid Rollno");
clearText();
}
}
// Displaying all the records
if(view==ViewAll)
{
Cursor c=db.rawQuery("SELECT * FROM student", null);
if(c.getCount()==0)
{
showMessage("Error", "No records found");
return;
}
StringBuffer buffer=new StringBuffer();
while(c.moveToNext())
{
buffer.append("Rollno: "+c.getString(0)+"\n");
buffer.append("Name: "+c.getString(1)+"\n");
buffer.append("Marks: "+c.getString(2)+"\n\n");
}
showMessage("Student Details", buffer.toString());
}
}
public void showMessage(String title,String message)
{
Builder builder=new Builder(this);
builder.setCancelable(true);
builder.setTitle(title);
builder.setMessage(message);
builder.show();
}
public void clearText()
{
Rollno.setText("");
Name.setText("");
Marks.setText("");
Rollno.requestFocus();
}
}
activity_main.xml
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="20dp"
android:layout_y="110dp"
android:text="Enter Rollno:"
android:textSize="20sp" />
<EditText
android:id="@+id/Rollno"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_x="175dp"
android:layout_y="100dp"
android:inputType="number"
android:textSize="20sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="20dp"
android:layout_y="160dp"
android:text="Enter Name:"
android:textSize="20sp" />
<EditText android:id="@+id/Name"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_x="175dp"
android:layout_y="150dp"
android:inputType="text"
android:textSize="20sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="20dp"
android:layout_y="210dp"
android:text="Enter Marks:"
android:textSize="20sp" />
<EditText
android:id="@+id/Marks"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_x="175dp"
android:layout_y="200dp"
android:inputType="number"
android:textSize="20sp" />
<Button android:id="@+id/Insert"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_x="25dp"
android:layout_y="300dp"
android:text="Insert"
android:textSize="30dp" />
<Button android:id="@+id/Delete"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_x="200dp"
android:layout_y="300dp"
android:text="Delete"
android:textSize="30dp" />
<Button android:id="@+id/Update"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_x="25dp"
android:layout_y="400dp"
android:text="Update"
android:textSize="30dp" />
<Button android:id="@+id/View"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_x="200dp"
android:layout_y="400dp"
android:text="View"
android:textSize="30dp" />
<Button
android:id="@+id/ViewAll"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_x="100dp"
android:layout_y="500dp"
android:text="View All"
android:textSize="30dp" />
</AbsoluteLayout>
OUTPUT:
Class Performance
Record
Viva
Total
RESULT:
Thus, the program for android application that makes use of database was executed
successfully.
EX. NO:3
Develop a native application that uses GPS location information
DATE :
AIM:
To develop an android application that uses GPS location information.
ALGORITHM:
PROGRAM CODE
UseGps.java
<EditText android:id="@+id/editTextSMS"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="top" />
<EditText android:id="@+id/textlon"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="top" />
<Button android:id="@+id/buttonSend"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Send" />
</LinearLayout>
OUTPUT:
Class Performance
Record
Viva
Total
RESULT:
Thus, the program for android application that makes use of GPS information was executed
successfully.
EX. NO. :4
Implementation an application that creates an alert
DATE : upon receiving a message
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 clickNext
• 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, anda skin
(HVGA is default).
• Click Create AVD and Select the new AVD from the Android Virtual DeviceManager
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.
7. Close the Android project.
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;
SecondActivity.java
package com.pa.Alert;
import android.app.Activity;
import android.os.Bundle;
<EditText android:id="@+id/emailInput"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10" />
<Button
android:id="@+id/btn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="20sp"
android:gravity="center"
android:text="Login" />
</LinearLayout>
AndroidMainfest.Xml
<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" />
Class Performance
Record
Viva
Total
RESULT:
Thus, the program for android application that creates an alert upon receiving a message was
executed successfully.
EX. NO. : 5
Write a mobile application that creates alarm clock
DATE :
AIM:
To develop an android application that creates alarm clock.
ALGORITHM:
PROGRAM CODE:
MainActivity.java
package com.example.admin.myapplication;
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.Intent; import
android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TimePicker;
import android.widget.Toast;
import android.widget.ToggleButton;import java.util.Calendar
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
alarmTimePicker= (TimePicker) findViewById(R.id.timePicker);
alarmManager= (AlarmManager) getSystemService(ALARM_SERVICE);
}
public void OnToggleClicked(View view)
{
long time;
if (((ToggleButton) view).isChecked())
{
Toast.makeText(MainActivity.this, "ALARM ON", Toast.LENGTH_SHORT).show();
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.HOUR_OF_DAY, alarmTimePicker.getCurrentHour());
calendar.set(Calendar.MINUTE, alarmTimePicker.getCurrentMinute());
Intent intent = new Intent(this, AlarmReceiver.class);
pendingIntent= PendingIntent.getBroadcast(this, 0, intent, 0);
time=(calendar.getTimeInMillis()-(calendar.getTimeInMillis()%60000));
if(System.currentTimeMillis()>time)
{
if (calendar.AM_PM== 0)
time = time + (1000*60*60*12);
else
time = time + (1000*60*60*24);
}
alarmManager.setRepeating(AlarmManager.RTC_WAKEUP, time, 10000, pendingIntent);
}
else
{
alarmManager.cancel(pendingIntent);
Toast.makeText(MainActivity.this, "ALARM OFF", Toast.LENGTH_SHORT).show();
}
}
}
AlarmReceiverActivity.java
package com.example.admin.myapplication;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.media.Ringtone;
import android.media.RingtoneManager;
import android.net.Uri;
import android.widget.Toast;
<TimePicker android:id="@+id/timePicker"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center" />
<ToggleButton
android:id="@+id/toggleButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="20dp"
android:checked="false"
android:onClick="OnToggleClicked" />
</LinearLayout>
AndroidMainfest.Xml
<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" />
</manifest>
OUTPUT:
Class Performance
Record
Viva
Total
RESULT:
Thus, the program for android application for an alarm was executed successfully.
EX. NO. : 6
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;
import android.widget.EditText;
activity_main.xml
<EditText
android:id="@+id/tv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="enter no. here"
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/b9"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1" android:text="9"
android:textColor="#ff0000" />
<Button
android:id="@+id/b8"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1" android:text="8"
android:textColor="#ff0000" />
<Button
android:id="@+id/b7"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1" android:text="7"
android:textColor="#ff0000" />
<Button
android:id="@+id/bpl"
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="4">
<Button
android:id="@+id/b6"
android:layout_width="match_parent"
android:layout_height="wrap_content"
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>
<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"
android:layout_weight="1" android:text="1"
android:textColor="#ff0000" />
<Button
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" android:text="."
android:textColor="#ff0000" />
<Button
android:id="@+id/b0"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1" android:text="0"
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>
</LinearLayout>
OUTPUT:
Class Performance
Record
Viva
Total
RESULT:
Thus, the program for android based calculator application was executed successfully.
EX. NO. : 7
Develop a mobile application to send an email.
DATE :
AIM:
To develop an android application that send an email.
ALGORITHM:
PROGRAM CODE:
MainActivity.java
package com.example.admin.myapplication;
import android.content.Intent;import
android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View; import
android.widget.Button;import
android.widget.Toast;
public class MainActivity extends AppCompatActivity {
@Overrid
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button startBtn = (Button) findViewById(R.id.sendbttn);
startBtn.setOnClickListener(new View.OnClickListener() {
public void onClick(View view) {
sendEmail();
}
});
}
activity_main.xml
Class Performance
Record
Viva
Total
RESULT:
Thus, the program for android application that uses to send an email wasexecuted successful.