Android™ Wireless Application Development Volume II: Advanced Topics, Third Edition (Shawn Kahl's Library) by Lauren Darcey & Shane Conder
Author:Lauren Darcey & Shane Conder
Language: eng
Format: epub
Publisher: Addison-Wesley Professional
Published: 2012-06-12T16:00:00+00:00
message += part.
getDisplayMessageBody();
if (sender == null) {
sender = part.
getDisplayOriginatingAddress();
}
}
receivedMessage.setText(
message + "\nFrom: "+sender);
numberEntry.setText(sender);
}
}
};
registerReceiver(rcvIncoming, new IntentFilter(
"android.provider.Telephony.SMS_RECEIVED"));
This block of code is placed in the onCreate() method of the Activity. First, the message Bundle is retrieved. In it, an array of Objects holds several byte arrays that contain PDU data—the data format that is customarily used by wireless messaging protocols. Luckily, the Android SDK can decode these with a call to the static SmsMessage.createFromPdu() utility method. From here, we can retrieve the body of the SMS message by calling getDisplayMessageBody().
The message that comes in might be longer than the limitations for an SMS. If it is, it will have been broken up in to a multipart message on the sending side. To handle this, we loop through each of the received Object parts and take the corresponding body from each, while only taking the sender address from the first.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Deep Learning with Python by François Chollet(15897)
The Mikado Method by Ola Ellnestam Daniel Brolund(13160)
Hello! Python by Anthony Briggs(12990)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(12175)
Dependency Injection in .NET by Mark Seemann(12027)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(10799)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(10614)
A Developer's Guide to Building Resilient Cloud Applications with Azure by Hamida Rebai Trabelsi(10536)
Grails in Action by Glen Smith Peter Ledbrook(10095)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(9972)
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(9460)
Hit Refresh by Satya Nadella(9040)
Kotlin in Action by Dmitry Jemerov(8687)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(8634)
The Kubernetes Operator Framework Book by Michael Dame(8484)
Exploring Deepfakes by Bryan Lyon and Matt Tora(8305)
Robo-Advisor with Python by Aki Ranin(8260)
Practical Computer Architecture with Python and ARM by Alan Clements(8232)
Implementing Enterprise Observability for Success by Manisha Agrawal and Karun Krishnannair(8201)