MAD Record
MAD Record
:1
Aim:
Algorithm:
1
RESULT:
Thus, the installation of android studio has been successfully implemented
and executed.
2
[Link]. :2
IMPLEMENT MOBILE APPLICATIONS USING UI
TOOLKITS AND FRAMEWORK
Date :
Aim:
To implement mobile applications using ui toolkits and framework design an
application that uses layout managers and event listeners.
Algorithm:
STEP 1 :Open Android Stdio and then click on File -> New -> New
project.
STEP 2 : Design the layout on Avtivity [Link]
STEP 3 : Click on app -> java -> [Link]->
mainactivity.
STEP 4 :Impliment java code in the Main activity
STEP 5 : Start the Android emulator
STEP 6 : Build and compile the program
Program:
<edittext
Android:id="@+id/edittexttextpersonname2"
Android:layout_width="wrap_content"
Android:layout_height="wrap_content"
Android:ems="10"
Android:inputtype="textpersonname"
Android:text="hello there"
i
Tools:layout_editor_absolutey="26dp" />
<Button
Android:id="@+id/button"
Android:layout_width="wrap_content"
Android:layout_height="wrap_content"
Android:text="press here"
App:layout_constraintbottom_tobottomof="parent"
App:layout_constraintend_toendof="parent"
App:layout_constraintstart_tostartof="parent"
App:layout_constrainttop_totopof="parent" />
</[Link]>
4
MAIN ACTIVITY
Package [Link];
Import [Link];
Import [Link];
Import [Link];
Import [Link];
Import [Link];
@Override
Protected void oncreate(Bundle savedinstancestate) {
[Link](savedinstancestate);
Setcontentview([Link].activity_main);
Txt = findviewbyid([Link].edittexttextpersonname2);
Btn = findviewbyid([Link]);
[Link](new [Link]() {
@Override
Public void onclick(View v) {
[Link]("hello ");
5
}});}}
Output:
RESULT:
6
[Link]. :3
DESIGN AN APPLiICATION THAT USES LAYOUT
MANAGERS AND EVENT LISTENERS
Date :
Aim:
To develop a Simple Android Application that uses Layout Managers and
Event Listeners.
Algorithm:
Creating a New project:
STEP 1 :Open Android Stdio and then click on File -> New -> New
project.
STEP 2:Then type the Application name as “[Link].2″ and click Next.
STEP 3 :Then select the Minimum SDK as shown below and click Next.
STEP 4 :Then select the Empty Activity and click Next.
STEP 5 :Finally click Finish.
STEP 6 :It will take some time to build and load the project.
STEP 7 :After completion it will look as given below.
Creating Second Activity for the Android Application:
STEP 1 :Click on File -> New -> Activity -> Empty Activity.
STEP 2 :Type the Activity Name as SecondActivity and click Finish button.
STEP 3 : Thus Second Activity For the application is created.
Designing layout for the Android Application:
Designing Layout for Main Activity:
STEP 4 :Click on app -> res -> layout -> activity_main.xml.
STEP 5 :Now click on Text as shown below.
7
STEP 6 :Then delete the code which is there and type the code as given below.
Program:
APP Activity_main.xml
<RelativeLayout
xmlns:android="[Link]
xmlns:tools="[Link]
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="100dp">
<TextView
android:id="@+id/textView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="30dp"
android:text="Details Form"
android:textSize="25sp"
android:gravity="center"/>
</LinearLayout>
<GridLayout
android:id="@+id/gridLayout"
8
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="100dp"
android:layout_marginBottom="200dp"
android:columnCount="2"
android:rowCount="3">
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:layout_row="0"
android:layout_column="0"
android:text="Name"
android:textSize="20sp"
android:gravity="center"/>
<EditText
android:id="@+id/editText"
android:layout_width="wrap_content"
<[Link]
xmlns:android="[Link]
xmlns:app="[Link]
xmlns:tools="[Link]
9
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<TextView
android:id="@+id/setInformation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.074" />
<Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="GET INFORMATION"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/setInformation"
app:layout_constraintVertical_bias="0.967" />
<TextView
10
android:id="@+id/ram"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="ramview"
app:layout_constraintBottom_toTopOf="@+id/button"
app:layout_constraintTop_toBottomOf="@+id/setInformation"
app:layout_constraintVertical_bias="0.925"
tools:layout_editor_absoluteX="0dp" />
</[Link]>
[Link]
package [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
TextView txt;
11
TextView ram;
Button btn;
long bytesAvailable,megAvailable;
@Override
[Link](savedInstanceState);
setContentView([Link].activity_main);
initView();
bytesAvailable =[Link]() *
[Link]();
txt= findViewById([Link]);
btn= findViewById([Link]);
ram=findViewById([Link]);
[Link](new [Link]() {
@Override
[Link](information);
[Link](getMemoryinfo());
12
}
});
[Link](memoryInfo);
if (tb > 1) {
finalvalue = [Link](tb).concat("TB");
finalvalue = [Link](gb).concat("GB");
finalvalue = [Link](mb).concat("MB");
13
finalvalue = [Link](kb).concat("KB");
else
finalvalue =[Link](totalMemory).concat("Bytes");
[Link]("Ram: ").append(finalvalue).append("\n").
return [Link]();
14
Output:
RESULT:
Thus to design an appliication that uses layout managers and event listeners
Has been excuted sucessfully
15
[Link]. :4
DESIGN A MOBILE APPLICATION THAT IS
AWARE OF THE RESOURCE CONSTRAINTS OF
MOBILE DEVICES
Date :
Aim:
Algorithm:
STEP 1: Add the Performance Monitoring SDK to your appIn your module
(app-level) Gradle file (usually <project>/<app-module>/[Link]), add the
dependency for the Performance Monitoring Android library
STEP 2: Add the Performance Monitoring Gradle plugin to your appIn your
root-level (project-level) Gradle file (<project>/[Link]), add the
Performance Monitoring Gradle plugin as a buildscript dependency:
Recompile your app
16
Program:
ACTIVITY MAIN
<AbsoluteLayout
xmlns:android="[Link]
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="50dp"
android:layout_y="20dp"
android:text="Student Details"
android:textSize="30sp" />
<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
17
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" />
18
<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"
19
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"
20
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>
[Link]
package [Link].exno5;
import [Link];
import [Link];
import [Link];
21
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
EditText Rollno,Name,Marks;
Button Insert,Delete,Update,View,ViewAll;
SQLiteDatabase db;
@Override
[Link](savedInstanceState);
setContentView([Link].activity_main);
Rollno=(EditText)findViewById([Link]);
Name=(EditText)findViewById([Link]);
Marks=(EditText)findViewById([Link]);
Insert=(Button)findViewById([Link]);
22
Delete=(Button)findViewById([Link]);
Update=(Button)findViewById([Link]);
View=(Button)findViewById([Link]);
ViewAll=(Button)findViewById([Link]);
[Link](this);
[Link](this);
[Link](this);
[Link](this);
[Link](this);
db=openOrCreateDatabase("StudentDB", Context.MODE_PRIVATE,
null);
if(view==Insert)
if([Link]().toString().trim().length()==0||
23
[Link]().toString().trim().length()==0||
[Link]().toString().trim().length()==0)
return;
"','"+[Link]()+"');");
clearText();
if(view==Delete)
if([Link]().toString().trim().length()==0)
return;
if([Link]())
24
{
else
clearText();
if(view==Update)
if([Link]().toString().trim().length()==0)
return;
if([Link]()) {
else {
clearText();
if(view==View)
if([Link]().toString().trim().length()==0)
return;
if([Link]())
[Link]([Link](1));
[Link]([Link](2));
}
26
else
clearText();
if(view==ViewAll)
if([Link]()==0)
return;
}
while([Link]())
[Link]("Rollno: "+[Link](0)+"\n");
[Link]("Name: "+[Link](1)+"\n");
[Link]("Marks: "+[Link](2)+"\n\n");
}
27
}
[Link](true);
[Link](title);
[Link](message);
[Link]();
[Link]("");
[Link]("");
[Link]("");
[Link]();
28
Output:
RESULT:
29
[Link]. :5
DESIGN AN APPLICATION THAT USES DYNAMIC
LINKING
Date :
Aim:
Algorithm:
STEP 2 :Now click on the Firebase option in the drop down menu.
STEP 3 :A menu will appear on the right side of screen. It will show
variousservices that Firebase offers. Choose the desired service.
buildscript {
dependencies {
classpath '[Link]:google-services:4.0.0'
dependencies {
compile '[Link]:firebase-core:16.0.0'
...
STEP 10 :After adding the above code(sdk), run the app to send the
verification to the Firebase console.
31
Program:
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
.scheme("https")
.authority(appCode + ".[Link]")
.path("/")
.appendQueryParameter("link", [Link]())
.appendQueryParameter("apn", packageName);
32
dynamicLink = [Link]();
[Link](true);
Output:
RESULT:
excuted sucessfully
33
[Link]. :6
DEVELOP AN APPLICATION THAT MAKES USE OF
MOBILE DATABASE
Date :
Aim:
Algorithm:
34
Program:
Activity_main.xml
<AbsoluteLayout
xmlns:android="[Link]
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="50dp"
android:layout_y="20dp"
android:text="Student Details"
android:textSize="30sp" />
<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
35
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" />
36
<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"
37
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"
38
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>
MAIN ACTIVITY
package [Link].exno5;
import [Link];
import [Link];
import [Link];
import [Link];
39
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
EditText Rollno,Name,Marks;
Button Insert,Delete,Update,View,ViewAll;
SQLiteDatabase db;
@Override
[Link](savedInstanceState);
setContentView([Link].activity_main);
Rollno=(EditText)findViewById([Link]);
Name=(EditText)findViewById([Link]);
Marks=(EditText)findViewById([Link]);
Insert=(Button)findViewById([Link]);
Delete=(Button)findViewById([Link]);
40
Update=(Button)findViewById([Link]);
View=(Button)findViewById([Link]);
ViewAll=(Button)findViewById([Link]);
[Link](this);
[Link](this);
[Link](this);
[Link](this);
[Link](this);
db=openOrCreateDatabase("StudentDB", Context.MODE_PRIVATE,
null);
if(view==Insert)
{
if([Link]().toString().trim().length()==0||
[Link]().toString().trim().length()==0||
41
[Link]().toString().trim().length()==0)
return;
"','"+[Link]()+"');");
clearText();
if(view==Delete)
if([Link]().toString().trim().length()==0)
return;
if([Link]())
42
[Link]("DELETE FROM student WHERE
rollno='"+[Link]()+"'");
else
clearText();
if(view==Update)
if([Link]().toString().trim().length()==0)
return;
if([Link]()) {
else {
clearText();
if(view==View)
if([Link]().toString().trim().length()==0)
return;
if([Link]())
[Link]([Link](1));
[Link]([Link](2));
else
44
{
clearText();
if(view==ViewAll)
if([Link]()==0)
return;
while([Link]())
[Link]("Rollno: "+[Link](0)+"\n");
[Link]("Name: "+[Link](1)+"\n");
[Link]("Marks: "+[Link](2)+"\n\n");
}
45
public void showMessage(String title,String message)
[Link](true);
[Link](title);
[Link](message);
[Link]();
[Link]("");
[Link]("");
[Link]("");
[Link]();
46
Output:
RESULT:
Thus, to develop an application that makes use of mobile database. Has been
excuted sucessfully
47
[Link]. :7
IMPLEMENT AN APPLICATION THAT WRITES
DATA TO THE SD CARD.
Date :
Aim:
Algorithm:
48
Program:
Activity_main.xml
<LinearLayout xmlns:android="[Link]
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="20dp"
android:orientation="vertical">
<EditText
android:id="@+id/editText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:textSize="30dp" />
<Button
android:id="@+id/button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:text="Write Data"
android:textSize="30dp" />
49
<Button
android:id="@+id/button2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:text="Read data"
android:textSize="30dp" />
<Button
android:id="@+id/button3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:text="Clear"
android:textSize="30dp" />
</LinearLayout>
[Link]
package [Link].exno9;
import [Link];
import [Link];
import [Link];
import [Link];
50
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
EditText e1;
Button write,read,clear;
@Override
[Link](savedInstanceState);
setContentView([Link].activity_main);
51
[Link](new [Link]()
@Override
String message=[Link]().toString();
try
[Link]();
[Link]([Link]());
[Link]();
[Link](getBaseContext(),"Data Written in
SDCARD",Toast.LENGTH_LONG).show();
catch (Exception e)
{
[Link](getBaseContext(),[Link](),Toast.LENGTH_LONG).sh
ow();
});
[Link](new [Link]()
52
{
@Override
String message;
try
buf += message;
[Link](buf);
[Link]();
[Link]();
catch (Exception e)
53
[Link](getBaseContext(), [Link](),
Toast.LENGTH_LONG).show();
});
[Link](new [Link]()
@Override
[Link]("");
});
}package [Link].exno9;
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
54
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
EditText e1;
Button write,read,clear;
@Override
[Link](savedInstanceState);
setContentView([Link].activity_main);
[Link](new [Link]()
@Override
55
public void onClick(View v)
String message=[Link]().toString();
try
[Link]();
[Link]([Link]());
[Link]();
[Link](getBaseContext(),"Data Written in
SDCARD",Toast.LENGTH_LONG).show();
catch (Exception e)
[Link](getBaseContext(),[Link](),Toast.LENGTH_LONG).sh
ow();
});
[Link](new [Link]()
@Override
56
public void onClick(View v)
String message;
try
buf += message;
[Link](buf);
[Link]();
[Link]();
catch (Exception e)
[Link](getBaseContext(), [Link](),
Toast.LENGTH_LONG).show();
}
57
}
});
[Link](new [Link]()
@Override
[Link]("");
});
58
Output:
RESULT:
59
[Link]. :8
DEVELOP A WEB BASED MOBILE APPLICATION
THAT ACCESSES INTERNET AND LOCATION
DATA
Date :
Aim:
Algorithm:
60
Program:
Activity_main.xml
<LinearLayout xmlns:android =
"[Link]
android:layout_width = "fill_parent"
android:layout_height = "fill_parent"
<Button
android:id = "@+id/button"
android:layout_width = "fill_parent"
android:layout_height = "wrap_content"
android:text = "getlocation"/>
</LinearLayout>
MAIN ACTIVITY
package [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
61
import [Link];
import [Link];
import [Link];
import [Link];
62
private static final long MIN_DISTANCE_CHANGE_FOR_UPDATES =
10; // 10 meters
[Link] = context;
getLocation();
try {
locationManager = (LocationManager)
[Link](LOCATION_SERVICE);
isGPSEnabled =
[Link](LocationManager.GPS_PROVIDER);
63
isNetworkEnabled = locationManager
.isProviderEnabled(LocationManager.NETWORK_PROVIDER);
} else {
[Link] = true;
if (isNetworkEnabled) {
[Link](
LocationManager.NETWORK_PROVIDER,
MIN_TIME_BW_UPDATES,
MIN_DISTANCE_CHANGE_FOR_UPDATES, this);
Log.d("Network", "Network");
if (locationManager != null) {
location = locationManager
.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);
if (location != null) {
latitude = [Link]();
longitude = [Link]();
64
}
if (isGPSEnabled) {
if (location == null) {
[Link](
LocationManager.GPS_PROVIDER,
MIN_TIME_BW_UPDATES,
MIN_DISTANCE_CHANGE_FOR_UPDATES, this);
if (locationManager != null) {
location = locationManager
.getLastKnownLocation(LocationManager.GPS_PROVIDER);
if (location != null) {
latitude = [Link]();
longitude = [Link]();
}
65
} catch (Exception e) {
[Link]();
return location;
/**
* */
if(locationManager != null){
[Link]([Link]);
/**
* */
if(location != null){
latitude = [Link]();
// return latitude
66
return latitude;
/**
* */
if(location != null){
longitude = [Link]();
// return longitude
return longitude;
/**
* @return boolean
* */
return [Link];
/**
* */
67
public void showSettingsAlert(){
[Link]("GPS is settings");
[Link]("Settings", new
[Link]() {
[Link](intent);
});
[Link]("Cancel", new
[Link]() {
[Link]();
});
[Link]();
68
}
@Override
@Override
@Override
@Override
@Override
return null;
69
Output:
RESULT:
70
[Link]. :9
DEVELOP AN ANDROID APPLICATION USING
TELEPHONY TO SEND SMS
Date :
Aim:
Algorithm:
71
Program:
Activity_main.xml
<RelativeLayout xmlns:android="[Link]
xmlns:tools="[Link]
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
toIols:context=".MainActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:textSize="30dp" />
<TextView
android:layout_width="wrap_content"
72
android:layout_height="wrap_content"
android:id="@+id/textView2"
android:layout_below="@+id/textView"
android:layout_centerHorizontal="true"
android:textSize="30dp"
android:textColor="#ff14be3c" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/imageView"
android:src="@drawable/abc"
android:layout_marginTop="48dp"
android:layout_below="@+id/textView2"
android:layout_centerHorizontal="true" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Compose SMS"
android:id="@+id/button"
android:layout_below="@+id/imageView"
android:layout_alignRight="@+id/textView2"
73
android:layout_alignEnd="@+id/textView2"
android:layout_marginTop="54dp"
android:layout_alignLeft="@+id/imageView"
android:layout_alignStart="@+id/imageView" />
</RelativeLayout>
MAIN ACTIVITY :
package [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
@Override
[Link](savedInstanceState);
74
setContentView([Link].activity_main);
[Link](new [Link]() {
sendSMS();
});
[Link]([Link]("smsto:"));
[Link]("[Link]-dir/mms-sms");
try {
startActivity(smsIntent);
finish();
@Override
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate([Link], menu);
return true;
76
\Output:
RESULT:
thus, to develop an android application using telephony to send sms. Has been
excuted successful.
77