How do I define apps via mit app inventor? (find my second application using the first one)

I ran into a problem, I need to determine the availability of the application through the mit app inventor, but I don’t know how.

1 Like

I do not understand the question... please elaborate...
Taifun

1 Like

I need to find my second application using the first one. So that you can install it if it's not there.

1 Like

Something like an update installer.

1 Like

try the packagemanager extension to find out, if your app is installed App Inventor Extensions: Package Manager | Pura Vida Apps
and read also chapter "Questions and Answers" there

Taifun

2 Likes

Have you tried Using the Activity Starter

## Starting other external apps

You can use the Activity Starter to start any activity at all. You’ll need to know the package name and class name, or the appropriate intent.

Is the application available on the device?*

If your app tries to start other apps, you'll want to check that those other apps are available on your user's phone before trying to start them. You can determine this using the ActivityStarter.ResolveActivity , which returns the name of the Activity that would be started by ActivityStarter.StartActivity, given the package or other information you've provided. If this name is blank, then the required application is not present, and you can make your app alert the user.

3 Likes

Thanks guys, i will use both ways.

1 Like

Can you give more details? I just didn't get it completely.

1 Like

Details are in the ActivityStarter link Nikko.

If your second app is made with App Inventor there are detailed explanations in the link. For other apps, you need to know the second app package name and class name which you would have to research.

What have you tried? You need to use the ActivityStarter component.

1 Like

Unfortunately, it is not that simple in android 11. Google has implemented security and additional permission is required to check if the package is installed.

1 Like

Yes, I used the ActivityStarter component and only managed to start the application, but I only need to check for the existence of the given application, not start.

1 Like

I agree, but to find out some things I use an emulator, in my case VPhoneGaGa.

1 Like

Did you read this?

Is the application available on the device?

If your app tries to start other apps, you'll want to check that those other apps are available on your user's phone before trying to start them. You can determine this using the ActivityStarter.ResolveActivity , which returns the name of the Activity that would be started by ActivityStarter.StartActivity, given the package or other information you've provided. If this name is blank, then the required application is not present, and you can make your app alert the user.

1 Like

Okay, where to use Activity Starter.ResolveActivity?

1 Like

I'm just new to this.

1 Like

Something like
asResolveActivity

in the ActivityStarter.AfterActivity Block

might work (untested). Did it work for you?

1 Like

Thanks. I set ActivityPackage, ActivityClass and Did almost everything as in the picture (just changed what happens). The application is simply launched, and nothing happens when it comes back.

1 Like

Shall I drop blocks and settings?

1 Like

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


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

1 Like

blocks (1)

1 Like