SMSlectue
SMSlectue
with Android
Services
Ø Android has numerous built-in functionality that can be
called from within your applications
Ø SMS/MMS
Ø Telephony (calls)
Ø GPRS/3G
Ø WIFI
Ø Multi-part messages
Ø if a message is too large it can be sent as several parts and
reassembled at the destination
Ø each part is a separate message with special information indicating the
different parts form one whole message
Ø Usually, only a maximum of 3 parts is recommended since parts
can be lost in transit
Ø If a part is lost, essentially the message is now useless
Ø Port number
Ø a special value indication what type of application is going to use
the message
Ø e.g. sending vCard via SMS uses port 9204
Ø Applications can define their own port number for their specific
purposes
Overview
Ø Android
provides a means to access the phone’s
SMS service
Ø Applications can both send and receive SMS messages
Ø Port-based messages are also supported on
device
Ø Sending of ported and non-ported sms is supported
Ø However, the emulator does not properly handle
receiving port-based SMS (they never arrive)
Ø Non-port based messages are properly handled
Ø They can be received with no problem
Ø To be able to access SMS you need to
make sure the following permissions
are placed in your AndroidManifest.xml
Ø For sending:
<uses-permission android:name="android.permission.SEND_SMS"> </uses-permission>
Ø For receiving:
<uses-permission android:name="android.permission.RECEIVE_SMS"> </uses-permission>
Ø To
send SMS on Android you need to
use the following classes
Ø SmsManager
Ø PendingIntent
Ø SmsManager is a system class that
holds the instance referencing the
phone’s SMS system
Ø android.telephony.SmsManager