MESSAGING. Overview  SMS sends short text messages between mobile phones.  Supports sending both text messages and data messages  MMS (multimedia messaging.

Slides:



Advertisements
Similar presentations
Android Application Development Tutorial. Topics Lecture 6 Overview Programming Tutorial 3: Sending/Receiving SMS Messages.
Advertisements

Programming with Android: Activities and Intents Luca Bedogni Marco Di Felice Dipartimento di Informatica – Scienza e Ingegneria Università di Bologna.
Android Security. N-Degree of Separation Applications can be thought as composed by Main Functionality Several Non-functional Concerns Security is a non-functional.
Cosc 5/4730 Android SMS. A note first Depending on the API level, an import changes because of a deprecated API 3 uses – import android.telephony.gsm.SmsManager;
Cosc 5/4730 Android SMS and MMS.
SMS Read received SMS Read sent SMS Send SMS New app, SMSFun Button – Text: Send SMS – Id: sendSMSButton Permissions – send_sms – read_sms – receive_sms.
SMS. Short Message Service – Primarily text messages between mobile phones – First one sent December 3, 1982 “Merry Christmas” – In 2008 Approximately.
Understanding Basics Computer Concepts Unit A.
Introduction to AppInventor Dr. José M. Reyes Álamo.
Android Security Enforcement and Refinement. Android Applications --- Example Example of location-sensitive social networking application for mobile phones.
Integrated Messaging Platform Broadcast Mediawire Multi media Tailored Solutions.
INTERNATIONAL SUMMER ACADEMIC COURSE UNIVESITY OF NIS ISAC – Android programming.
Android Declassification Infrastructure Matan David Yuval Evron Project Advisor: Roei Schuster 1.
Understanding Android Security Yinshu Wu William Enck, Machigar Ongtang, and PatrickMcDaniel Pennsylvania State University.
Using Microsoft Office Communicator. Microsoft Office Communicator Office Communicator enables you to instantly communicate with your colleagues using.
Introducing the Sudoku Example
J2ME Messaging Khanh Le. Objective  The objective of wireless messaging is to extend the networking and I/O capabilities of J2ME applications to send.
Help Course summary Press F5 to start, Esc to stop Course summary—Send and open attachments Create an Outlook signature You can create signatures in Outlook.
Confidential - © 2012 StreamWIDE © StreamWIDE
Mobile Application Development Selected Topics – CPIT 490
CSS216 MOBILE PROGRAMMING Android, Chapter 13 Book: “Professional Android™ 2 Application Development” by Reto Meier, 2010 by: Andrey Bogdanchikov (
Java Mobile Application sms,sim,mms and barcode application Presented by Ayedh(SIM and MMS) Asad(SMS and Barcode Application)
Mobile Computing Lecture#08 IntentFilters & BroadcastReceivers.
Google Cloud Messaging for Android (GCM) is a free service that helps developers send data from servers to their Android.
P2P communication Using the GTalk Service API. Introduction Peer-to-Peer communication highly used in mobile devices. Very efficient to when certain factors.
Integrating with Android Services. Introduction  Android has numerous built-in functionality that can be called from within your applications  SMS/MMS.
Using Intents to Broadcast Events Intents Can be used to broadcast messages anonymously Between components via the sendBroadcast method As a result Broadcast.
Android ICC Part II Inter-component communication.
DUE Hello World on the Android Platform.
CS378 - Mobile Computing Intents.
16 Services and Broadcast Receivers CSNB544 Mobile Application Development Thanks to Utexas Austin.
COMP 365 Android Development.  Every android application has a manifest file called AndroidManifest.xml  Found in the Project folder  Contains critical.
Intent Erick Pranata © Sekolah Tinggi Teknik Surabaya 1.
Outlook Web App Crash course. Outlook Agenda Login Login Reset Password Reset Password Getting Started in Outlook Web App Getting Started in Outlook Web.
Mobile Communication MMS. Mobile Communication Multimedia Messaging Service (MMS) is a standard for telephone messaging systems that allows sending messages.
Telephony and sms API’S. Objective Telephony ➤ Initiating phone calls ➤ Reading the phone, network, data connectivity, and SIM states ➤ Monitoring changes.
Topic: MediaSMS Contact Backup File APPS About Speaker Name: Sorn Work: Buddhist Library Cambodia Project Org Web:
CPSC 441 TUTORIAL – FEB 13, 2012 TA: RUITNG ZHOU UDP REVIEW.
Android System Security Xinming Ou. Android System Basics An open-source operating system for mobile devices (AOSP, led by Google) – Consists of a base.
FCM Workflow using GCM.
Intents 1 CS440. Intents  Message passing mechanism  Most common uses:  starting an Activity (open an , contact, etc.)  starting an Activity.
Lecture 2: Android Concepts
Cosc 5/4735 Voice Actions Voice Interactions (API 23+)
MMS Plato Chen Aug, MMS Brief Introduction MMS is short for Multimedia Messaging Service.Its biggest feature is supported for multimedia functions,
Intents and Broadcast Receivers Dr. David Janzen Except as otherwise noted, the content of this presentation is licensed under the Creative Commons Attribution.
Mobile Software Development for Android - I397 IT COLLEGE, ANDRES KÄVER, WEB:
David Sutton SMS TELEPHONY IN ANDROID. OUTLINE  This week’s exercise, an SMS Pub Quiz  Simulating telephony on an emulator  Broadcast Intents and broadcast.
How to develop a VoIP softphone in C# that enables SIP Instant Messaging (IM) This presentation describes how to create a softphone in C# that allows you.
Messaging and Networking. Objectives Send SMS messages using the Messaging app Send SMS messages programmatically from within your app Receive and consume.
Android Mobile Application Development
Telephony and SMS Objective • Telephony ➤ Initiating phone calls
Lecture 2: Android Concepts
Understanding Android Security
Broadcast receivers.
Android 5: Interacting with Other Apps
Android System Security
Messaging Unit-4.
CIS 470 Mobile App Development
Android Programming Lecture 5
Android Notifications (Part 2) Plus Alarms and BroadcastReceivers
Activities and Intents
Android Topics What are Intents? Implicit Intents vs. Explicit Intents
Add to the Coffee Ordering App
Activities and Intents
CIS 470 Mobile App Development
Understanding Android Security
Android Developer Fundamentals V2 Lesson 5
Hyperlinks Links for .
Lecture 2: Android Concepts
Mobile Programming Dr. Mohsin Ali Memon.
Presentation transcript:

MESSAGING

Overview  SMS sends short text messages between mobile phones.  Supports sending both text messages and data messages  MMS (multimedia messaging service) messages have allowed users to send and receive messages that include multimedia attachments such as photos, videos, and audio.  Using the SMSManager, you can replace the native SMS application to send text messages, react to incoming texts, or use SMS as a data transport layer.  Use the SEND and SEND_TO actions in Intents to send both SMS and MMS messages using a messaging application installed on the device.

Sending SMS/MMS thru Native App (1)  Use Intent with Intent.ACTION_SENDTO action:  Specify a target number using sms: schema notation as the Intent data.  Include the message you want to send within the Intent payload using an sms_body extra. Intent smsIntent = new Intent(Intent.ACTION_SENDTO, Uri.parse("sms: ")); smsIntent.putExtra("sms_body", "Press send to send me"); startActivity(smsIntent);

Sending SMS/MMS thru Native App (2) Intent i = new Intent(android.content.Intent.ACTION_VIEW); i.putExtra(“address”, “5556; 5558; 5560”); i.putExtra(“sms_body”, “Hello my friends!”); i.setType(“vnd.android-dir/mms-sms”); startActivity(i);

Sending SMS/MMS thru Native App (3)  You can also attach files (effectively creating an MMS message) to your messages  Add an Intent.EXTRA_STREAM with the URI of the resource to attach.  Set the Intent type to the mime-type of the attached resource.  Use ACTION_SEND and include the target phone number as an address extra // Get the URI of a piece of media to attach. Uri attached_Uri = Uri.parse("content://media/external/images/media/1"); // Create a new MMS intent Intent mmsIntent = new Intent(Intent.ACTION_SEND, attached_Uri); mmsIntent.putExtra("sms_body", "Please see the attached image"); mmsIntent.putExtra("address", " "); mmsIntent.putExtra(Intent.EXTRA_STREAM, attached_Uri); mmsIntent.setType("image/png"); startActivity(mmsIntent);

Sending SMS Manually  SMS messaging in Android is handled by the SmsManager. SmsManager smsManager = SmsManager.getDefault();  Specify the SEND_SMS uses-permission.  Use sendTextMessage from the SMS Manager, passing in the address (phone number) of your recipient and the text message you want to send, String sendTo = " "; String myMessage = "Android supports programmatic SMS messaging!"; smsManager.sendTextMessage(sendTo, null, myMessage, null, null);

Tracking and Confirming SMS Delivery  The final two parameters in sendTextMessage let you specify Intents to track the transmission and delivery.  Implement and register corresponding Broadcast Receivers that listen for the actions you specify when creating the Pending Intents you pass in sendTextMessage.  Intent parameter, sentIntent, is fired when the message either is successfully sent or fails to send.  Activity.RESULT_OK  SmsManager.RESULT_ERROR_GENERIC_FAILURE  SmsManager.RESULT_ERROR_RADIO_OFF  SmsManager.RESULT_ERROR_NULL_PDU  The second Intent parameter, deliveryIntent, is fired only after the destination recipient receives your SMS message.

SMS delivery monitoring pattern

Handling Incoming SMS Messages  With received SMS, new broadcast Intent is fired with the “android.provider.Telephony.SMS_RECEIVED“ action.  Specify the RECEIVE_SMS manifest permission.  Use the pdu extras key to extract an array of SMS PDUs each of which represents an SMS message  Call SmsMessage.createFromPdu to convert each PDU byte array into an SMS Message object Bundle bundle = intent.getExtras(); if (bundle != null) { Object[] pdus = (Object[]) bundle.get("pdus"); SmsMessage[] messages = new SmsMessage[pdus.length]; for (int i = 0; i < pdus.length; i++) messages[i] = SmsMessage.createFromPdu((byte[]) pdus[i]); }

Example of Incoming SMS Messages  Register the Broadcast Receiver using an Intent Filter that listens for the android.provider.Telephony.SMS_RECEIVED action String.  Broadcast Receiver implementation whose onReceive handler checks incoming SMS texts that start with the and then sends the same text back to the number that sent it.

Example of Incoming SMS Messages

private void send (String[] Addresses, String[] carbonCopies, String subject, String message) { Intent Intent = new Intent(Intent.ACTION_SEND); Intent.setData(Uri.parse(“mailto:”)); String[] to = Addresses; String[] cc = carbonCopies; Intent.putExtra(Intent.EXTRA_ , to); Intent.putExtra(Intent.EXTRA_CC, cc); Intent.putExtra(Intent.EXTRA_SUBJECT, subject); Intent.putExtra(Intent.EXTRA_TEXT, message); Intent.setType(“message/rfc822”); startActivity(Intent.createChooser( Intent, “ ”)); }