Batch 20 Project Report
Batch 20 Project Report
USING KOTLIN
Submitted by
RAGHUL S (113020104303)
SIVAKUMAR P (113020104307)
ANAND KUMAR Y (113020104301)
SARAN SANJAY R (113020104306)
degree of
BACHELOR OF ENGINEERING
IN
An Autonomous Institution
Approved by AICTE,New Delhi/ Affiliated to Anna University, Chennai –
600025 MAY 2023
1
VEL TECH HIGH TECH
Dr. RANGARAJAN Dr. SAKUNTHALA ENGINEERING COLLEGE
An Autonomous Institution
BONAFIDE CERTIFICATE
SIGNATURE SIGNATURE
Dr. DURGA DEVI, B.E., M.E., PhD., Mr.Parthiban M.A
HEAD OF THE DEPARTMENT ASSISTANT PROFESSOR
Computer Science and Engineering Computer Science and Engineering
Dept. of Computer Science and Engg.Vel Dept. of Computer Science and Engg.Vel
Tech High Tech Dr.Rangarajan Tech High Tech Dr.Rangarajan
Dr.Sakunthala Engineering College Avadi, Dr.Sakunthala Engineering College Avadi,
Chennai - 600062 Chennai - 600062
2
CERTIFICATE OF EVALUATION
SEMESTER: VI
RAGHUL S
1. (113020104303)
SIVAKUMAR P
CLASSIFYING Mr.Parthiban M.A
2. (113020104307)
MESSAGE
ANAND KUMAR Y APPLICATION ASSISTANT
3. (113020104301) USING KOTLIN PROFESSOR
SARAN SANJAY R
4. (113020104306)
3
INTERNAL EXAMINER EXTERNAL
EXAMINER
4
ACKNOWLEDGMENT
We wish to express our sincere thanks to the people who extended their help during
the course of our Mini Project work.
First of all we would like to express our deep gratitude to our beloved and respected
FOUNDER & CHAIRMAN Col. Prof. Vel. Shri. Dr. R. RANGARAJAN B.E. (Elec.),
B.E (Mech.), M.S (Auto.), DSC, and FOUNDRESS & VICE CHAIRMAN Dr.
SAKUNTHALA RANGARAJAN M.B.B.S. We also record sincere thanks to our
Honourable Principal, Dr. E.KAMALANABAN B.E., M.E., Ph.D., for his kind support for
his Mini Project.
We are thankful and extremely grateful to our Dean-SoEC Dr. V. RAVI and Head of the
department Dr. S. DURGADEVI, B.E., M.E., Ph.D., for their support and motivation feed
to us for doing the Mini Project.
We would like to extend our sincere thanks to our guide Mr.PARTHIBAN M.A, for her
technical support during this project. Her stupendous encouragement enabled us to complete
our Mini Project successfully.
We would like to extend our sincere thanks to our Project Coordinator Dr. M. MALATHY
B.E., M.E., Ph.D., for their continuous support over this Mini Project.
TABLE OF CONTENTS
CHAPTER TITLE PG NO
NO
ABSTRACT 6
1 INRODUCTION 7
2 LITERATURE REVIEW 10
2.1 INTRODUCTION
2.2 Short Message Service (SMS)
2.3 BULK SMS
2.4 TEXTLOCAL
2.5 LOGONUTILITY
3 KEY POINTS 11
3.1 ANDROID
3.2 ABOUT ANDROID APP
KOTLIN THE PROGRAMMING
3.3
LANGUAGE
3.4 GOOGLE FIREBASE
3.4.1 WHY FIREBASE OVER SQL
6
9 SAMPLE OUTPUT SCREENSHOTS 27
9.1 SAMPLE XML SCREEN
9.2 SMS INTERFACE
9.3 SMS OTP DETECTION
9.4 SMS TRANSACTION
9.5 SMS SPAM DETECTION
10 RESULT 30
11 CONCLUSION 31
12 REFERENCES 32
7
Abstract
The use of short message service (SMS) has grown tremendously in the past few
years. Billions of users use this service to send text messages. Various applications
have been introduced by service providers, e.g., mobile banking, summons
checkpoint, SMS chat, etc., all of which have become a huge success. This chapter
gives an overview of how this service is provided and discusses various SMS
applications offered to the user. We explore the reasons behind its success and the
issues that must be addressed to provide these applications. We also examine future
trends and the challenges that must be overcome in order to enhance this service. We
hope that this chapter gives a better understanding of how SMS applications are
provided and what may be expected in future applications given the enhancement on
the current SMS and technology advancementAlthough it is a widely used
communication mechanism for cell phone users, SMS is far more than just a
technology for teenage chat. SMS technology evolved out of the global system for
mobile communications standard, an internationally accepted cell phone network
specification the European Telecommunications Standards Institute created. The 3rd
Generation Partnership Project maintains the SMS standard. SMS messages are
handled via a short message service center that the cellular provider maintains for
the end devices. The SMSC can send SMS messages to the end device using a
maximum payload of 140 octets. This defines the upper bound of an SMS message
to be 160 characters using 7-bit encoding. It is possible to specify other schemes
such as 8-bit or 16-bit encoding, which decreases the maximum message length to
140 and 70 characters, respectively.
8
Chapter 1
1.1 Introduction
Short Message Service (SMS) is the most frequently and widely used
communication medium. The term “SMS” is used for both the user activity and all
types of short text messaging in many parts of the world. It has become a medium of
advertisement and promotion of products, banking updates, agricultural information,
flight updates and internet offers. SMS is also employed in direct marketing known
as SMS marketing. Sometimes SMS marketing is a matter of disturbance to users.
These kinds of SMSs are called spam SMS. Spam is one or more unsolicited
messages, which is unwanted to the users, sent or posted as part of a larger collection
of messages, all having substantially identical content. The purposes of SMS spam
are advertisement and marketing of various products, sending political issues,
spreading inappropriate adult content and internet offers. That is why spam SMS
flooding has become a serious problem all over the world. SMS spamming gained
popularity over other spamming approaches like email and twitter, due to the
increasing popularity of SMS communication. However, opening rates of SMS are
higher than 90% and opened within 15 minutes of receipt whereas opening rate in
email is only 20-25% within 24 hours of receipt . Thus, a proper SMS spam
detection technique has significant necessity. There are several researches on email,
twitter, web and social tagging spam detection techniques. However, a very few
researches have been conducted on SMS spam detection. Spam SMS detection is
more challenging than email spam detection because of the restricted length of SMS,
use of regional content and shortcut words and SMS contains less header
information than an email
9
Chapter 2
Literature survey
2.1 Introduction:
We are visit www.textlocal.in and www.logonutility.com for get the some
information about the bulk SMS. In this literature survey we are understand about
the bulk message sender and how to send bulk amount of message in any
organization for information alert about the organization. Textlocal is says that the
bulk message sender are most useful in big commercial agencies for sending the
bulk amount of messages. Logon Utility has a Bulk SMS gateway that pushes the
simple message to mobile phones. In other words, we have an effective tool that
sends the Bulk SMS through the internet to the people on the handheld device.
SMS stand for short message service. It is technology that enables the sending
and receiving of message between mobile phones. SMS first appeared in European
1992. One SMS message can contain at most 140 bytes of data, so one SMS
message
can contain up to 160 characters .once a message is sent it is received by a SMSC
(short message service center) which must then get it to the appropriate mobile
device.
The Bulk SMS is very popular to send bulk amount of the message in the
organization & Used in Marketing and Banking. Bulk SMS is often used by Big &
10
small business owners, E-commerce industry, media Companies, Banks for Alerts,
Marketing and Fraud control alerts, Reminders, Marketing of products and services.
It’s also commonly used between staffs of company or bank and their clients. One
advantage of Bulk Messaging is that it delivers your message directly to the mobile
handsets anywhere around World.
2.4 Textlocal:
We are visit www.textlocal.in for get the some information about the bulk
SMS. In this literature survey we are understand about the bulk message sender and
how to send bulk amount of message in any organization for information alert about
the organization. www.textlocal.in is says that the bulk message sender are most
useful in big commercial agencies for sending the bulk amount of messages.
Bulk SMS or bulk messaging refers to businesses sending SMS to one or
more recipients via software platforms such as Textlocal. Bulk SMS can scale up to
millions of recipients in the case of informational or promotional broadcasts.
Alternatively, bulk SMS can also mean individual SMS sent to customers upon an
action e.g. receiving an alert on credit card transaction. Both these activities can be
easily carried out from bulk SMS platforms as they allow businesses to create,
schedule, send and track SMS campaigns.
2.5 Logonutility:
In this digital world, while exploring on the internet, we got the names of
many Bulk SMS service providers and picked up one randomly, hence
disappointments. To get the best Bulk SMS service provider is a somehow daunting
task. But today, this barrier will be overcome by the Logon Utility. It is an IT
company that has a robust SMS reseller network of 1200+ and handling over
15000+
11
clients in India. Utility’s success is entirely shown on an official website
logonutility.com where you can look at our best setup, services, infrastructure, and
veteran professionals as well.
The Logon utility have free Bulk SMS credits for first time signup clients so
visit our contact page and fill inquiry form to get more benefits. During sign up a
question come in mind that How to send Bulk SMS than we also have complete
information available on website. Send Bulk text messages online and also know
what
is SMS messaging.
12
Chapter 3
Key Words and Definitions
3.1 Android
Kotlin is used by over 60% of professional Android developers that helps boost
productivity, developer satisfaction, and code safety.
On 7 May 2019, Google announced that the Kotlin programming language is now its
preferred language for Android app developers. Since the release of Android
13
Studio 3.0 in October 2017, Kotlin has been included as an alternative to the
standard Java compiler.
Firebase is a set of hosting services for any type of application (Android, iOS, Java
script, Node.js, Java, Unity, PHP, C++ ...). It offers NoSQL and real-time hosting of
databases, content, social authentication (Google, Face book, Twitter and Github),
and notifications, or services, such as a real-time communication server.
Firebase is a Backend-as-a-Service (BaaS) app development platform that provides
hosted backend services such as a real time database, cloud storage, authentication,
crash reporting, machine learning, remote configuration, and hosting for your static
files. Firebase supports Android App Studio.
14
3.6 Real time Database
Fire Base is a Real time Data Base. Having a real-time database is the standout
feature of the Firebase framework. Firebase caters to a cloud-hosted database in
which the data is stored as JSON and further synchronized constantly to each
associated client. Having a real-time database instance that updates the current data
is essential for modern applications.
3.7 XML
XML stands for eXtensible Markup Language, which is a way of describing data
using a text-based document. Because XML is extensible and very flexible, it's used
for many different things, including defining the UI layout of Android apps.
Other resources like strings for your app are also defined in an XML file
called strings.xml. You describe the view hierarchy of UI elements on the screen.
For example, a Constraint Layout can contain Buttons, Text Views, Image Views, or
other views. Remember, Constraint Layout is a subclass of View Group. It allows
you to position or size child views in a flexible manner.
We can see there are three sections at top right corner
1. Code
2. Split
3. Design
Code option allows us to view the entire code the working slide. Split is useful when
we want to check both the code and design side by side. Design is used to view the
design of the screen generated and allows us to make changes According to that it
will modify the code.
15
Chapter 4
Existing and proposed system
4.1Existing system
India has one of the densest and prospective markets for cellular phones, and
mobile service providers have a strict policy about providing access to their
customer
bases. Many consumers activate “Do Not Disturb” services that disallow mass
publicity calls and messages. However, Bulk SMS service provider in Mumbai
maintain databases of people who are open to mass messages. This means that a
company engaging in this kind of marketing can actually reach out to a target
audience more efficiently. Not all bulk SMS reseller providers have extensive
resources however, and it is up to you to select the right vendor.
Bulk SMSs reach the target audience with greater efficiency than television
or print advertising because they reach the client directly. A message on your phone
is
something that you can always refer to later; and it doesn’t go ignored as marketing
calls often do. On the other side of the playing field, a bulk SMS reseller provider
can
reach out to thousands of people within a limited cost. While conventional
advertising
cannot guarantee the attention of your intended target audience, bulk SMSs will
allow
you a deeper reach into the market without spending as much as you would when
engaging in conventional marketing!
Moreover, in this digital world, smartphones are the best partner. Without it,
nobody survives. Even the old aged or illiterate people used to have smartphones
and
they try to read all messages. These people never read email as they don’t have an
email account.
16
Hence, there may be no doubt that Bulk SMS service will assist you to
connect with your audiences better. Get your Bulk SMS service through us
thousands
of your audience at the same time. It is believed that an SMS is opened within five
minutes of its receipt, making it an effective medium to attain out on your target
market.ies
The proposed system used advanced methodologies to facilitate ease of use and
makes the messages more filtered and cleaner to view .
The transactions from various apps (like gpay , phonepe , paytm etc) are arranged
dynamically based on the content they possess .
Otp’s(One Time Passwords ) are automatically from the device after a specified
amount of time which makes it more secure and helps the comtribute to the free
space on the device .
These messages are automatically converted into modules based on a timed basis as
all messages from a certain timeline are clubbed together enabling to view it easier.
Spam messages are automatically seperated from the other essential messages
which makes it easier to identify messages we dont actually need.
These spam messages are also converted into seperated folders to make them to be
deleted easier.
17
Chapter 5
Modules
The system is an App-based approach. We are going to use Android App Studio
which is a platform to make Android Apps.
Preprocessing:
Removing irrelevant contents like stop words are the part of data preprocessing.
18
Tokenization:
Segmenting the message according to words, characters or symbols called tokens.
There are different tokenization approaches such as word tokenization, sentence
tokenization, word or character Ngrams and orthogonal sparse bigrams.
Representation:
Conversion to attribute value pairs. Selection: Selecting important attribute values
which have impact on classification rather than choosing all pairs of attribute value.
Training:
Train the algorithm with the selected attribute values.
Testing: Test the newly arrived data with the training model.
Two of the major dangerous level permissions i.e., SMS and Location permissions
are most of the privacy concerning permissions. And now it's almost impossible for
new and old apps having these permissions to be published without having a very
strong use-case.
SMS / OTP detection requires SMS permissions from user. And its a common use
case for apps to auto-detect OTP while logging in through mobile verification. But
since READ_SMS and RCEIVE_SMS are not so much easier to get published on
the play store, Google launched SMS Verification APIs which does the task in-
19
place.
The transactional SMS’s from a whole lot of messages are filtered out.
Virtual passbook is created by applying ML algorithms to the messages. SMS
transaction extractor solution applies its intelligence to categorize the messages into
various expense types across products & services, purchase patterns, and credit &
insurance risks.
Duplications are removed and filtered out.
If there are any incomplete values in the data, then they are filled.
20
Chapter 6
System Architecture
21
Chapter 7
Source code
SMS Read/Write:
Permission:
Read SMS:
package com.example.readmessage;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.telephony.SmsMessage;
@Override
public void onReceive(Context context, Intent intent) {
Bundle data = intent.getExtras();
Object[] pdus = (Object[]) data.get("pdus");
for(int i=0; i<pdus.length; i++){
SmsMessage smsMessage = SmsMessage.createFromPdu((byte[]) pdus[i]);
String message = "Sender : " + smsMessage.getDisplayOriginatingAddress()
+ "Email From: " + smsMessage.getEmailFrom()
+ "Emal Body: " + smsMessage.getEmailBody()
+ "Display message body: " + smsMessage.getDisplayMessageBody()
+ "Time in millisecond: " + smsMessage.getTimestampMillis()
+ "Message: " + smsMessage.getMessageBody();
mListener.messageReceived(message);
}
}
22
public static void bindListener(MessageListener listener){
mListener = listener;
}
}
Wirte SMS:
package com.example.sendsms;
import android.os.Bundle;
import android.app.Activity;
import android.app.PendingIntent;
import android.content.Intent;
import android.telephony.SmsManager;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
EditText mobileno,message;
Button sendsms;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mobileno=(EditText)findViewById(R.id.editText1);
message=(EditText)findViewById(R.id.editText2);
sendsms=(Button)findViewById(R.id.button1);
@Override
public void onClick(View arg0) {
String no=mobileno.getText().toString();
String msg=message.getText().toString();
23
//Get the SmsManager instance and call the sendTextMessage method to
send message
SmsManager sms=SmsManager.getDefault();
sms.sendTextMessage(no, null, msg, pi,null);
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}
OTP Detection:
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import com.google.android.gms.auth.api.phone.SmsRetriever;
import com.google.android.gms.common.api.CommonStatusCodes;
import com.google.android.gms.common.api.Status;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* BroadcastReceiver to wait for SMS messages. This can be registered either
* in the AndroidManifest or at runtime. Should filter Intents on
* SmsRetriever.SMS_RETRIEVED_ACTION.
*/
public class MySMSBroadcastReceiver extends BroadcastReceiver {
24
public MySMSBroadcastReceiver() {
}
@Override
public void onReceive(Context context, Intent intent) {
if (SmsRetriever.SMS_RETRIEVED_ACTION.equals(intent.getAction())) {
Bundle extras = intent.getExtras();
if (extras != null) {
Status status = (Status) extras.get(SmsRetriever.EXTRA_STATUS);
if (status != null)
switch (status.getStatusCode()) {
case CommonStatusCodes.SUCCESS:
// Get SMS message contents
String message = (String)
extras.get(SmsRetriever.EXTRA_SMS_MESSAGE);
if (message != null) {
Pattern pattern = Pattern.compile("(\\d{4})");
// \d is for a digit
// {} is the number of digits here 4.
Matcher matcher = pattern.matcher(message);
String val = "";
if (matcher.find()) {
val = matcher.group(0); // 4 digit number
if (this.otpReceiveListener != null)
this.otpReceiveListener.onOTPReceived(val);
} else {
if (this.otpReceiveListener != null)
this.otpReceiveListener.onOTPReceived(null);
}
}
break;
case CommonStatusCodes.TIMEOUT:
if (this.otpReceiveListener != null)
this.otpReceiveListener.onOTPTimeOut();
break;
}
}
}
}
25
interface OTPReceiveListener {
void onOTPReceived(String otp);
void onOTPTimeOut();
}
}
Colour Values:
Chapter 8
Implementation
26
This application is designed based on Kotlin and the application is designed use to
classify the messages received.
All messages are screened and are placed on the concerned categories. This helps for
a more user -friendly and reliable use case of the application.
SMSManager class manages operations like sending a text message, data message,
and multimedia messages (MMS). For sending a text message method
sendTextMessage() is used likewise for multimedia message
sendMultimediaMessage() and for data message sendDataMessage() method is used.
The details of each function are:
sendTextMessage():
sendTextMessage(String destinationAddress, String scAddress, String text,
PendingIntent sentIntent,PendingIntent deliveryIntent, long messageId)
sendDataMessage():
sendDataMessage(String destinationAddress, String scAddress, short
destinationPort, byte[] data,PendingIntent sentIntent, PendingIntent deliveryIntent)
sendMultimediaMessage():
sendMultimediaMessage(Context context, Uri contentUri, String locationUrl,
Bundle configOverrides, PendingIntent sentIntent
Chapter 9
27
Sample output screenshots
28
9.4 SMS TRANSACTION DETECTION :
29
9.5 SMS SPAM DETECTION :
30
Chapter 10
Result
This project is widely use full in any organizations, colleges, banking,
companies,E-Commerce, Market News, Government & Public Utilities,
Logistics, Media & Entertainment, Travel & Tourism Industry etc. Alert your
customer/user about the new updates of organization/colleges. In Logistics it use
to send the shipping updates, invoices, bills, tracking detail web URLs and much
more via an SMS. Media & Entertainment it use to invite the audience to an
FM/TV show or ask the audience to vote for their favorite contestants in your
reality show. and it also used in Travel & Tourism Industry Become a travel
buddy of your customer by sending all the itineraries and travel routes via an
SMS to make their journey more hassle-free.
31
Chapter 11
Conclusion
As there is increase in usage of text messaging day by day, the problem of SMS
spam is becoming more prevalent. Filtering SMS spam has been a major
problem in recent years. In this research work, we have used six different
machine learning algorithms such as decision tree, naive Bayes, random forest,
KNN, SVM, and AdaBoost in which ten features from the dataset are used.
There are 5574 tagged data in the sample, including 4827 messages belonging to
ham messages and 747 messages belonging to spam messages collected. With
accuracy of 99.9%, the random forest classification algorithm outperforms all
other classification algorithms. The accuracy may further be enhanced by using
hybrid soft computing models.
32
Chapter 13
Refernces
3. A. Narayan and P. Saxena, “The curse of 140 characters: evaluating the efficacy
of sms spam detection on android,” in Proceedings of the Third ACM workshop
on Security and privacy in smartphones & mobile devices. ACM, 2013, pp. 33–
42.
6. Almeida, Tiago, José María Gómez Hidalgo, and Tiago Pasqualini Silva.
"Towards sms spam filtering: Results under a new dataset." (2013): 1-18.
33
7. Mujtaba, G., and M. Yasin. "SMS spam detection using simple message content
features." J. Basic Appl. Sci. Res 4 (2014): 275-279
8.
34
9. Q. Sun, H. Qiao, and Z. Luo, “The feature updating algorithm for short
message content filtering,” Information Technology Journal, vol. 7, no. 5, pp. 790–
795, 2008.
20. sdsync you are?: Smartphone fingerprinting via application behav- iour,” in
Proc. 6th ACM Conf. Security Privacy Wireless Mobile Netw., 2013, pp. 7–12.
36