January 30, 2015

Voice Enable Your Android Object Pascal Apps

Learn how to add text-to-speech and voice recognition to your Android Apps. This session also covers voice launch on Google Glass.



This is a video replay from the CodeRage 9 online developer conference.

    1 comment:

    Unknown said...

    Hello,
    I'm writing an android app using XE6 to broadcast incoming SMS. I need an help, because I don't know how to read and manage pdus records that contains message information, like the following Java sample:


    public class IncomingSms extends BroadcastReceiver {

    // Get the object of SmsManager
    final SmsManager sms = SmsManager.getDefault();

    public void onReceive(Context context, Intent intent) {

    // Retrieves a map of extended data from the intent.
    final Bundle bundle = intent.getExtras();

    try {

    if (bundle != null) {

    final Object[] pdusObj = (Object[]) bundle.get("pdus");

    for (int i = 0; i < pdusObj.length; i++) {

    SmsMessage currentMessage = SmsMessage.createFromPdu((byte[]) pdusObj[i]);
    String phoneNumber = currentMessage.getDisplayOriginatingAddress();

    String senderNum = phoneNumber;
    String message = currentMessage.getDisplayMessageBody();

    Log.i("SmsReceiver", "senderNum: "+ senderNum + "; message: " + message);


    // Show Alert
    int duration = Toast.LENGTH_LONG;
    Toast toast = Toast.makeText(context,
    "senderNum: "+ senderNum + ", message: " + message, duration);
    toast.show();

    } // end for loop
    } // bundle is null

    } catch (Exception e) {
    Log.e("SmsReceiver", "Exception smsReceiver" +e);

    }
    }
    }

    thanks a lot.
    Angelo