Skip to content
kennydude edited this page Jun 20, 2011 · 1 revision

To make your app announce things, it's really easy! You could even add Desktop Notifier support at the same time if it's right for your app.

Now, you need to call this from a context because it's just a "Broadcast". Simply do this:

Intent intent = new Intent("me.kennydude.speaker.SPEAK_MESSAGE");
intent.putExtra("title", "Hello");
intent.putExtra("description", "This is what I want to say");
sendBroadcast(intent);

The format and code for sending this is exactly the same as desktop notifier, so if you want add this to make it work on desktop notifer:

intent.putExtra("no_speak", true);
intent.setAction("org.damazio.notifier.service.UserReceiver.USER_MESSAGE");
sendBroadcast(intent);

There is an extra which Desktop Notifier ignores, which is "no_speak". This basically makes Desktop Notifier send the message to device, and Speaker ignore it (so you don't end up with messages repeating, people will think the phone is a parrot!)

Also, you can miss out either title or description, they are mainly only for Desktop Notifier, so you can miss out either title or description, they are mainly only for Desktop Notifier

Clone this wiki locally