Download "EasyAccess for Android" Implementation

Transcript
if (preferences.getFloat("size", 0) != 0) {
float fontSize = preferences.getFloat("size", 0);
textView.setTextSize(fontSize);
} else {
textView.setTextSize(Integer.valueOf(context.getResources().getString(
R.string.textSize)));
}
return rowView;
}
8.0 Text Messaging
The Text Messaging app allows the user to compose, view and delete text messages.
8.1 SmsReceiver
The SmsReceiver class listens to incoming messages and plays the corresponding
ringtone. IT then redirects to the Text Messaging app of EasyAccess. If version of the OS
running on the device is greater than 18, and EasyAccess is set as the default messaging
app, we have to write the code to send the message to the inbox.
if (intent.getAction().equals("android.provider.Telephony.SMS_RECEIVED")) {
Bundle bundle = intent.getExtras();
SmsMessage[] msgs = null;
String sender = null;
if (bundle != null) {
try {
Object[] pdus = (Object[]) bundle.get("pdus");
msgs = new SmsMessage[pdus.length];
// read the details of the originating address and search for
// the number in contacts
// play ringtone
Utils.ringtone = RingtoneManager.getRingtone(context,
Settings.System.DEFAULT_NOTIFICATION_URI);
Utils.ringtone.play();
// if default app
if (android.os.Build.VERSION.SDK_INT >= 19) {
IDEAL Group, Inc.
”EasyAccess for Android” Developer Documentation
Page 96 of 118