Mad 2.3
Mad 2.3
3
Student Name: Sameer Ahuja UID: 21BCS1791
Branch: BE-CSE Section/Group: CC-602-A
th
Semester: 6 Date of Performance: 29-02-2024
Subject Name: Mobile Application Development
Subject Code: 21CSP-355
1. Aim:
To create and design an Android application Send SMS using Intent using Android Studio.
2. Objective:
The objective of an Android application using various controls such as Android Studio(Latest
Version)This type of application aims to showcase the usage and functionalities of these UI
elements to enhance the user experience.
3. Procedure:
Step 1: Open Android Stdio and then click on File -> New -> New project.
Step 2: Then type the Application name as smsintent 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. Finally click Finish.
Step 5: Design layout in activity_main.xml.
Step 6: Send SMS and Display details give in MainActivity file. Step
7: Save and run the application.
4. Script :
MainActivity.java:- package
com.example.smsintent; import
android.Manifest;
import android.annotation.SuppressLint;
import android.content.pm.PackageManager;
import android.os.Build; import
android.os.Bundle; import
android.telephony.SmsManager;
import android.view.View; import
android.widget.Button; import
android.widget.EditText; import
android.widget.Toast; import
androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<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:padding="16dp"
tools:context=".MainActivity">
<EditText
android:id="@+id/number"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Enter Phone Number"/>
<EditText
android:id="@+id/text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/number"
android:layout_marginTop="16dp"
android:hint="Enter Message"/>
<Button
android:id="@+id/send"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/text"
android:layout_marginTop="16dp"
android:text="Send SMS"/>
</RelativeLayout>
4. Output: