automatically read Text from a TextView with TalkBack?

96 views
Skip to first unread message

Petra Ritter

unread,
Oct 14, 2018, 12:23:02 PM10/14/18
to Eyes-free Programming and development
Hello,

How I can get Talkback  to reed text that appear in a Textview?

I habe got a simple example app that I would like  to make accessible.

The app asked the user "How your are?" then had the user 4 possibilities (buttons) to choose from to anser the question.
Für each answer of the usr there is a text as an answer from the app e.g if the user press the  button "Good" the app responds to it with the message "I'm glad?"

  1. How I get Talkback to read out the TextView soon is started? As I would like that the app welcome the Talkback user like the sighted user 
  2. How I get Talkback to read out the TextView soon as that user presst a button?
The JAVA source code looks like this:

final TextView Anzeige1 =
(TextView) findViewById (R.id.textView);
Button Knopf1 =(Button) findViewById (R.id.button);
Button Knopf2 ...
....
....
Knopf1.setOnClickListener (new View.OnClickListener () {
@Override
public void onClick(View v) {
Anzeige1.setText (R.string.Sting_Plus);
}
});

Knopf2.setOnClickListener ...
...
...

Petra



Russell James

unread,
Oct 14, 2018, 3:15:58 PM10/14/18
to eyes-f...@googlegroups.com
I'm sorry I can't give you code snippets/exabples

You don't need to use Talkback to do speech output.
If you want your app to speak there is a TTS API for that.
However, you could do your user voice greeting as a toast message
That would appear on the lower screen and be spoken by Talkback
That is for users with Talkback enabled
Other users could use the toast message displayed

You can also check out the making your app accessible section of the Android Developers reference

Hope this helps

Russ

--
You received this message because you are subscribed to the Google Groups "Eyes-free Programming and development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eyes-free-de...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Саша Козловский

unread,
Oct 14, 2018, 6:50:29 PM10/14/18
to eyes-f...@googlegroups.com

Akash Kakkar

unread,
Oct 15, 2018, 1:52:26 AM10/15/18
to eyes-f...@googlegroups.com
Hi Petra,
you can use the property: android:accessibility-liveregion="assertive"
on the textview.\
now, as soon as your textview will be updated with any of the text, tb
will announce it.
also, you can send an type_accessibility_announcement event in order
to make talkback announce something on demand without using tts api
calls.
Reply all
Reply to author
Forward
0 new messages