Issue with opening apps via voice command (Taifun PackageManager extension)

Hello,

I am developing an application in MIT App Inventor and I am trying to allow users to open applications on their device using voice commands. I am using the Taifun Manager package, but I am facing a problem.

When I ask to open a specific application, the system redirects me to an unrelated application. I have tried this with different applications, but the problem persists.

I have checked the permissions and how I handle package names, but I still cannot get it to work properly. Is there a solution or way to bypass this limitation?

Thank you in advance for your help!
Thank you,
Dimitris Stratouris

It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.

To get an image of your blocks, right click in the Blocks Editor and select "Download Blocks as Image". You might want to use an image editor to crop etc. if required. Then post it here in the community.

Taifun

does the example project work for you?

Taifun

I use this extension and yes, your example worked for me and I wanted to change the example a little, that is, to go to button1 and the application I mentioned opens. Here are the screenshots along with the problem.



Dimitris Stratouris

Or there is this:

https://groups.google.com/g/mitappinventortest/c/FWM4Q8zE8JI/m/Gq1PPmz6BwAJ

the speech recognizer might not understand exactly the app name you like to start
let me suggest you to add a notifier fo find out, what the speech recognizer understood and if that corresponds to the app name of the app you like to open

example: if you want toopen the ZXing app, the app name must be "Barcode Scanner" exactly as it is written here to then get the correct package name you are looking for to open the app

unknown

Taifun

Isn't that the problem?


Dimitris Stratouris

the question is: why do you get that error message?
why not following the suggestion I provided earlier?
let's take a look again at your blocks...
unknown

those do not make much sense, do they?
you do not do anything with the result provided by the speech recognizer...
and global speechResult is an empty text

I would display the result in a label or notifier to find out if it is reasonable and then use that result to find the correct package name

Taifun

Ok thank you. One question: Is there a possibility that the speechrecognizer will arrive without using capital letters? Is there a way to fix it?

You can find upcase and downcase blocks in the text drawer

Taifun

Thank you. Did you find the problem?

You confirmed that the example project is working fine for you, i.e. the extension is working fine

up to now unfortunately you did not provide a screenshot of some updated blocks to fix your errors, also you did not provide an example of app name and package name which result in that error

Taifun

The name of my application is DG-AI, and I am trying to use the speechrecognizer to open my applications that are on my mobile. Unfortunately, the mobile does not let me and asks me to do the same unrelated application. I will now try the solution you gave me because I was not at home.
Thank you

It doesn't working

Well,

Taifun

Hello,

Thank you for your response. I understand that I need to provide more details, so I am providing the following information:

  1. Screenshot of updated blocks:
  2. Example of app & package name: I am trying to open various apps via voice command.
  3. Problem:
  • My phone does not allow me to open the app I am requesting.
  • Instead, it redirects me to a completely unrelated app.
  • I have tried other apps, but the problem remains the same—it always throws me to the same wrong app.

What I am trying to do:
I want to use voice commands to open any installed app on my device.
My approach is as follows:

  1. I am using the TaifunPackageManager extension to retrieve all the package names of the installed apps.
  2. I store the list of packages in a variable (appList).
  3. I use Speech Recognizer to detect the name of the application that the user says.
  4. I use TaifunPackageManager.LaunchApp to open the selected application.

However, it does not work as expected.
Instead of opening the application I request, it throws me into another unrelated application.

Is there any way to solve this problem?


We also mentioned something in capital letters, how do I make it? Could you show me an example?

Thanks in advance for your help! :blush:

Dimitris

Start reading again from here

and fix your blocks

Taifun

I understand your point. The problem is that the system does not allow me to open apps and always redirects me to an unrelated application. I have already tried displaying the SpeechRecognizer result in a Label, and the voice command is correctly recognized. However, when I try to match the result with the package name of the app, it does not work properly.

I have also tested other apps, but the issue persists. Could you provide more details on how to correctly retrieve the package name and use it properly in LaunchApp via TaifunPackageManager?

Thanks for your guidance!

here is a working solution


packagemanager.aia (24.3 KB)

Taifun

1 Like

I saw the.aia but there is a problem at the moment the system does not recognize the capital and that is why it does not open the application I am talking about, for example Google. How can it be fixed