Integrate a second application (open an non App Inventor app from an App Inventor app)

pleae follow chapter "Discovering how to set the ActivityStarter properties" from the link provided earlier, here is it again Using the Activity Starter

Discovering how to set the ActivityStarter properties

If you want to start an app and you you don't have the source code or documentation, you might still be able figure out the package name and class name (and sometimes the intent) by launching the app and inspecting the Android system log.

For example, if you use the YouTube application to play a video, you'll see in the log:

I/ActivityManager( 86): Starting activity: Intent { act=android.intent.action.VIEW dat=vnd.youtube:nAPk9ycCbfc cmp=com.google.android.youtube/.PlayerActivity }

If you can find the "cmp=" string, then the ActivityPackage is the part before the slash, e.g., com.google.android.youtube. The ActivityClass is is the entire "cmp=" part, without the slash character, e.g., com.google.android.youtube.PlayerActivity. There may also in general be "dat=" information that should be specify as the DataUri property.

How to inspect the log see also here

Taifun

Try this: launchZettle.aia (22.2 KB)

I used a new extension that declares a required permission for Android 11+.
So build the APK and try. (Make sure Zettle app is installed first.)

grafik

2 Likes

It runs well for launching my app, but how can I know the packageName for others apps?

Exactly as I showed in the first block.

1 Like

Anke's solution is much better than Package Manager Extension :+1: :+1:
There is also a way with activity starter ?

Yes there is.. for example ...

4 Likes

Thanks, it runs for Ai2 apps, can I use the same sintax for others apps ?

Yes you can

1 Like

Thanks, I think Anke's way is more simple

1 Like

How can I export this extension from your project ?

1 Like

Hi thanks I tried your example and it works but where can I download the extension? Is there a way to send the total to be paid directly on the zettlz application?

Here you go:
AllPackages.aix (4.2 KB)

2 Likes

pkgutils is missing

https://www.sunnythedeveloper.xyz/2019/12/21/pkgutils-an-extension-to-work-with-packages/

1 Like

i try to download but it says not found

You are right

@vknow360

Sorry, you need to be logged in to download attachments.