Page 1 of 1

ExecSystem function - passing intent parameters when starting external activity

Posted: April 13th, 2020, 3:22 pm
by alex_izm
Salutations my fellow CSPro users.

I have a need to start an external app from the CSEntry application. As documentation states that is achieved by calling ExecSystem function with parameter "app:app.name". However I was wondering if there was a way to start an external activity and also pass some parameters to said activity along with the start intent? Is something like this possible at all? if not, is there some kind of workaround that I'm missing?

Thanks!!!
Alex

Re: ExecSystem function - passing intent parameters when starting external activity

Posted: April 13th, 2020, 3:57 pm
by htuser
Hi Alex,
However I was wondering if there was a way to start an external activity and also pass some parameters to said activity along with the start intent?
Yes. The new SystemApp Object allow to interact with external activities and also pass some parameters using SystemApp.SetArgument Function. You can also get data from other applications using SystemApp.GetResult Function.
Please download the latest beta: https://www.csprousers.org/beta/ and read more about the new SystemApp Object.

And as Greg and Josh written me days ago:
With SystemApp, you can communicate back and forward between another application, sending data to it and receiving data from it. There is an example of it here:
https://github.com/CSProDevelopment/CSE ... lback-demo

...we’ve implemented SystemApp as a way for users to have a seamless way to communicate between CSEntry and another app.
This interest me greatly since right now, we can access to other application and other applications can also access to CSEntry data and activities. I'll try to implement a CSEntry helper and we can share experiences about in the next weeks.

However,the Developer Team can give you more explanations about it.
Best,

Re: ExecSystem function - passing intent parameters when starting external activity

Posted: April 13th, 2020, 5:01 pm
by josh
Systemapp is new in version 7.4 and it is documented in the latest beta release. You can download that and search for systemapp in the help. It lets you set numeric and string parameters that will get passed to the Activity you are launching as part of the intent. For example the following code will launch maps with driving directions from your current location to the US Census Bureau:
SystemApp nav_to;
nav_to.setArgument(
"DATA", "google.navigation:q=US+Census+Bureau");
nav_to.setArgument(
"ACTION", "android.intent.action.VIEW");
nav_to.exec(
"com.google.android.apps.maps");

Re: ExecSystem function - passing intent parameters when starting external activity

Posted: April 14th, 2020, 9:52 am
by alex_izm
Great, this is exactly what I was looking for! Thanks Josh, Htuser!!!

I am still in 7.3, but will now definitely check out 7.4 beta.

Alex