Using the accelerometer sensor (Talk to Me Part 2 tutorial issues)

Hello all,
I tried the "Talk to me 2" tutorial, and the app doesn't work fine, in AI Companion, and as well as after building and using the app alone.
I think this issue comes from the permission to use the motion sensor in Android, but my app is not showing up in the allowed ones when looking at the permissions in android developer mode. Do you know how I can authorize the use of the accelerometer sensor in Android ?
In fact, when I launch the app, the app is unresponsive and I can't enter any text in the edit box, nor have the app read that text. Just when I close the app, I can hear a part of the text in the edit box
Thank you for your suggestions.


You did the
TalkToMe Part 2: Shaking and User Input. This is a tutorial using the TextToSpeech component and the accelerometer (to shake the Android). It is very simple code. The accelerometer shouldn't require any permissions.

You might show the code you tried to get specific help. What Android version are you testing using the Companion. You cannot test this project using an emulator.

You might load this aia

TalkToMe.aia (2.0 KB) . The modified Talk To Me Project works in an Android 8.1 tablet and should work in your phone . If your device does not have accelerometer hardware, it will display a message telling you. Most, but not all Androids have accelerometer hardware.

Does this example work and what you coded does not?

My android version is 9, and I'm not using an emulator.
But, the code you gave me works fine. I just made a mistake and choosed the bloc AccelerometerSensor1.Acceleration Changed instead of AccelerometerSensor1.Shaking. So, as the acceleration must change continuously when I use my phone (if sensitivity is too big), maybe the event is thrown continuously, and the app can't handle all these events ?
In any case, thank you for your help.

Yes, if you continuously shake, without a break, the stop shaking message gets confused. You don't let the app keep up with the TTS message cue if you don't occasionally pause the shaking. The app is simple; do not make more of it than there is. Have fun.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.